billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=f8429209bbe84a1b6c35e1d9a11f0e780597900c

commit f8429209bbe84a1b6c35e1d9a11f0e780597900c
Author: Boris Faure <[email protected]>
Date:   Sun Sep 14 22:54:31 2014 +0200

    add a Toolkit settings category to launch elementary_config. Closes T1492
---
 src/bin/Makefile.am   |  1 +
 src/bin/options.c     |  6 +++++-
 src/bin/options_elm.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/bin/options_elm.h |  6 ++++++
 4 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 3bb2db9..4baa538 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -36,6 +36,7 @@ options_behavior.c options_behavior.h \
 options_keys.c options_keys.h \
 options_helpers.c options_helpers.h \
 options_video.c options_video.h \
+options_elm.c options_elm.h \
 sel.c sel.h \
 miniview.c miniview.h \
 termio.c termio.h \
diff --git a/src/bin/options.c b/src/bin/options.c
index c787898..e26171f 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -10,6 +10,7 @@
 #include "options_behavior.h"
 #include "options_keys.h"
 #include "options_helpers.h"
+#include "options_elm.h"
 #include "config.h"
 #include "termio.h"
 
@@ -32,7 +33,8 @@ static enum option_mode {
      OPTION_VIDEO,
      OPTION_BEHAVIOR,
      OPTION_KEYS,
-     OPTION_HELPERS
+     OPTION_HELPERS,
+     OPTION_ELM
 } _mode = 0;
 
 static void
@@ -88,6 +90,7 @@ _cb_opdt_hide_done(void *data, Evas_Object *obj EINA_UNUSED, 
const char *sig EIN
       case OPTION_BEHAVIOR:  options_behavior(op_opbox, data); break;
       case OPTION_KEYS:      options_keys(op_opbox, data); break;
       case OPTION_HELPERS:   options_helpers(op_opbox, data); break;
+      case OPTION_ELM:       options_elm(op_opbox, data); break;
      }
    edje_object_signal_emit(saved_bg, "optdetails,show", "terminology");
 }
@@ -168,6 +171,7 @@ options_toggle(Evas_Object *win, Evas_Object *bg, 
Evas_Object *term,
         ITEM_APPEND("preferences-system", _("Behavior"), BEHAVIOR);
         ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS);
         ITEM_APPEND("system-run", _("Helpers"), HELPERS);
+        ITEM_APPEND("apps", _("Toolkit"), ELM);
 #undef ITEM_APPEND
 
         elm_box_pack_end(op_tbox, o);
diff --git a/src/bin/options_elm.c b/src/bin/options_elm.c
new file mode 100644
index 0000000..60bba40
--- /dev/null
+++ b/src/bin/options_elm.c
@@ -0,0 +1,59 @@
+#include "private.h"
+
+#include <Elementary.h>
+#include "options.h"
+#include "options_elm.h"
+
+static void
+launch_elm_config(void *data EINA_UNUSED,
+                Evas_Object *obj EINA_UNUSED,
+                void *event_info EINA_UNUSED)
+{
+   int pid;
+
+   pid = fork();
+   if (pid < 0)
+     {
+        ERR("unable to fork: %s", strerror(errno));
+        return;
+     }
+   if (pid == 0)
+     {
+        execl("/bin/sh", "sh", "-c", "elementary_config", NULL);
+     }
+}
+
+void
+options_elm(Evas_Object *opbox, Evas_Object *term EINA_UNUSED)
+{
+   Evas_Object *o, *fr, *bx, *bt, *en;
+
+   fr = o = elm_frame_add(opbox);
+   evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_text_set(o, _("Toolkit"));
+   elm_box_pack_end(opbox, o);
+   evas_object_show(o);
+
+   bx = elm_box_add(opbox);
+   elm_object_content_set(fr, bx);
+   evas_object_show(bx);
+
+   en = elm_entry_add(opbox);
+   elm_entry_context_menu_disabled_set(en, EINA_TRUE);
+   elm_entry_editable_set(en, EINA_FALSE);
+   elm_entry_line_wrap_set(en, ELM_WRAP_MIXED);
+   elm_object_text_set(en, _("<em>Terminology</em> uses the 
<hilight>elementary</hilight> toolkit.<br>"
+                             "The toolkit configuration settings can be 
accessed by running <keyword>elementary_config</keyword>."));
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
+   elm_box_pack_end(bx, en);
+   evas_object_show(en);
+
+   bt = elm_button_add(opbox);
+   evas_object_smart_callback_add(bt, "clicked", launch_elm_config, NULL);
+   evas_object_propagate_events_set(bt, EINA_FALSE);
+   elm_layout_text_set(bt, NULL, _("Launch elementary_config"));
+   elm_box_pack_end(bx, bt);
+   evas_object_show(bt);
+}
diff --git a/src/bin/options_elm.h b/src/bin/options_elm.h
new file mode 100644
index 0000000..e4774a9
--- /dev/null
+++ b/src/bin/options_elm.h
@@ -0,0 +1,6 @@
+#ifndef _OPTIONS_ELM_H__
+#define _OPTIONS_ELM_H__ 1
+
+void options_elm(Evas_Object *opbox, Evas_Object *term);
+
+#endif

-- 


Reply via email to