discomfitor pushed a commit to branch master.

commit 1d2b1340a925597e896b1bb28abf80d703aba26e
Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Sep 2 14:51:08 2013 +0100

    teamwork action can now show any uri on demand
---
 src/modules/teamwork/e_mod_main.c | 20 ++++++++++++++------
 src/modules/teamwork/e_mod_main.h |  1 +
 src/modules/teamwork/e_mod_tw.c   | 13 ++++++++++++-
 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 0b3404e..2fa4301 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 46c4376..88eb9ad 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 5d4caa4..a78fc3d 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);
+}

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to