summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-05 16:28:56 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-06 15:23:20 -0400
commit369977cb18786cf05cbd08dac05515f8f0afcda7 (patch)
tree9436f0fa450ef60225e3d3003f94d3e6286a80b7
parentd470649e9b03b66ee3ea3bf380d92f7ab0767f0c (diff)
add colorclass editor to settings paneldevs/discomfitor/cc
-rw-r--r--src/bin/main.c45
-rw-r--r--src/bin/options.c9
-rw-r--r--src/bin/options_colors.c22
-rw-r--r--src/bin/options_colors.h3
4 files changed, 78 insertions, 1 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 6eca428..704839f 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -440,6 +440,44 @@ _translate_options(void)
440} 440}
441#endif 441#endif
442 442
443#ifdef ELM_COLOR_CLASS_H
444# if defined(HAVE_GETTEXT) && defined(ENABLE_NLS)
445static char *
446colorclasses_name_cb(char *name)
447{
448 return _(name);
449}
450#endif
451
452static Eina_List *
453colorclasses_list_cb(void)
454{
455 Eina_List *l, *ret = NULL;
456 Eina_Iterator *it;
457 Eina_File *f;
458 const char *config_dir = efreet_config_home_get(),
459 *data_dir = elm_app_data_dir_get();
460 char buf[PATH_MAX], buf2[PATH_MAX];
461
462 it = edje_file_iterator_new();
463 if (!it) return NULL;
464 snprintf(buf, sizeof(buf), "%s/themes", data_dir);
465 snprintf(buf2, sizeof(buf2), "%s/terminology/themes", config_dir);
466 EINA_ITERATOR_FOREACH(it, f)
467 {
468 const char *name;
469
470 name = eina_file_filename_get(f);
471 if ((!strstr(name, buf)) && (!strstr(name, buf2))) continue;
472 l = elm_color_class_util_edje_file_list(f);
473 if (l)
474 ret = eina_list_merge(ret, l);
475 }
476 eina_iterator_free(it);
477 return ret;
478}
479#endif
480
443EAPI_MAIN int 481EAPI_MAIN int
444elm_main(int argc, char **argv) 482elm_main(int argc, char **argv)
445{ 483{
@@ -540,6 +578,9 @@ elm_main(int argc, char **argv)
540 bindtextdomain(PACKAGE, elm_app_locale_dir_get()); 578 bindtextdomain(PACKAGE, elm_app_locale_dir_get());
541 textdomain(PACKAGE); 579 textdomain(PACKAGE);
542 _translate_options(); 580 _translate_options();
581# ifdef ELM_COLOR_CLASS_H
582 elm_color_class_translate_cb_set(colorclasses_name_cb);
583# endif
543#else 584#else
544 options.copyright = "(C) 2012-2015 Carsten Haitzler and others"; 585 options.copyright = "(C) 2012-2015 Carsten Haitzler and others";
545#endif 586#endif
@@ -575,7 +616,9 @@ elm_main(int argc, char **argv)
575 } 616 }
576 617
577 if (quit_option) goto end; 618 if (quit_option) goto end;
578 619#ifdef ELM_COLOR_CLASS_H
620 elm_color_class_list_cb_set(colorclasses_list_cb);
621#endif
579#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 622#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
580 if (cmd_options) 623 if (cmd_options)
581 { 624 {
diff --git a/src/bin/options.c b/src/bin/options.c
index e26171f..14b94b7 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -30,6 +30,9 @@ static enum option_mode {
30 OPTION_THEME, 30 OPTION_THEME,
31 OPTION_WALLPAPER, 31 OPTION_WALLPAPER,
32 OPTION_COLORS, 32 OPTION_COLORS,
33#ifdef ELM_COLOR_CLASS_H
34 OPTION_COLORCLASSES,
35#endif
33 OPTION_VIDEO, 36 OPTION_VIDEO,
34 OPTION_BEHAVIOR, 37 OPTION_BEHAVIOR,
35 OPTION_KEYS, 38 OPTION_KEYS,
@@ -86,6 +89,9 @@ _cb_opdt_hide_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EIN
86 case OPTION_THEME: options_theme(op_opbox, data); break; 89 case OPTION_THEME: options_theme(op_opbox, data); break;
87 case OPTION_WALLPAPER: options_wallpaper(op_opbox, data); break; 90 case OPTION_WALLPAPER: options_wallpaper(op_opbox, data); break;
88 case OPTION_COLORS: options_colors(op_opbox, data); break; 91 case OPTION_COLORS: options_colors(op_opbox, data); break;
92#ifdef ELM_COLOR_CLASS_H
93 case OPTION_COLORCLASSES: options_colorclasses(op_opbox, data); break;
94#endif
89 case OPTION_VIDEO: options_video(op_opbox, data); break; 95 case OPTION_VIDEO: options_video(op_opbox, data); break;
90 case OPTION_BEHAVIOR: options_behavior(op_opbox, data); break; 96 case OPTION_BEHAVIOR: options_behavior(op_opbox, data); break;
91 case OPTION_KEYS: options_keys(op_opbox, data); break; 97 case OPTION_KEYS: options_keys(op_opbox, data); break;
@@ -168,6 +174,9 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
168 ITEM_APPEND("preferences-desktop-wallpaper", _("Wallpaper"), WALLPAPER); 174 ITEM_APPEND("preferences-desktop-wallpaper", _("Wallpaper"), WALLPAPER);
169 ITEM_APPEND("video-display", _("Video"), VIDEO); 175 ITEM_APPEND("video-display", _("Video"), VIDEO);
170 ITEM_APPEND("preferences-desktop-theme", _("Colors"), COLORS); 176 ITEM_APPEND("preferences-desktop-theme", _("Colors"), COLORS);
177#ifdef ELM_COLOR_CLASS_H
178 ITEM_APPEND("preferences-desktop-theme", _("Color Classes"), COLORCLASSES);
179#endif
171 ITEM_APPEND("preferences-system", _("Behavior"), BEHAVIOR); 180 ITEM_APPEND("preferences-system", _("Behavior"), BEHAVIOR);
172 ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS); 181 ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS);
173 ITEM_APPEND("system-run", _("Helpers"), HELPERS); 182 ITEM_APPEND("system-run", _("Helpers"), HELPERS);
diff --git a/src/bin/options_colors.c b/src/bin/options_colors.c
index 0581408..d0c5e73 100644
--- a/src/bin/options_colors.c
+++ b/src/bin/options_colors.c
@@ -287,3 +287,25 @@ options_colors(Evas_Object *opbox, Evas_Object *term)
287 evas_object_show(o); 287 evas_object_show(o);
288 evas_object_smart_callback_add(o, "clicked", _cb_op_reset, term); 288 evas_object_smart_callback_add(o, "clicked", _cb_op_reset, term);
289} 289}
290
291#ifdef ELM_COLOR_CLASS_H
292void
293options_colorclasses(Evas_Object *opbox, Evas_Object *term EINA_UNUSED)
294{
295 Evas_Object *o, *fr;
296
297 fr = o = elm_frame_add(opbox);
298 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
299 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
300 elm_object_text_set(o, _("Color Classes"));
301 elm_box_pack_end(opbox, o);
302 evas_object_show(o);
303
304 o = elm_color_class_editor_add(opbox, 0);
305 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
306 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
307 elm_object_text_set(o, _("Color Classes"));
308 elm_object_content_set(fr, o);
309 evas_object_show(o);
310}
311#endif
diff --git a/src/bin/options_colors.h b/src/bin/options_colors.h
index 0512d98..8c9b861 100644
--- a/src/bin/options_colors.h
+++ b/src/bin/options_colors.h
@@ -2,5 +2,8 @@
2#define _OPTIONS_COLORS_H__ 1 2#define _OPTIONS_COLORS_H__ 1
3 3
4void options_colors(Evas_Object *opbox, Evas_Object *term); 4void options_colors(Evas_Object *opbox, Evas_Object *term);
5#ifdef ELM_COLOR_CLASS_H
6void options_colorclasses(Evas_Object *opbox, Evas_Object *term);
7#endif
5 8
6#endif 9#endif