aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/conf_applications/e_int_config_deskenv.c26
-rw-r--r--src/modules/ibar/e_mod_config.c29
-rw-r--r--src/modules/ibar/e_mod_main.c76
-rw-r--r--src/modules/ibar/e_mod_main.h1
4 files changed, 102 insertions, 30 deletions
diff --git a/src/modules/conf_applications/e_int_config_deskenv.c b/src/modules/conf_applications/e_int_config_deskenv.c
index ee18a5353..6a88a99fa 100644
--- a/src/modules/conf_applications/e_int_config_deskenv.c
+++ b/src/modules/conf_applications/e_int_config_deskenv.c
@@ -14,6 +14,7 @@ struct _E_Config_Dialog_Data
int load_xmodmap;
int load_gnome;
int load_kde;
+ int exe_always_single_instance;
};
/* a nice easy setup function that does the dirty work */
@@ -48,6 +49,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->load_xmodmap = e_config->deskenv.load_xmodmap;
cfdata->load_gnome = e_config->deskenv.load_gnome;
cfdata->load_kde = e_config->deskenv.load_kde;
+ cfdata->exe_always_single_instance = e_config->exe_always_single_instance;
}
static void *
@@ -74,6 +76,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->deskenv.load_xmodmap = cfdata->load_xmodmap;
e_config->deskenv.load_gnome = cfdata->load_gnome;
e_config->deskenv.load_kde = cfdata->load_kde;
+ e_config->exe_always_single_instance = cfdata->exe_always_single_instance;
e_config_save_queue();
return 1; /* Apply was OK */
}
@@ -83,21 +86,34 @@ static Evas_Object *
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
/* generate the core widget layout for a basic dialog */
- Evas_Object *o, *ob;
+ Evas_Object *o, *fr, *ob;
o = e_widget_list_add(evas, 0, 0);
+
+ fr = e_widget_framelist_add(evas, _("Execution"), 0);
+ ob = e_widget_check_add(evas, _("Only launch single instances"),
+ &(cfdata->exe_always_single_instance));
+ e_widget_framelist_object_append(fr, ob);
+ e_widget_list_object_append(o, fr, 1, 0, 0.0);
+
+ fr = e_widget_framelist_add(evas, _("X11 Basics"), 0);
ob = e_widget_check_add(evas, _("Load X Resources"),
&(cfdata->load_xrdb));
- e_widget_list_object_append(o, ob, 1, 0, 0.0);
+ e_widget_framelist_object_append(fr, ob);
ob = e_widget_check_add(evas, _("Load X Modifier Map"),
&(cfdata->load_xmodmap));
- e_widget_list_object_append(o, ob, 1, 0, 0.0);
+ e_widget_framelist_object_append(fr, ob);
+ e_widget_list_object_append(o, fr, 1, 0, 0.0);
+
+ fr = e_widget_framelist_add(evas, _("Major Desktops"), 0);
ob = e_widget_check_add(evas, _("Start GNOME services on login"),
&(cfdata->load_gnome));
- e_widget_list_object_append(o, ob, 1, 0, 0.0);
+ e_widget_framelist_object_append(fr, ob);
ob = e_widget_check_add(evas, _("Start KDE services on login"),
&(cfdata->load_kde));
- e_widget_list_object_append(o, ob, 1, 0, 0.0);
+ e_widget_framelist_object_append(fr, ob);
+ e_widget_list_object_append(o, fr, 1, 0, 0.0);
+
return o;
}
diff --git a/src/modules/ibar/e_mod_config.c b/src/modules/ibar/e_mod_config.c
index 2196c4b77..9d531162c 100644
--- a/src/modules/ibar/e_mod_config.c
+++ b/src/modules/ibar/e_mod_config.c
@@ -6,6 +6,7 @@ struct _E_Config_Dialog_Data
const char *dir;
int show_label, eap_label;
int lock_move;
+ int track_launch;
Evas_Object *tlist;
Evas_Object *radio_name;
@@ -66,6 +67,7 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
cfdata->show_label = ci->show_label;
cfdata->eap_label = ci->eap_label;
cfdata->lock_move = ci->lock_move;
+ cfdata->track_launch = !ci->dont_track_launch;
}
static void *
@@ -97,7 +99,7 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
o = e_widget_list_add(evas, 0, 0);
- of = e_widget_frametable_add(evas, _("Selected Bar Source"), 0);
+ of = e_widget_frametable_add(evas, _("Selected source"), 0);
ol = e_widget_ilist_add(evas, 32, 32, &(cfdata->dir));
cfdata->tlist = ol;
_load_tlist(cfdata);
@@ -119,28 +121,30 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Icon Labels"), 0);
- ob = e_widget_check_add(evas, _("Show Icon Label"), &(cfdata->show_label));
+ ob = e_widget_check_add(evas, _("Show icon label"), &(cfdata->show_label));
e_widget_on_change_hook_set(ob, _show_label_cb_change, cfdata);
e_widget_framelist_object_append(of, ob);
rg = e_widget_radio_group_new(&(cfdata->eap_label));
- cfdata->radio_name = e_widget_radio_add(evas, _("Display App Name"), 0, rg);
+ cfdata->radio_name = e_widget_radio_add(evas, _("Name"), 0, rg);
e_widget_framelist_object_append(of, cfdata->radio_name);
if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_name, 1);
- cfdata->radio_comment = e_widget_radio_add(evas, _("Display App Comment"), 1, rg);
+ cfdata->radio_comment = e_widget_radio_add(evas, _("Comment"), 1, rg);
e_widget_framelist_object_append(of, cfdata->radio_comment);
if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_comment, 1);
- cfdata->radio_generic = e_widget_radio_add(evas, _("Display App Generic"), 2, rg);
+ cfdata->radio_generic = e_widget_radio_add(evas, _("Generic"), 2, rg);
e_widget_framelist_object_append(of, cfdata->radio_generic);
if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_generic, 1);
e_widget_list_object_append(o, of, 1, 1, 0.5);
- of = e_widget_framelist_add(evas, _("Icon Movement"), 0);
- ob = e_widget_check_add(evas, _("Lock Icon Move"), &(cfdata->lock_move));
+ of = e_widget_framelist_add(evas, _("Misc"), 0);
+ ob = e_widget_check_add(evas, _("Lock icon move"), &(cfdata->lock_move));
+ e_widget_framelist_object_append(of, ob);
+ ob = e_widget_check_add(evas, _("Track launch"), &(cfdata->track_launch));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
@@ -160,6 +164,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
ci->show_label = cfdata->show_label;
ci->eap_label = cfdata->eap_label;
ci->lock_move = cfdata->lock_move;
+ ci->dont_track_launch = !cfdata->track_launch;
_ibar_config_update(ci);
e_config_save_queue();
return 1;
@@ -231,9 +236,13 @@ _cb_entry_ok(void *data, char *text)
int ret = 0;
/* Populate this .order file with some defaults */
- snprintf(tmp, sizeof(tmp), "xterm.desktop\n" "sylpheed.desktop\n"
- "firefox.desktop\n" "openoffice.desktop\n" "xchat.desktop\n"
- "gimp.desktop\n" "xmms.desktop\n");
+ snprintf(tmp, sizeof(tmp),
+ "terminology.desktop\n"
+ "sylpheed.desktop\n"
+ "firefox.desktop\n"
+ "openoffice.desktop\n"
+ "xchat.desktop\n"
+ "gimp.desktop\n");
ret = fwrite(tmp, sizeof(char), strlen(tmp), f);
fclose(f);
}
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 391ee4257..05dc9c695 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -66,12 +66,13 @@ struct _IBar
struct _IBar_Icon
{
- IBar *ibar;
- Evas_Object *o_holder, *o_icon;
- Evas_Object *o_holder2, *o_icon2;
- Efreet_Desktop *app;
- Ecore_Timer *reset_timer;
- int mouse_down;
+ IBar *ibar;
+ Evas_Object *o_holder, *o_icon;
+ Evas_Object *o_holder2, *o_icon2;
+ Efreet_Desktop *app;
+ Ecore_Timer *reset_timer;
+ E_Exec_Instance *exe_inst;
+ int mouse_down;
struct
{
unsigned char start : 1;
@@ -85,6 +86,7 @@ static IBar *_ibar_new(Evas *evas, Instance *inst);
static void _ibar_free(IBar *b);
static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _ibar_empty_handle(IBar *b);
+static void _ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type);
static void _ibar_fill(IBar *b);
static void _ibar_empty(IBar *b);
static void _ibar_orient_set(IBar *b, int horizontal);
@@ -515,7 +517,8 @@ _ibar_config_item_get(const char *id)
ci->dir = eina_stringshare_add("default");
ci->show_label = 1;
ci->eap_label = 0;
- ci->lock_move= 0;
+ ci->lock_move = 0;
+ ci->dont_track_launch = 0;
ibar_config->items = eina_list_append(ibar_config->items, ci);
return ci;
}
@@ -630,6 +633,11 @@ _ibar_icon_free(IBar_Icon *ic)
_ibar_icon_empty(ic);
evas_object_del(ic->o_holder);
evas_object_del(ic->o_holder2);
+ if (ic->exe_inst)
+ {
+ e_exec_instance_watcher_del(ic->exe_inst, _ibar_instance_watch, ic);
+ ic->exe_inst = NULL;
+ }
E_FREE(ic);
}
@@ -788,6 +796,7 @@ _ibar_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
ic = data;
if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
ic->reset_timer = NULL;
+ if (ic->exe_inst) return;
ic->focused = EINA_TRUE;
_ibar_icon_signal_emit(ic, "e,state,focused", "e");
if (ic->ibar->inst->ci->show_label)
@@ -907,10 +916,50 @@ _ibar_cb_icon_reset(void *data)
}
static void
+_ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type)
+{
+ IBar_Icon *ic = data;
+
+ switch (type)
+ {
+ case E_EXEC_WATCH_STARTED:
+ case E_EXEC_WATCH_STOPPED:
+ case E_EXEC_WATCH_TIMEOUT:
+ if (ic->exe_inst == inst)
+ {
+ _ibar_icon_signal_emit(ic, "e,state,started", "e");
+ e_exec_instance_watcher_del(inst, _ibar_instance_watch, ic);
+ ic->exe_inst = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
_ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
{
if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
- e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar");
+ {
+ if (ic->ibar->inst->ci->dont_track_launch)
+ e_exec(ic->ibar->inst->gcc->gadcon->zone,
+ ic->app, NULL, NULL, "ibar");
+ else
+ {
+ E_Exec_Instance *einst;
+
+ if (ic->exe_inst) return;
+ einst = e_exec(ic->ibar->inst->gcc->gadcon->zone,
+ ic->app, NULL, NULL, "ibar");
+ if (einst)
+ {
+ ic->exe_inst = einst;
+ e_exec_instance_watcher_add(einst, _ibar_instance_watch, ic);
+ _ibar_icon_signal_emit(ic, "e,state,starting", "e");
+ }
+ }
+ }
else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
{
if (!strncasecmp(ic->app->url, "file:", 5))
@@ -921,14 +970,9 @@ _ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
if (act) act->func.go(NULL, ic->app->url + 5);
}
}
- /* TODO: bring back "e,action,start|stop" for the startup_notify apps
- * when startup_notify is used again
- */
_ibar_icon_signal_emit(ic, "e,action,exec", "e");
if (keep_going)
- {
- ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
- }
+ ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
}
static void
@@ -1713,6 +1757,7 @@ e_modapi_init(E_Module *m)
E_CONFIG_VAL(D, T, show_label, INT);
E_CONFIG_VAL(D, T, eap_label, INT);
E_CONFIG_VAL(D, T, lock_move, INT);
+ E_CONFIG_VAL(D, T, dont_track_launch, UCHAR);
conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config);
#undef T
@@ -1734,7 +1779,8 @@ e_modapi_init(E_Module *m)
ci->dir = eina_stringshare_add("default");
ci->show_label = 1;
ci->eap_label = 0;
- ci->lock_move= 0;
+ ci->lock_move = 0;
+ ci->dont_track_launch = 0;
ibar_config->items = eina_list_append(ibar_config->items, ci);
}
diff --git a/src/modules/ibar/e_mod_main.h b/src/modules/ibar/e_mod_main.h
index b6bf3f664..47bdd7d48 100644
--- a/src/modules/ibar/e_mod_main.h
+++ b/src/modules/ibar/e_mod_main.h
@@ -22,6 +22,7 @@ struct _Config_Item
int show_label;
int eap_label;
int lock_move;
+ unsigned char dont_track_launch;
};
EAPI extern E_Module_Api e_modapi;