summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>2020-07-27 12:33:32 +0200
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2020-07-27 12:33:32 +0200
commite2879bb5c7075a75767d803687f5361b4503e51d (patch)
tree185fdb64787bcea98adea0c6de2c60dcf73c3709
parent7771b57ed4e6f8482b5de8a5bafe3da79a0fa2bf (diff)
downloadsettings-e2879bb5c7075a75767d803687f5361b4503e51d.tar.gz
settings-e2879bb5c7075a75767d803687f5361b4503e51d.tar.bz2
settings-e2879bb5c7075a75767d803687f5361b4503e51d.zip
info-popup: enhance interface & docs
Fix issue with wrong parent in reset. Change-Id: I93fa8428de656b2bcb6df05e2421000e37acb9ca
-rw-r--r--setting-common/include/controls/info-popup.h16
-rw-r--r--setting-common/src/controls/info-popup.c3
-rw-r--r--setting-reset/src/setting-reset-main.c6
3 files changed, 19 insertions, 6 deletions
diff --git a/setting-common/include/controls/info-popup.h b/setting-common/include/controls/info-popup.h
index 08069e1..cb45682 100644
--- a/setting-common/include/controls/info-popup.h
+++ b/setting-common/include/controls/info-popup.h
@@ -42,17 +42,29 @@
* evas_object_show(cp);
*/
+/**
+ * @brief Creates new info popup instance.
+ */
Evas_Object *info_popup_create(Evas_Object *parent);
+/**
+ * @brief Set title of popup.
+ */
void info_popup_title_set(Evas_Object *popup, const char *title);
+/**
+ * @brief Set main text.
+ */
void info_popup_text_set(Evas_Object *popup, const char *text);
+/**
+ * @brief Set "OK" button text.
+ */
void info_popup_ok_text_set(Evas_Object *popup, const char *text);
/**
- * @Utility function creating and showing info popup with "OK" button
+ * @Utility function creating and showing info popup
*/
-void info_popup_show_message(Evas_Object *parent, const char *title, const char *text);
+void info_popup_show_message(Evas_Object *parent, const char *title, const char *text, const char *ok_text);
#endif /* end of include guard: INFO_POPUP_H */
diff --git a/setting-common/src/controls/info-popup.c b/setting-common/src/controls/info-popup.c
index 00cd638..768bc7a 100644
--- a/setting-common/src/controls/info-popup.c
+++ b/setting-common/src/controls/info-popup.c
@@ -59,12 +59,13 @@ void info_popup_ok_text_set(Evas_Object *popup, const char *text)
}
EXPORT_PUBLIC
-void info_popup_show_message(Evas_Object *parent, const char *title, const char *text)
+void info_popup_show_message(Evas_Object *parent, const char *title, const char *text, const char *ok_text)
{
Evas_Object *cp = info_popup_create(parent);
info_popup_title_set(cp, title);
info_popup_text_set(cp, text);
+ info_popup_ok_text_set(cp, ok_text);
evas_object_show(cp);
}
diff --git a/setting-reset/src/setting-reset-main.c b/setting-reset/src/setting-reset-main.c
index 767ab30..04bbac8 100644
--- a/setting-reset/src/setting-reset-main.c
+++ b/setting-reset/src/setting-reset-main.c
@@ -150,14 +150,14 @@ static void _show_reset_initial_config_result_popup(Evas_Object *parent, bool re
const char *title = _("IDS_ST_BODY_RESET_INITIAL_CONFIGURATION");
const char *content = result ? _("IDS_IM_BODY_SUCCESSFULLY_COMPLETED") : _("IDS_IM_POP_UNEXPECTED_ERROR");
- info_popup_show_message(parent, title, content);
+ info_popup_show_message(parent, title, content, _("IDS_ST_BUTTON_OK_ABB"));
}
static void _on_confirmed_reset_initial_config(void *data, Evas_Object *obj, void *event_info)
{
int result = setting_reset_initial_config();
evas_object_del(obj);
- _show_reset_initial_config_result_popup(obj, result == 0);
+ _show_reset_initial_config_result_popup(data, result == 0);
}
static void setting_reset_initial_config_clicked(void *data, Evas_Object *obj, void *event_info)
@@ -168,7 +168,7 @@ static void setting_reset_initial_config_clicked(void *data, Evas_Object *obj, v
snprintf(popupmsg, MAX_POPUPMSG, "<align=center>%s<br>%s</align>",
_("IDS_MSG_RESET_INITIAL_CONFIGURATION"), _("IDS_MSG_RESET_CANNOT_BE_UNDONE"));
confirm_popup_text_set(confirm_popup, popupmsg);
- evas_object_smart_callback_add(confirm_popup, "confirmed", _on_confirmed_reset_initial_config, NULL);
+ evas_object_smart_callback_add(confirm_popup, "confirmed", _on_confirmed_reset_initial_config, md->window);
evas_object_smart_callback_add(confirm_popup, "rejected", _dismiss_popup, NULL);
elm_genlist_item_selected_set(event_info, EINA_FALSE);
evas_object_show(confirm_popup);