add a Toolkit settings category to launch elementary_config. Closes T1492
This commit is contained in:
parent
51555f9c35
commit
f8429209bb
|
@ -36,6 +36,7 @@ options_behavior.c options_behavior.h \
|
||||||
options_keys.c options_keys.h \
|
options_keys.c options_keys.h \
|
||||||
options_helpers.c options_helpers.h \
|
options_helpers.c options_helpers.h \
|
||||||
options_video.c options_video.h \
|
options_video.c options_video.h \
|
||||||
|
options_elm.c options_elm.h \
|
||||||
sel.c sel.h \
|
sel.c sel.h \
|
||||||
miniview.c miniview.h \
|
miniview.c miniview.h \
|
||||||
termio.c termio.h \
|
termio.c termio.h \
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "options_behavior.h"
|
#include "options_behavior.h"
|
||||||
#include "options_keys.h"
|
#include "options_keys.h"
|
||||||
#include "options_helpers.h"
|
#include "options_helpers.h"
|
||||||
|
#include "options_elm.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "termio.h"
|
#include "termio.h"
|
||||||
|
|
||||||
|
@ -32,7 +33,8 @@ static enum option_mode {
|
||||||
OPTION_VIDEO,
|
OPTION_VIDEO,
|
||||||
OPTION_BEHAVIOR,
|
OPTION_BEHAVIOR,
|
||||||
OPTION_KEYS,
|
OPTION_KEYS,
|
||||||
OPTION_HELPERS
|
OPTION_HELPERS,
|
||||||
|
OPTION_ELM
|
||||||
} _mode = 0;
|
} _mode = 0;
|
||||||
|
|
||||||
static void
|
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_BEHAVIOR: options_behavior(op_opbox, data); break;
|
||||||
case OPTION_KEYS: options_keys(op_opbox, data); break;
|
case OPTION_KEYS: options_keys(op_opbox, data); break;
|
||||||
case OPTION_HELPERS: options_helpers(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");
|
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-system", _("Behavior"), BEHAVIOR);
|
||||||
ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS);
|
ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS);
|
||||||
ITEM_APPEND("system-run", _("Helpers"), HELPERS);
|
ITEM_APPEND("system-run", _("Helpers"), HELPERS);
|
||||||
|
ITEM_APPEND("apps", _("Toolkit"), ELM);
|
||||||
#undef ITEM_APPEND
|
#undef ITEM_APPEND
|
||||||
|
|
||||||
elm_box_pack_end(op_tbox, o);
|
elm_box_pack_end(op_tbox, o);
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef _OPTIONS_ELM_H__
|
||||||
|
#define _OPTIONS_ELM_H__ 1
|
||||||
|
|
||||||
|
void options_elm(Evas_Object *opbox, Evas_Object *term);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue