summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-02 14:51:08 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-02 14:51:08 +0100
commit1d2b1340a925597e896b1bb28abf80d703aba26e (patch)
treef63ca44aa0499a4fe1ff3aac68be0775be2247bb
parentef0f3322ada04d1d44f3d078d2e526f530562777 (diff)
downloadenlightenment-1d2b1340a925597e896b1bb28abf80d703aba26e.tar.gz
teamwork action can now show any uri on demand
-rw-r--r--src/modules/teamwork/e_mod_main.c20
-rw-r--r--src/modules/teamwork/e_mod_main.h1
-rw-r--r--src/modules/teamwork/e_mod_tw.c13
3 files changed, 27 insertions, 7 deletions
diff --git a/src/modules/teamwork/e_mod_main.c b/src/modules/teamwork/e_mod_main.c
index 0b3404e091..2fa430163e 100644
--- a/src/modules/teamwork/e_mod_main.c
+++ b/src/modules/teamwork/e_mod_main.c
@@ -93,12 +93,20 @@ e_tw_config_dd_new(void)
}
//////////////////////////////
static void
-e_tw_act_toggle_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
+e_tw_act_toggle_cb(E_Object *obj EINA_UNUSED, const char *params)
{
- if (!tw_mod->pop) return;
- if (tw_mod->sticky)
- tw_hide(NULL);
- tw_mod->sticky = !tw_mod->sticky;
+ if (tw_mod->pop)
+ {
+ if (tw_mod->sticky)
+ tw_hide(NULL);
+ tw_mod->sticky = !tw_mod->sticky;
+ return;
+ }
+ if (params && params[0])
+ {
+ tw_uri_show(params);
+ tw_mod->sticky = 1;
+ }
}
//////////////////////////////
EAPI void *
@@ -146,7 +154,7 @@ e_modapi_init(E_Module *m)
}
e_tw_toggle = e_action_add(_act_toggle);
e_tw_toggle->func.go = e_tw_act_toggle_cb;
- e_action_predef_name_set(_e_tw_name, _lbl_toggle, _act_toggle, NULL, NULL, 0);
+ e_action_predef_name_set(_e_tw_name, _lbl_toggle, _act_toggle, NULL, NULL, 1);
e_configure_option_domain_current_set("teamwork");
diff --git a/src/modules/teamwork/e_mod_main.h b/src/modules/teamwork/e_mod_main.h
index 46c4376b25..88eb9ad67d 100644
--- a/src/modules/teamwork/e_mod_main.h
+++ b/src/modules/teamwork/e_mod_main.h
@@ -55,6 +55,7 @@ EINTERN int e_tw_init(void);
EINTERN void e_tw_shutdown(void);
EINTERN Eina_Bool tw_hide(void *d EINA_UNUSED);
EINTERN void tw_popup_opacity_set(void);
+EINTERN void tw_uri_show(const char *uri);
EINTERN E_Config_Dialog *e_int_config_teamwork_module(E_Container *con, const char *params EINA_UNUSED);
diff --git a/src/modules/teamwork/e_mod_tw.c b/src/modules/teamwork/e_mod_tw.c
index 5d4caa4de0..a78fc3dc7b 100644
--- a/src/modules/teamwork/e_mod_tw.c
+++ b/src/modules/teamwork/e_mod_tw.c
@@ -812,7 +812,7 @@ tw_show_helper(Evas_Object *o, int w, int h)
if (py + ph > tw_mod->pop->zone->h)
py = tw_mod->pop->zone->h - ph;
}
- else
+ else if (tw_win)
{
E_Border *bd = e_border_find_by_client_window(tw_win);
int x, y;
@@ -839,6 +839,11 @@ tw_show_helper(Evas_Object *o, int w, int h)
/* give up */
if (py < 0) py = 0;
}
+ else
+ {
+ px = (tw_mod->pop->zone->w / 2) - (pw / 2);
+ py = (tw_mod->pop->zone->h / 2) - (pw / 2);
+ }
e_popup_move_resize(tw_mod->pop, px, py, pw, ph);
e_popup_content_set(tw_mod->pop, o);
e_popup_show(tw_mod->pop);
@@ -1264,3 +1269,9 @@ e_tw_shutdown(void)
eina_hash_free(tw_mod->media);
E_FREE_FUNC(tw_mod->pop, e_object_del);
}
+
+EINTERN void
+tw_uri_show(const char *uri)
+{
+ dbus_link_show_helper(uri, 1);
+}