summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-25 11:53:33 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-25 11:53:33 +0100
commitf64ce3f5afad89276b8e54688a4df668c4e1ee34 (patch)
tree89637cd42621823ae40c45da7e8d3941d559c054 /src
parentac6ad8cb9618f4ffde641f42df34f140f67b3662 (diff)
e polkit - improve ui to disable widgets while doing auth plus padding
Diffstat (limited to 'src')
-rw-r--r--src/modules/polkit/auth_ui.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/modules/polkit/auth_ui.c b/src/modules/polkit/auth_ui.c
index 88639ebf4..fc146c4bc 100644
--- a/src/modules/polkit/auth_ui.c
+++ b/src/modules/polkit/auth_ui.c
@@ -41,6 +41,10 @@ _cb_ok(void *data EINA_UNUSED, Evas_Object *obj,
41 41
42 if (!ps) return; 42 if (!ps) return;
43 if (ps->exe_exit_handler) return; 43 if (ps->exe_exit_handler) return;
44 elm_object_disabled_set(evas_object_data_get(obj, "label"), EINA_TRUE);
45 elm_object_disabled_set(evas_object_data_get(obj, "entry"), EINA_TRUE);
46 e_dialog_button_disable_num_set(evas_object_data_get(obj, "dia"), 0, 1);
47 e_dialog_button_disable_num_set(evas_object_data_get(obj, "dia"), 1, 1);
44 ps->exe_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, 48 ps->exe_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
45 _auth_cb_exit, ps); 49 _auth_cb_exit, ps);
46 if (str) 50 if (str)
@@ -82,7 +86,7 @@ void
82auth_ui(Polkit_Session *ps) 86auth_ui(Polkit_Session *ps)
83{ 87{
84 E_Dialog *dia; 88 E_Dialog *dia;
85 Evas_Object *o, *win, *box, *ent; 89 Evas_Object *o, *win, *box, *fr, *lab, *ent;
86 90
87 dia = e_dialog_new(NULL, "E", "_polkit_auth"); 91 dia = e_dialog_new(NULL, "E", "_polkit_auth");
88 e_dialog_title_set(dia, _("Please enter password")); 92 e_dialog_title_set(dia, _("Please enter password"));
@@ -114,25 +118,44 @@ auth_ui(Polkit_Session *ps)
114 evas_object_show(o); 118 evas_object_show(o);
115 */ 119 */
116 120
117 o = elm_label_add(win); 121 fr = o = elm_frame_add(win);
122 elm_object_style_set(o, "pad_medium");
118 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 123 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
119 evas_object_size_hint_align_set(o, 0.0, 0.0); 124 evas_object_size_hint_align_set(o, 0.0, 0.0);
125 elm_box_pack_end(box, o);
126 evas_object_show(o);
127
128 lab = o = elm_label_add(win);
129 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
130 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
120 elm_object_text_set(o, ps->message); 131 elm_object_text_set(o, ps->message);
132 elm_object_content_set(fr, o);
133 evas_object_show(o);
134 evas_object_data_set(win, "label", o);
135
136 fr = o = elm_frame_add(win);
137 elm_object_style_set(o, "pad_medium");
138 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
139 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 1.0);
121 elm_box_pack_end(box, o); 140 elm_box_pack_end(box, o);
122 evas_object_show(o); 141 evas_object_show(o);
123 142
124 ent = o = elm_entry_add(win); 143 ent = o = elm_entry_add(win);
125 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 144 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
126 evas_object_size_hint_align_set(o, -1.0, 1.0); 145 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
127 elm_entry_single_line_set(ent, EINA_TRUE); 146 elm_entry_single_line_set(o, EINA_TRUE);
128 elm_entry_scrollable_set(ent, EINA_TRUE); 147 elm_entry_scrollable_set(o, EINA_TRUE);
129 elm_entry_password_set(ent, EINA_TRUE); 148 elm_entry_password_set(o, EINA_TRUE);
130 elm_object_part_text_set(ent, "elm.guide", "Enter Password"); 149 elm_object_part_text_set(o, "elm.guide", "Enter Password");
131 evas_object_data_set(ent, "session", ps); 150 evas_object_data_set(o, "session", ps);
132 evas_object_smart_callback_add(ent, "activated", _cb_ok, NULL); 151 evas_object_data_set(o, "label", lab);
133 evas_object_smart_callback_add(ent, "aborted", _cb_cancel, NULL); 152 evas_object_data_set(o, "entry", ent);
134 elm_box_pack_end(box, o); 153 evas_object_data_set(o, "dia", dia);
154 evas_object_smart_callback_add(o, "activated", _cb_ok, win);
155 evas_object_smart_callback_add(o, "aborted", _cb_cancel, win);
156 elm_object_content_set(fr, o);
135 evas_object_show(o); 157 evas_object_show(o);
158 evas_object_data_set(win, "entry", o);
136 159
137 e_dialog_button_add(dia, _("OK"), NULL, _cb_button_ok, ent); 160 e_dialog_button_add(dia, _("OK"), NULL, _cb_button_ok, ent);
138 e_dialog_button_add(dia, _("Cancel"), NULL, _cb_button_cancel, ent); 161 e_dialog_button_add(dia, _("Cancel"), NULL, _cb_button_cancel, ent);