summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-06 14:31:58 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-06 14:31:58 +0200
commit15fb3cf363993e366867be2690daf602b91197cd (patch)
tree181e5370af968cb579594fa9105ce13e4bc0c46e
parent31531e4d383684e086e624cdac39d8766768f29e (diff)
settingspane: remove changed/apply/reset
as raster said, not needed.
-rw-r--r--src/bin/config.c20
-rw-r--r--src/bin/test_settingspane.c60
-rw-r--r--src/lib/elc_settingspane.c390
-rw-r--r--src/lib/elm_settingspane.eo27
-rw-r--r--src/lib/elm_settingspane_item.eo48
5 files changed, 96 insertions, 449 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index bcf2213c8..62d750c3e 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -3715,53 +3715,53 @@ _status_config_full(Evas_Object *win,
3715 it = elm_settingspane_item_append(settings, NULL, "Sizing", NULL); 3715 it = elm_settingspane_item_append(settings, NULL, "Sizing", NULL);
3716 elm_settingspane_item_image_set(it, NULL, "zoom-fit-best"); 3716 elm_settingspane_item_image_set(it, NULL, "zoom-fit-best");
3717 elm_settingspane_item_description_set(it, "Set the scale of elementary widgets"); 3717 elm_settingspane_item_description_set(it, "Set the scale of elementary widgets");
3718 elm_settingspane_item_attach_panel(it, _status_config_sizing, NULL, NULL); 3718 elm_settingspane_item_attach_panel(it, _status_config_sizing);
3719 elm_settingspane_item_keywords_set(it, "size, scale"); 3719 elm_settingspane_item_keywords_set(it, "size, scale");
3720 3720
3721 it = elm_settingspane_item_append(settings, NULL, "Theme", NULL); 3721 it = elm_settingspane_item_append(settings, NULL, "Theme", NULL);
3722 elm_settingspane_item_attach_panel(it, _status_config_themes, NULL, NULL); 3722 elm_settingspane_item_attach_panel(it, _status_config_themes);
3723 elm_settingspane_item_image_set(it, NULL, "preferences-desktop-theme"); 3723 elm_settingspane_item_image_set(it, NULL, "preferences-desktop-theme");
3724 elm_settingspane_item_description_set(it, "Choose from your installed themes"); 3724 elm_settingspane_item_description_set(it, "Choose from your installed themes");
3725 3725
3726 it = elm_settingspane_item_append(settings, NULL, "Fonts", NULL); 3726 it = elm_settingspane_item_append(settings, NULL, "Fonts", NULL);
3727 elm_settingspane_item_attach_panel(it, _status_config_fonts, NULL, NULL); 3727 elm_settingspane_item_attach_panel(it, _status_config_fonts);
3728 elm_settingspane_item_image_set(it, NULL, "preferences-desktop-font"); 3728 elm_settingspane_item_image_set(it, NULL, "preferences-desktop-font");
3729 elm_settingspane_item_description_set(it, "Fonts to use for elm widgets"); 3729 elm_settingspane_item_description_set(it, "Fonts to use for elm widgets");
3730 3730
3731 it = elm_settingspane_item_append(settings, NULL, "Profiles", NULL); 3731 it = elm_settingspane_item_append(settings, NULL, "Profiles", NULL);
3732 elm_settingspane_item_attach_panel(it, _status_config_profiles, NULL, NULL); 3732 elm_settingspane_item_attach_panel(it, _status_config_profiles);
3733 elm_settingspane_item_image_set(it, NULL, "system-users"); 3733 elm_settingspane_item_image_set(it, NULL, "system-users");
3734 elm_settingspane_item_description_set(it, "The config profile to use"); 3734 elm_settingspane_item_description_set(it, "The config profile to use");
3735 3735
3736 it = elm_settingspane_item_append(settings, NULL, "Scrolling", NULL); 3736 it = elm_settingspane_item_append(settings, NULL, "Scrolling", NULL);
3737 elm_settingspane_item_attach_panel(it, _status_config_scrolling, NULL, NULL); 3737 elm_settingspane_item_attach_panel(it, _status_config_scrolling);
3738 elm_settingspane_item_image_set(it, NULL, "Scrollings"); 3738 elm_settingspane_item_image_set(it, NULL, "Scrollings");
3739 elm_settingspane_item_description_set(it, "system-run"); 3739 elm_settingspane_item_description_set(it, "system-run");
3740 3740
3741 it = elm_settingspane_item_append(settings, NULL, "Rendering", NULL); 3741 it = elm_settingspane_item_append(settings, NULL, "Rendering", NULL);
3742 elm_settingspane_item_attach_panel(it, _status_config_rendering, NULL, NULL); 3742 elm_settingspane_item_attach_panel(it, _status_config_rendering);
3743 elm_settingspane_item_keywords_set(it, "3D, gl, vsync"); 3743 elm_settingspane_item_keywords_set(it, "3D, gl, vsync");
3744 elm_settingspane_item_image_set(it, NULL, "video-display"); 3744 elm_settingspane_item_image_set(it, NULL, "video-display");
3745 elm_settingspane_item_description_set(it, "The engine to use to render"); 3745 elm_settingspane_item_description_set(it, "The engine to use to render");
3746 3746
3747 it = elm_settingspane_item_append(settings, NULL, "Caches", NULL); 3747 it = elm_settingspane_item_append(settings, NULL, "Caches", NULL);
3748 elm_settingspane_item_attach_panel(it, _status_config_caches, NULL, NULL); 3748 elm_settingspane_item_attach_panel(it, _status_config_caches);
3749 elm_settingspane_item_image_set(it, NULL, "appointment-new"); 3749 elm_settingspane_item_image_set(it, NULL, "appointment-new");
3750 elm_settingspane_item_description_set(it, "Sizes and flushing of the caches"); 3750 elm_settingspane_item_description_set(it, "Sizes and flushing of the caches");
3751 3751
3752 it = elm_settingspane_item_append(settings, NULL, "Audio", NULL); 3752 it = elm_settingspane_item_append(settings, NULL, "Audio", NULL);
3753 elm_settingspane_item_attach_panel(it, _status_config_audio, NULL, NULL); 3753 elm_settingspane_item_attach_panel(it, _status_config_audio);
3754 elm_settingspane_item_keywords_set(it, "sound, volume"); 3754 elm_settingspane_item_keywords_set(it, "sound, volume");
3755 elm_settingspane_item_image_set(it, NULL, "sound"); 3755 elm_settingspane_item_image_set(it, NULL, "sound");
3756 elm_settingspane_item_description_set(it, "Configure which sounds should be played"); 3756 elm_settingspane_item_description_set(it, "Configure which sounds should be played");
3757 3757
3758 it = elm_settingspane_item_append(settings, NULL, "Focus", NULL); 3758 it = elm_settingspane_item_append(settings, NULL, "Focus", NULL);
3759 elm_settingspane_item_attach_panel(it, _status_config_focus, NULL, NULL); 3759 elm_settingspane_item_attach_panel(it, _status_config_focus);
3760 //elm_settingspane_item_image_set(it, NULL, -fit-best"); 3760 //elm_settingspane_item_image_set(it, NULL, -fit-best");
3761 elm_settingspane_item_description_set(it, "Settings for the widget focus"); 3761 elm_settingspane_item_description_set(it, "Settings for the widget focus");
3762 3762
3763 it = elm_settingspane_item_append(settings, NULL, "Etc", NULL); 3763 it = elm_settingspane_item_append(settings, NULL, "Etc", NULL);
3764 elm_settingspane_item_attach_panel(it, _status_config_etc, NULL, NULL); 3764 elm_settingspane_item_attach_panel(it, _status_config_etc);
3765 elm_settingspane_item_image_set(it, NULL, "zoom-fit-best"); 3765 elm_settingspane_item_image_set(it, NULL, "zoom-fit-best");
3766 elm_settingspane_item_description_set(it, "Miscellaneous"); 3766 elm_settingspane_item_description_set(it, "Miscellaneous");
3767 3767
diff --git a/src/bin/test_settingspane.c b/src/bin/test_settingspane.c
index 6f6e8010f..3ba25c0ca 100644
--- a/src/bin/test_settingspane.c
+++ b/src/bin/test_settingspane.c
@@ -18,13 +18,6 @@ static const char* simple_menu[3][3] =
18}; 18};
19 19
20static void 20static void
21entry_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
22{
23 Elm_Settingspane_Item *it = data;
24 elm_settingspane_item_changed_set(it, EINA_TRUE);
25}
26
27static void
28anchor_clicked(void *data, Evas_Object *obj, void *event_info) 21anchor_clicked(void *data, Evas_Object *obj, void *event_info)
29{ 22{
30 Elm_Entry_Anchor_Hover_Info *ei = event_info; 23 Elm_Entry_Anchor_Hover_Info *ei = event_info;
@@ -70,7 +63,6 @@ content_font_get(Evas_Object *par, Elm_Settingspane_Item *item, void *data EINA_
70 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 63 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
71 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 64 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
72 elm_entry_single_line_set(o, EINA_TRUE); 65 elm_entry_single_line_set(o, EINA_TRUE);
73 evas_object_smart_callback_add(o, "changed", entry_changed, item);
74 elm_box_pack_end(box, o); 66 elm_box_pack_end(box, o);
75 evas_object_show(o); 67 evas_object_show(o);
76 68
@@ -123,7 +115,6 @@ content_theme_get(Evas_Object *par, Elm_Settingspane_Item *item, void *data EINA
123 elm_entry_single_line_set(o, EINA_TRUE); 115 elm_entry_single_line_set(o, EINA_TRUE);
124 elm_object_text_set(o, "Lets think you can set here a theme (:"); 116 elm_object_text_set(o, "Lets think you can set here a theme (:");
125 elm_box_pack_end(box, o); 117 elm_box_pack_end(box, o);
126 evas_object_smart_callback_add(o, "changed", entry_changed, item);
127 evas_object_show(o); 118 evas_object_show(o);
128 119
129 return box; 120 return box;
@@ -153,7 +144,6 @@ content_complex_child_get(Evas_Object *par, Elm_Settingspane_Item *item, void *d
153 elm_entry_single_line_set(o, EINA_TRUE); 144 elm_entry_single_line_set(o, EINA_TRUE);
154 elm_object_text_set(o, "EFL EFL EFL EFL EFL :) >>>change me<<<"); 145 elm_object_text_set(o, "EFL EFL EFL EFL EFL :) >>>change me<<<");
155 elm_box_pack_end(box, o); 146 elm_box_pack_end(box, o);
156 evas_object_smart_callback_add(o, "changed", entry_changed, item);
157 evas_object_show(o); 147 evas_object_show(o);
158 148
159 return box; 149 return box;
@@ -164,36 +154,6 @@ static Content_Get_Cb content_cb[4] =
164 content_font_get,content_color_get, content_theme_get, content_complex_child_get 154 content_font_get,content_color_get, content_theme_get, content_complex_child_get
165}; 155};
166 156
167
168static void
169reset_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
170{
171 Elm_Settingspane_Item *item = event_info;
172 elm_settingspane_item_changed_set(item, EINA_FALSE);
173}
174
175static void
176apply_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
177{
178 Elm_Settingspane_Item *item = event_info;
179 elm_settingspane_item_changed_set(item, EINA_FALSE);
180}
181
182static void
183highlight_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
184{
185 elm_settingspane_raise_unsaved(data);
186}
187
188static void
189save_q_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
190{
191 if (!elm_settingspane_save_quit(data))
192 printf("No.\n");
193 else
194 printf("Yes :)\n");
195}
196
197static void 157static void
198del_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 158del_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
199{ 159{
@@ -240,7 +200,7 @@ test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
240 it = elm_settingspane_item_append(sw, buf, simple_menu[i][0], NULL); 200 it = elm_settingspane_item_append(sw, buf, simple_menu[i][0], NULL);
241 elm_settingspane_item_description_set(it, simple_menu[i][1]); 201 elm_settingspane_item_description_set(it, simple_menu[i][1]);
242 elm_settingspane_item_image_set(it, buf, NULL); 202 elm_settingspane_item_image_set(it, buf, NULL);
243 elm_settingspane_item_attach_panel(it, content_cb[i], reset_cb, apply_cb); 203 elm_settingspane_item_attach_panel(it, content_cb[i]);
244 } 204 }
245 205
246 /* A complex item! */ 206 /* A complex item! */
@@ -260,7 +220,7 @@ test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
260 elm_settingspane_item_image_set(it2, buf, NULL); 220 elm_settingspane_item_image_set(it2, buf, NULL);
261 221
262 elm_settingspane_item_keywords_set(it2, "Heavyone,Third,"); 222 elm_settingspane_item_keywords_set(it2, "Heavyone,Third,");
263 elm_settingspane_item_attach_panel(it2, content_cb[3], reset_cb, apply_cb); 223 elm_settingspane_item_attach_panel(it2, content_cb[3]);
264 224
265 evas_object_show(sw); 225 evas_object_show(sw);
266 226
@@ -272,22 +232,6 @@ test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
272 evas_object_show(btnbox); 232 evas_object_show(btnbox);
273 233
274 o = elm_button_add(win); 234 o = elm_button_add(win);
275 elm_object_text_set(o, "Highlight Unsaved Changes");
276 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
277 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
278 evas_object_smart_callback_add(o, "clicked", highlight_cb, sw);
279 elm_box_pack_end(btnbox, o);
280 evas_object_show(o);
281
282 o = elm_button_add(win);
283 elm_object_text_set(o, "Everything Saved ?");
284 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
285 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
286 evas_object_smart_callback_add(o, "clicked", save_q_cb, sw);
287 elm_box_pack_end(btnbox, o);
288 evas_object_show(o);
289
290 o = elm_button_add(win);
291 elm_object_text_set(o, "Delete focused item"); 235 elm_object_text_set(o, "Delete focused item");
292 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 236 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
293 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 237 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
diff --git a/src/lib/elc_settingspane.c b/src/lib/elc_settingspane.c
index 01861cbb6..b7201049f 100644
--- a/src/lib/elc_settingspane.c
+++ b/src/lib/elc_settingspane.c
@@ -45,7 +45,6 @@ typedef struct
45 45
46 // list of all Elm_Item_Object 46 // list of all Elm_Item_Object
47 Eina_List *history_stack; 47 Eina_List *history_stack;
48 Eina_List *unsaved_changes;
49 48
50 Elm_Genlist_Item_Class *itcc; // , *itci; 49 Elm_Genlist_Item_Class *itcc; // , *itci;
51 50
@@ -67,7 +66,9 @@ typedef struct
67 66
68typedef struct 67typedef struct
69{ 68{
70 Eina_List *childs; //list of Elm_Settingspane_Item* 69 Eo *rel;
70
71 Eina_List *childs; //list of Elm_Settingspane_Item*#
71 72
72 const char *key_word; //< the original string which was given 73 const char *key_word; //< the original string which was given
73 Eina_List *key_words; //< list of strdupĀ“ed strings to match searching 74 Eina_List *key_words; //< list of strdupĀ“ed strings to match searching
@@ -79,14 +80,11 @@ typedef struct
79 void *data; 80 void *data;
80 81
81 Evas_Object *sw; //< widget where this is created 82 Evas_Object *sw; //< widget where this is created
82 Eina_Bool changed;
83 83
84 Elm_Widget_Item *it; 84 Elm_Widget_Item *it;
85 85
86 struct 86 struct
87 { 87 {
88 Evas_Smart_Cb apply;
89 Evas_Smart_Cb reset;
90 Content_Get_Cb content_get; 88 Content_Get_Cb content_get;
91 } event; 89 } event;
92 Panel *panel; //< if this item is realized its not NULL 90 Panel *panel; //< if this item is realized its not NULL
@@ -103,9 +101,6 @@ typedef struct _Search_Run
103 101
104static void _item_menu_refresh(Eo *obj, Elm_Settingspane_Item_Data *pd); 102static void _item_menu_refresh(Eo *obj, Elm_Settingspane_Item_Data *pd);
105 103
106static void _unsaved_changes_add(Evas_Object *w, Elm_Object_Item *item);
107static void _unsaved_changes_remove(Evas_Object *w, Elm_Object_Item *item);
108
109static void _history_stack_push(Evas_Object *w, Elm_Object_Item *it); 104static void _history_stack_push(Evas_Object *w, Elm_Object_Item *it);
110static Elm_Object_Item* _history_stack_pop(Evas_Object *w); 105static Elm_Object_Item* _history_stack_pop(Evas_Object *w);
111static Elm_Object_Item* _history_stack_current(Evas_Object *w); 106static Elm_Object_Item* _history_stack_current(Evas_Object *w);
@@ -116,7 +111,7 @@ static void _item_sel_cb(void *data, Evas_Object *obj, void *event_info);
116static void _search_panel_stop(Evas_Object *w); 111static void _search_panel_stop(Evas_Object *w);
117static Evas_Object* _elm_settingspane_icon_gen(Evas_Object *par, const char *file, const char *group); 112static Evas_Object* _elm_settingspane_icon_gen(Evas_Object *par, const char *file, const char *group);
118 113
119#define HAS_PANEL(id) (id->event.content_get) 114#define HAS_PANEL(id) (!id->childs)
120/* Data Keys in the layouts, DK = Data Key */ 115/* Data Keys in the layouts, DK = Data Key */
121 116
122#define DK_MAIN_MENU_SHOWED "__menu_layout_show" 117#define DK_MAIN_MENU_SHOWED "__menu_layout_show"
@@ -242,54 +237,17 @@ _title_bar_refresh(Evas_Object *w)
242 * ============================= 237 * =============================
243 */ 238 */
244 239
245static void
246_item_content_reset(Elm_Settingspane_Item *it)
247{
248 IC_DATA(it);
249
250 if (id->event.reset)
251 id->event.reset(id->data, id->sw, it);
252}
253
254static void
255_item_content_apply(Elm_Settingspane_Item *it)
256{
257 IC_DATA(it);
258
259 if (id->event.apply)
260 id->event.apply(id->data, id->sw, it);
261}
262
263static Evas_Object* 240static Evas_Object*
264_item_content_get(Elm_Settingspane_Item *it, Evas_Object *obj) 241_item_content_get(Elm_Settingspane_Item *it, Evas_Object *obj)
265{ 242{
266 IC_DATA(it); 243 IC_DATA(it);
267 244
268 if (id->event.content_get) 245 if (HAS_PANEL(id) && id->event.content_get)
269 return id->event.content_get(obj, it, id->data); 246 return id->event.content_get(obj, it, id->data);
270 else 247 else
271 return NULL; 248 return NULL;
272} 249}
273 250
274
275/*
276 * =====================================
277 * apply and reset of the items
278 * =====================================
279 */
280
281static void
282_content_layout_apply_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
283{
284 _item_content_apply(data);
285}
286
287static void
288_content_layout_reset_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
289{
290 _item_content_reset(data);
291}
292
293/* 251/*
294 * Callbacks for the items in the gengrid 252 * Callbacks for the items in the gengrid
295 */ 253 */
@@ -316,7 +274,7 @@ _elm_settingspane_ii_content_cb(void *data, Evas_Object *obj, const char *part)
316 274
317 if (!strcmp(part, "elm.swallow.icon")) 275 if (!strcmp(part, "elm.swallow.icon"))
318 { 276 {
319 res = _elm_settingspane_icon_gen(obj, id->file, id->group); 277 res = _elm_settingspane_icon_gen(obj, id->file, id->group);
320 } 278 }
321 else 279 else
322 { 280 {
@@ -327,22 +285,6 @@ _elm_settingspane_ii_content_cb(void *data, Evas_Object *obj, const char *part)
327 return res; 285 return res;
328} 286}
329 287
330static Elm_Settingspane_Item*
331_item_new(Evas_Object *obj, Elm_Settingspane_Item *par,
332 void *usr_data,
333 const char *name)
334{
335 Elm_Settingspane_Item *item = eo_add(ELM_SETTINGSPANE_ITEM_CLASS, par);
336 Elm_Settingspane_Item_Data *data = eo_data_scope_get(item, ELM_SETTINGSPANE_ITEM_CLASS);
337
338 data->data = usr_data;
339 data->sw = obj;
340 data->name = name;
341 data->key_words = NULL;
342 data->key_words = eina_list_append(data->key_words, eina_stringshare_add(name));
343 return item;
344}
345
346static void 288static void
347_back_check(Evas_Object *w) 289_back_check(Evas_Object *w)
348{ 290{
@@ -353,39 +295,6 @@ _back_check(Evas_Object *w)
353} 295}
354 296
355static void 297static void
356_unsaved_check(Evas_Object *w)
357{
358 C_DATA(w);
359 if (eina_list_count(wd->unsaved_changes) == 0)
360 elm_layout_signal_emit(w, EMIT_UNSAVED_DISABLE);
361 else
362 elm_layout_signal_emit(w, EMIT_UNSAVED_ENABLE);
363}
364
365static void
366_unsaved_changes_add(Evas_Object *w, Elm_Object_Item *item)
367{
368 Eina_List *node;
369 Elm_Object_Item *it;
370 C_DATA(w);
371 EINA_LIST_FOREACH(wd->unsaved_changes, node, it)
372 {
373 if (it == item)
374 return;
375 }
376 wd->unsaved_changes = eina_list_append(wd->unsaved_changes, item);
377 _unsaved_check(w);
378}
379
380static void
381_unsaved_changes_remove(Evas_Object *w, Elm_Object_Item *item)
382{
383 C_DATA(w);
384 wd->unsaved_changes = eina_list_remove(wd->unsaved_changes, item);
385 _unsaved_check(w);
386}
387
388static void
389_history_stack_push(Evas_Object *w, Elm_Settingspane *it) 298_history_stack_push(Evas_Object *w, Elm_Settingspane *it)
390{ 299{
391 C_DATA(w); 300 C_DATA(w);
@@ -456,16 +365,6 @@ _history_stack_remove(Evas_Object *w, Elm_Object_Item *rm_it)
456} 365}
457 366
458static void 367static void
459_item_append(Elm_Settingspane_Item *root, Elm_Settingspane_Item *toadd, Elm_Settingspane_Item *rel)
460{
461 IC_DATA(root);
462 id->childs = eina_list_append_relative(id->childs, toadd, rel);
463
464 if (_history_stack_current(id->sw) == root)
465 _item_menu_refresh(root, id);
466}
467
468static void
469_item_sel_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 368_item_sel_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
470{ 369{
471 Elm_Settingspane_Item *curr, *selected = data; 370 Elm_Settingspane_Item *curr, *selected = data;
@@ -703,80 +602,6 @@ _search_entry_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
703} 602}
704 603
705static void 604static void
706_conf_unsaved_item_click_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
707{
708 Elm_Object_Item *it = data;
709 IC_DATA(it);
710 C_DATA(id->sw);
711
712 wd->unsaved_opened = NULL;
713
714 eo_do(it, elm_obj_settingspane_item_focus());
715 evas_object_hide(obj);
716}
717
718static void
719_conf_unsaved_menu_ctx_item_add(Evas_Object *ctx, Elm_Object_Item *it)
720{
721 IC_DATA(it);
722 char buf[PATH_MAX];
723 Evas_Object *ic;
724
725 snprintf(buf, sizeof(buf), "*%s", id->name);
726
727 ic = elm_icon_add(ctx);
728 elm_image_file_set(ic, id->file, id->group);
729 evas_object_show(ic);
730
731 elm_ctxpopup_item_append(ctx, buf, ic, _conf_unsaved_item_click_cb, it);
732}
733
734static void
735_conf_unsaved_dismissed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
736{
737 C_DATA(data);
738
739 wd->unsaved_opened = NULL;
740}
741
742static void
743_conf_unsaved_menu_show(Evas_Object *par, int x, int y, char *style )
744{
745 Elm_Object_Item *it;
746 Eina_List *node;
747 Evas_Object *ctx;
748 C_DATA(par);
749
750 if (eina_list_count(wd->unsaved_changes) == 0 || wd->unsaved_opened)
751 return;
752
753 ctx = elm_ctxpopup_add(par);
754 wd->unsaved_opened = ctx;
755 elm_object_style_set(ctx, style);
756 evas_object_smart_callback_add(ctx, "dismissed", _conf_unsaved_dismissed_cb, par);
757
758 elm_ctxpopup_direction_priority_set(ctx, ELM_CTXPOPUP_DIRECTION_DOWN,
759 ELM_CTXPOPUP_DIRECTION_LEFT,
760 ELM_CTXPOPUP_DIRECTION_RIGHT,
761 ELM_CTXPOPUP_DIRECTION_UP);
762 EINA_LIST_FOREACH(wd->unsaved_changes, node, it)
763 {
764 _conf_unsaved_menu_ctx_item_add(ctx, it);
765 }
766 evas_object_move(ctx, x, y);
767 evas_object_show(ctx);
768}
769
770static void
771_conf_unsaved_menu_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
772{
773 int x, y;
774
775 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
776 _conf_unsaved_menu_show(obj, x, y, "default");
777}
778
779static void
780_history_menu_item_sel_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED) 605_history_menu_item_sel_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
781{ 606{
782 Elm_Object_Item *it = data; 607 Elm_Object_Item *it = data;
@@ -851,7 +676,6 @@ _elm_settingspane_evas_object_smart_add(Eo *obj, Elm_Settingspane_Data *pd)
851 CRI("Failed to set theme file"); 676 CRI("Failed to set theme file");
852 } 677 }
853 elm_layout_signal_callback_add(obj, "elm,action,back", EMITTER, conf_menu_back_cb, obj); 678 elm_layout_signal_callback_add(obj, "elm,action,back", EMITTER, conf_menu_back_cb, obj);
854 elm_layout_signal_callback_add(obj, "elm,unsaved,clicked", EMITTER, _conf_unsaved_menu_cb, obj);
855 elm_layout_signal_callback_add(obj, "elm,action,back_menu", EMITTER, _history_menu_show_cb, obj); 679 elm_layout_signal_callback_add(obj, "elm,action,back_menu", EMITTER, _history_menu_show_cb, obj);
856 elm_layout_signal_emit(obj, EMIT_BACK_DISABLE); 680 elm_layout_signal_emit(obj, EMIT_BACK_DISABLE);
857 681
@@ -886,7 +710,14 @@ _elm_settingspane_evas_object_smart_add(Eo *obj, Elm_Settingspane_Data *pd)
886 evas_object_show(tb2); 710 evas_object_show(tb2);
887 pd->table_menu = tb2; 711 pd->table_menu = tb2;
888 712
889 pd->zero = _item_new(obj, NULL, NULL, eina_stringshare_add("root")); 713 //init zero item
714 {
715 pd->zero = eo_add(ELM_SETTINGSPANE_ITEM_CLASS, NULL);
716 Elm_Settingspane_Item_Data *data = eo_data_scope_get(pd->zero, ELM_SETTINGSPANE_ITEM_CLASS);
717
718 data->sw = obj;
719 data->name = eina_stringshare_add("root");
720 }
890 } 721 }
891 722
892EOLIAN static void 723EOLIAN static void
@@ -950,37 +781,24 @@ _elm_settingspane_icon_gen(Evas_Object *par, const char *file, const char *group
950} 781}
951 782
952static Elm_Settingspane_Item * 783static Elm_Settingspane_Item *
953_elm_settingspane_item_append_full(Eo *obj, Elm_Settingspane_Data *pd, void *data, 784_elm_settingspane_item_append_full(Elm_Settingspane_Data *pd, void *usr_data,
954 const char *name, 785 const char *name,
955 Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel) 786 Elm_Settingspane_Item *par, Elm_Settingspane_Item *rel)
956{ 787{
957 Elm_Settingspane_Item *new_child = NULL; 788 Elm_Settingspane_Item *item = eo_add(ELM_SETTINGSPANE_ITEM_CLASS, NULL);
958 Elm_Settingspane_Item_Data *data_par; 789 Elm_Settingspane_Item_Data *data = eo_data_scope_get(item, ELM_SETTINGSPANE_ITEM_CLASS);
959 790
960 /* 791 data->data = usr_data;
961 * Append to the zero level 792 data->rel = rel;
962 */ 793 data->name = name;
963 if (!par) 794 data->key_words = NULL;
964 { 795 data->key_words = eina_list_append(data->key_words, eina_stringshare_add(name));
965 new_child = _item_new(obj, pd->zero, data, name);
966 _item_append(pd->zero, new_child, rel);
967 return new_child;
968 }
969 796
970 data_par = IC_DATA_L(par); 797 //XXX: this is a hack think of a constructor
971 if (!data_par) 798
972 return NULL; 799 eo_do(item, eo_parent_set(par ? par : pd->zero));
973 if (HAS_PANEL(data_par)) 800
974 { 801 return item;
975 ERR("You cannot add a menu item to a item with a panel!");
976 return NULL;
977 }
978 else
979 {
980 new_child = _item_new(obj, par, data, name);
981 _item_append(par, new_child, rel);
982 }
983 return new_child;
984} 802}
985 803
986EOLIAN static void 804EOLIAN static void
@@ -1014,7 +832,7 @@ _elm_settingspane_item_image_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data
1014EOLIAN static Elm_Settingspane_Item * 832EOLIAN static Elm_Settingspane_Item *
1015_elm_settingspane_item_append(Eo *obj, Elm_Settingspane_Data *pd, void *data, const char *name, Elm_Settingspane_Item *par) 833_elm_settingspane_item_append(Eo *obj, Elm_Settingspane_Data *pd, void *data, const char *name, Elm_Settingspane_Item *par)
1016{ 834{
1017 return _elm_settingspane_item_append_full(obj, pd, data, eina_stringshare_add(name), par, NULL); 835 return _elm_settingspane_item_append_full(pd, data, eina_stringshare_add(name), par, NULL);
1018} 836}
1019 837
1020 838
@@ -1023,7 +841,7 @@ _elm_settingspane_item_append_relative(Eo *obj, Elm_Settingspane_Data *pd, void
1023{ 841{
1024 EINA_SAFETY_ON_NULL_RETURN_VAL(rel, NULL); 842 EINA_SAFETY_ON_NULL_RETURN_VAL(rel, NULL);
1025 843
1026 return _elm_settingspane_item_append_full(obj, pd, data, eina_stringshare_add(name), _parent(obj), rel); 844 return _elm_settingspane_item_append_full(pd, data, eina_stringshare_add(name), _parent(obj), rel);
1027} 845}
1028 846
1029/* Item implement */ 847/* Item implement */
@@ -1045,21 +863,14 @@ _default_reached_cb(void *data, Evas_Object *obj, const char *emission EINA_UNUS
1045 } 863 }
1046 864
1047 IC_DATA(data); 865 IC_DATA(data);
866 if (!id) return;
867
1048 p = id->panel; 868 p = id->panel;
1049 869
1050 if (id->changed) 870 evas_object_del(p->layout);
1051 { 871 free(p);
1052 p->hidden = EINA_TRUE; 872 id->panel = NULL;
1053 evas_object_hide(p->layout); 873 DBG("delete item %p", data);
1054 DBG("keep item %p", data);
1055 }
1056 else
1057 {
1058 evas_object_del(p->layout);
1059 free(p);
1060 id->panel = NULL;
1061 DBG("delete item %p", data);
1062 }
1063} 874}
1064 875
1065static Panel* 876static Panel*
@@ -1082,22 +893,6 @@ _item_panel_realize(Eo *obj, Evas_Object *w, Evas_Object *content)
1082 elm_box_horizontal_set(bx, EINA_TRUE); 893 elm_box_horizontal_set(bx, EINA_TRUE);
1083 elm_object_part_content_set(p->layout, POS_PANEL_CONTROLS, bx); 894 elm_object_part_content_set(p->layout, POS_PANEL_CONTROLS, bx);
1084 895
1085 p->apply = elm_button_add(w);
1086 evas_object_size_hint_weight_set(p->apply, 0.0, 0.0);
1087 evas_object_size_hint_align_set(p->apply, 0.0, 0.0);
1088 evas_object_smart_callback_add(p->apply, "clicked", _content_layout_apply_cb, obj);
1089 elm_object_text_set(p->apply, "Apply");
1090 elm_box_pack_end(bx, p->apply);
1091 evas_object_show(p->apply);
1092
1093 p->reset = elm_button_add(w);
1094 evas_object_size_hint_weight_set(p->reset, 0, 0);
1095 evas_object_size_hint_align_set(p->reset, 0.0, 0.0);
1096 elm_object_text_set(p->reset, "Reset");
1097 evas_object_smart_callback_add(p->reset, "clicked", _content_layout_reset_cb, obj);
1098 elm_box_pack_end(bx, p->reset);
1099 evas_object_show(p->reset);
1100
1101 sc = elm_scroller_add(w); 896 sc = elm_scroller_add(w);
1102 evas_object_size_hint_weight_set(sc, 897 evas_object_size_hint_weight_set(sc,
1103 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 898 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1145,6 +940,7 @@ _item_menu_realize(Eo *obj, Elm_Settingspane_Item_Data *pd, Elm_Settingspane_Dat
1145 940
1146 _item_menu_refresh(obj, pd); 941 _item_menu_refresh(obj, pd);
1147} 942}
943
1148static inline void 944static inline void
1149_item_menu_show(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Eina_Bool hidden) 945_item_menu_show(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Eina_Bool hidden)
1150{ 946{
@@ -1171,7 +967,6 @@ _item_menu_visible_hide(Eo *obj)
1171 evas_object_raise(m->layout); 967 evas_object_raise(m->layout);
1172} 968}
1173 969
1174
1175EOLIAN static void 970EOLIAN static void
1176_elm_settingspane_item_realize(Eo *obj, Elm_Settingspane_Item_Data *pd) 971_elm_settingspane_item_realize(Eo *obj, Elm_Settingspane_Item_Data *pd)
1177{ 972{
@@ -1182,7 +977,7 @@ _elm_settingspane_item_realize(Eo *obj, Elm_Settingspane_Item_Data *pd)
1182 if (wd->panel_visible) 977 if (wd->panel_visible)
1183 eo_do(wd->panel_visible, elm_obj_settingspane_item_unrealize()); 978 eo_do(wd->panel_visible, elm_obj_settingspane_item_unrealize());
1184 979
1185 if (pd->event.content_get) //this is a panel 980 if (HAS_PANEL(pd)) //this is a panel
1186 { 981 {
1187 if (wd->panel_visible == obj) 982 if (wd->panel_visible == obj)
1188 return; 983 return;
@@ -1276,13 +1071,13 @@ _item_menu_refresh(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd)
1276 EINA_LIST_FOREACH(pd->childs, node, child) 1071 EINA_LIST_FOREACH(pd->childs, node, child)
1277 { 1072 {
1278 Elm_Settingspane_Item_Data *cid = IC_DATA_L(child); 1073 Elm_Settingspane_Item_Data *cid = IC_DATA_L(child);
1279 Elm_Object_Item *it;
1280 1074
1281 it = elm_genlist_item_append(pd->menu->list, wd->itcc, child, 1075 cid->it = elm_genlist_item_append(pd->menu->list, wd->itcc, child,
1282 NULL, ELM_GENLIST_ITEM_NONE, 1076 NULL, ELM_GENLIST_ITEM_NONE,
1283 _item_sel_cb, child); 1077 _item_sel_cb, child);
1284 elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_ALWAYS); 1078 elm_genlist_item_select_mode_set(cid->it, ELM_OBJECT_SELECT_MODE_ALWAYS);
1285 elm_genlist_item_tooltip_text_set(it, cid->description); 1079 elm_genlist_item_tooltip_text_set(cid->it, cid->description);
1080 eo_do(cid->it, eo_wref_add(&cid->it));
1286 } 1081 }
1287} 1082}
1288 1083
@@ -1290,11 +1085,12 @@ EOLIAN static void
1290_elm_settingspane_item_unrealize(Eo *obj, Elm_Settingspane_Item_Data *pd) 1085_elm_settingspane_item_unrealize(Eo *obj, Elm_Settingspane_Item_Data *pd)
1291{ 1086{
1292 C_DATA(pd->sw); 1087 C_DATA(pd->sw);
1088
1293 DBG("unrealize %p", obj); 1089 DBG("unrealize %p", obj);
1294 if (!pd->panel && !pd->menu) 1090 if (!pd->panel && !pd->menu)
1295 return; 1091 return;
1296 1092
1297 if (pd->event.content_get) //this is a panel 1093 if (HAS_PANEL(pd)) //this is a panel
1298 { 1094 {
1299 _item_panel_unrealize(obj, pd); 1095 _item_panel_unrealize(obj, pd);
1300 if (wd->panel_visible == obj) 1096 if (wd->panel_visible == obj)
@@ -1310,32 +1106,6 @@ _elm_settingspane_item_unrealize(Eo *obj, Elm_Settingspane_Item_Data *pd)
1310 } 1106 }
1311} 1107}
1312 1108
1313
1314EOLIAN static void
1315_elm_settingspane_item_changed_set(Eo *obj, Elm_Settingspane_Item_Data *pd, Eina_Bool changed)
1316{
1317 pd->changed = changed;
1318
1319 if (changed)
1320 _unsaved_changes_add(pd->sw, obj);
1321 else
1322 _unsaved_changes_remove(pd->sw, obj);
1323
1324 if (!pd->panel) return;
1325
1326 if (!pd->changed)
1327 elm_layout_signal_emit(pd->panel->layout, EMIT_CONTENT_CONTROLS_HIDE);
1328 else
1329 elm_layout_signal_emit(pd->panel->layout, EMIT_CONTENT_CONTROLS_SHOW);
1330
1331}
1332
1333EOLIAN static Eina_Bool
1334_elm_settingspane_item_changed_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd)
1335{
1336 return pd->changed;
1337}
1338
1339EOLIAN static const char * 1109EOLIAN static const char *
1340_elm_settingspane_item_name_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd) 1110_elm_settingspane_item_name_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd)
1341{ 1111{
@@ -1349,45 +1119,66 @@ _elm_settingspane_item_description_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Ite
1349} 1119}
1350 1120
1351EOLIAN static void 1121EOLIAN static void
1352_elm_settingspane_item_attach_panel(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Content_Get_Cb content_get, Evas_Smart_Cb reset, Evas_Smart_Cb apply) 1122_elm_settingspane_item_attach_panel(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Content_Get_Cb content_get)
1353{ 1123{
1354 if (pd->childs) 1124 if (HAS_PANEL(pd))
1125 pd->event.content_get = content_get;
1126 else
1355 { 1127 {
1356 ERR("You cannot add a panel to a item with childs!"); 1128 ERR("You cannot add a panel to a item with childs!");
1357 return; 1129 return;
1358 } 1130 }
1359 pd->event.content_get = content_get;
1360 pd->event.reset = reset;
1361 pd->event.apply = apply;
1362} 1131}
1363 1132
1364EOLIAN static void 1133EOLIAN static void
1365_elm_settingspane_item_eo_base_destructor(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd) 1134_elm_settingspane_item_eo_base_parent_set(Eo *obj, Elm_Settingspane_Item_Data *pd, Eo_Base *parent)
1366{ 1135{
1367 Elm_Settingspane_Item_Data *id_par; 1136 Elm_Settingspane_Item_Data *pd_par;
1368 Elm_Settingspane_Item *top; 1137 Eo *old_parent, *top = NULL;
1369 id_par = IC_DATA_L(_parent(obj));
1370 1138
1371 eo_do_super(obj, ELM_SETTINGSPANE_ITEM_CLASS, eo_destructor()); 1139 eo_do(obj, old_parent = eo_parent_get());
1140
1141 //remove from the old parent list
1142 if (old_parent)
1143 {
1144 pd_par = IC_DATA_L(old_parent);
1145 pd_par->childs = eina_list_remove(pd_par->childs, obj);
1146 //remove possible existing items
1147 elm_object_item_del(pd->it);
1148 pd->it = NULL;
1149 }
1150
1151 eo_do_super(obj, ELM_SETTINGSPANE_ITEM_CLASS, eo_parent_set(parent));
1152
1153 //register in the new parent
1154 if (parent)
1155 {
1156 pd_par = IC_DATA_L(parent);
1157 pd_par->childs = eina_list_append_relative(pd_par->childs, obj, pd->rel);
1158 pd->sw = pd_par->sw;
1159 //check if we are in there
1160 top = _history_stack_current(pd->sw);
1161 if (top == parent)
1162 _item_menu_refresh(pd->sw, pd_par);
1163 }
1164}
1165
1166EOLIAN static void
1167_elm_settingspane_item_eo_base_destructor(Eo *obj, Elm_Settingspane_Item_Data *pd)
1168{
1169 Elm_Settingspane_Item *top;
1372 1170
1373 eo_do(obj, elm_obj_settingspane_item_unrealize()); 1171 eo_do(obj, elm_obj_settingspane_item_unrealize());
1374 1172
1375 top = _history_stack_current(pd->sw); 1173 top = _history_stack_current(pd->sw);
1376 1174
1377 if (top == obj) 1175 if (top == obj)
1378 { 1176 _history_stack_pop(pd->sw);
1379 _history_stack_pop(pd->sw);
1380 }
1381 1177
1382 //if we have the item somewhere in the stack, remove it! 1178 //if we have the item somewhere in the stack, remove it!
1383 _history_stack_remove(pd->sw, obj); 1179 _history_stack_remove(pd->sw, obj);
1384 1180
1385 if (_parent(obj)) 1181 eo_do_super(obj, ELM_SETTINGSPANE_ITEM_CLASS, eo_destructor());
1386 id_par->childs = eina_list_remove(id_par->childs, obj);
1387
1388 _item_menu_refresh(obj, pd);
1389
1390 //TODO refresh parent if visualizied
1391} 1182}
1392 1183
1393EOLIAN static void 1184EOLIAN static void
@@ -1430,21 +1221,6 @@ _elm_settingspane_item_keywords_get(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_
1430 return pd->key_word; 1221 return pd->key_word;
1431} 1222}
1432 1223
1433/* widget api calls */
1434EOLIAN static Eina_Bool
1435_elm_settingspane_save_quit(Eo *obj EINA_UNUSED, Elm_Settingspane_Data *pd)
1436{
1437 return (pd->unsaved_changes) ? EINA_FALSE : EINA_TRUE;
1438}
1439
1440EOLIAN static void
1441_elm_settingspane_raise_unsaved(Eo *obj, Elm_Settingspane_Data *pd EINA_UNUSED)
1442{
1443 int x, y, w, h;
1444 evas_object_geometry_get(obj, &x, &y, &w, &h);
1445 _conf_unsaved_menu_show(obj, w/2, h/2, "clean");
1446}
1447
1448EOLIAN static void 1224EOLIAN static void
1449_elm_settingspane_eo_base_destructor(Eo *obj, Elm_Settingspane_Data *pd) 1225_elm_settingspane_eo_base_destructor(Eo *obj, Elm_Settingspane_Data *pd)
1450{ 1226{
diff --git a/src/lib/elm_settingspane.eo b/src/lib/elm_settingspane.eo
index dabbd2556..96d11ed22 100644
--- a/src/lib/elm_settingspane.eo
+++ b/src/lib/elm_settingspane.eo
@@ -55,33 +55,6 @@ class Elm.Settingspane(Elm.Layout) {
55 @in rel : Elm.Settingspane.Item*; [[the item after which the current one will be appended, if NULL the call will fail!]] 55 @in rel : Elm.Settingspane.Item*; [[the item after which the current one will be appended, if NULL the call will fail!]]
56 } 56 }
57 } 57 }
58 save_quit {
59 [[
60 Check if everything is saved
61
62 With the internal stack of the widget it is possible that multiple panels are opened above each other.
63 If the changed flag is set to one of this panels the apply/reset buttons are enabled,
64 and you cannot close this page before you clicked reset or apply.
65 If there are panels with the change flag set this function will return EINA_FALSE,
66 if no change flag is set on the opened panel it will return EINA_TRUE
67
68 \@ref raise_unsaved
69 ]]
70 return : bool; [[true if no change flag is set on the opened panels.]]
71 }
72 raise_unsaved {
73 [[
74 Raise unsaved panels in the internal stack
75
76 This will raise internal panels which have the changed flag set.
77 The panels are raised with a error highlighting.
78
79 The lowest unsaved panel will later be the lowest unsaved panel. The highest at the top.
80 All panels with unsaved changes will be infront of those without unsaved changes.
81
82 \@ref save_quit
83 ]]
84 }
85 } 58 }
86 implements { 59 implements {
87 Eo.Base.constructor; 60 Eo.Base.constructor;
diff --git a/src/lib/elm_settingspane_item.eo b/src/lib/elm_settingspane_item.eo
index bdef40f71..e8e6d2c62 100644
--- a/src/lib/elm_settingspane_item.eo
+++ b/src/lib/elm_settingspane_item.eo
@@ -45,49 +45,6 @@ class Elm.Settingspane.Item(Eo.Base){
45 group : const(char)*; 45 group : const(char)*;
46 } 46 }
47 } 47 }
48 @property changed {
49 [[
50 This will mark this item internally as changed,
51 the apply button will be enabled, and the item cannot be poped from stack anymore.
52 This can be undo if the user clicks the apply or reset button.
53 ]]
54 get {
55 [[
56 Returns the changed flag
57
58 This returns the changed flag of this Item.
59
60 The changed flag controls the enable/disable of the apply and reset buttons,
61 and controls if the panel can be closed.
62
63 If this flag is set the apply and reset buttons are enabled, a click on them will
64 result in the callbacks to the panel.
65 If someone tryes to close this panel while there are unsaved changes,
66 the panel will be highlighted with an error.
67 ]]
68 }
69 set {
70 [[
71 Set the chagned flag
72
73 This will set the changed flag for this item.
74
75 The changed flag controls the enable/disable of the apply and reset buttons,
76 and controls if the panel can be closed.
77
78 If this flag is set the apply and reset buttons are enabled, a click on them will
79 result in the callbacks to the panel.
80 If someone tryes to close this panel while there are unsaved changes,
81 the panel will be highlighted with an error.
82
83 noet that if this item doesnt have a attached panel settings this is useless
84
85 ]]
86 }
87 values {
88 changed : bool; [[set this item to changed]]
89 }
90 }
91 @property keywords { 48 @property keywords {
92 get { 49 get {
93 } 50 }
@@ -126,8 +83,6 @@ class Elm.Settingspane.Item(Eo.Base){
126 The callback content_get is just called if this item gets displayed. 83 The callback content_get is just called if this item gets displayed.
127 If it was closed once and opened another time the callback will be called a second time. 84 If it was closed once and opened another time the callback will be called a second time.
128 85
129 reset and apply are called when the apply or reset button is clicked.
130
131 Note that if the panel can just be attached if this node doenst have childs. 86 Note that if the panel can just be attached if this node doenst have childs.
132 Note that if once the panel has a panel it cannot be used as a parent node anymore. 87 Note that if once the panel has a panel it cannot be used as a parent node anymore.
133 ]] 88 ]]
@@ -136,8 +91,6 @@ class Elm.Settingspane.Item(Eo.Base){
136 Each time the panel is selected content is requested with the content_cb, 91 Each time the panel is selected content is requested with the content_cb,
137 If the content is changed the old Evas_Object will be saved and displayed next time the item is selected. 92 If the content is changed the old Evas_Object will be saved and displayed next time the item is selected.
138 ]] 93 ]]
139 @in reset : Evas_Smart_Cb; [[Callback to call when the reset button is clicked]]
140 @in apply : Evas_Smart_Cb; [[Callback to call when the apply button is clicked]]
141 } 94 }
142 } 95 }
143 focus { 96 focus {
@@ -151,5 +104,6 @@ class Elm.Settingspane.Item(Eo.Base){
151 } 104 }
152 implements { 105 implements {
153 Eo.Base.destructor; 106 Eo.Base.destructor;
107 Eo.Base.parent.set;
154 } 108 }
155} 109}