*/
#include "popup.h"
#include "popup-string.h"
+#include "common/exception.h"
#include <package-info.h>
#include <app_control.h>
Popup::~Popup()
{
- if (m_win != nullptr)
- evas_object_del(m_win);
+ try {
+ if (m_win != nullptr)
+ evas_object_del(m_win);
+ } catch (const std::exception& e) {
+ ERROR("std exception: " << e.what());
+ }
}
void Popup::setButtons(const std::vector<Popup::Button> &buttons)
void Popup::setRotationToWin(Evas_Object *win) noexcept
{
- if (!elm_win_wm_rotation_supported_get(win)) {
- DEBUG("Window manager doesn't support rotation.");
- return;
+ try {
+ if (!elm_win_wm_rotation_supported_get(win)) {
+ DEBUG("Window manager doesn't support rotation.");
+ return;
+ }
+
+ int rots[4] = { 0, 90, 180, 270 };
+ elm_win_wm_rotation_available_rotations_set(win,
+ reinterpret_cast<const int *>(&rots), 4);
+ evas_object_smart_callback_add(win, "rotation,changed",
+ rotationChangedCb, m_popup);
+ } catch (const std::exception& e) {
+ ERROR("std exception: " << e.what());
}
-
- int rots[4] = { 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(win,
- reinterpret_cast<const int *>(&rots), 4);
- evas_object_smart_callback_add(win, "rotation,changed",
- rotationChangedCb, m_popup);
}
void Popup::setText(Evas_Object *obj, const std::string &text) noexcept