'everyhing' open module configs directly from plugin page
authorHannes Janetzek <hannes.janetzek@gmail.com>
Sat, 24 Apr 2010 14:27:16 +0000 (14:27 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Sat, 24 Apr 2010 14:27:16 +0000 (14:27 +0000)
SVN revision: 48274

src/modules/everything-apps/e_mod_main.c
src/modules/everything-files/e_mod_main.c
src/modules/everything/Evry.h
src/modules/everything/e_mod_main.c
src/modules/everything/evry_config.c

index 441fd8b..d90aced 100644 (file)
@@ -970,6 +970,7 @@ module_init(void)
    EVRY_PLUGIN_NEW(EVRY_PLUGIN(p1), N_("Applications"), type_subject, "", "APPLICATION",
              _begin, _cleanup, _fetch, _icon_get, NULL);
    EVRY_PLUGIN(p1)->complete = &_complete;
+   EVRY_PLUGIN(p1)->config_path = "extensions/everything-apps";
    
    p2 = E_NEW(Plugin, 1);
    EVRY_PLUGIN_NEW(EVRY_PLUGIN(p2), N_("Open With..."), type_action, "FILE", "",
@@ -977,7 +978,8 @@ module_init(void)
              _icon_get, NULL);
 
    EVRY_PLUGIN(p2)->action = &_open_with_action;
-
+   EVRY_PLUGIN(p2)->config_path = "extensions/everything-apps";
+   
    evry_plugin_register(EVRY_PLUGIN(p1), 1);
    evry_plugin_register(EVRY_PLUGIN(p2), 1);
 
index c57e8dd..f2491d5 100644 (file)
@@ -705,11 +705,12 @@ module_init(void)
 
    p1 = EVRY_PLUGIN_NEW(NULL, N_("Files"), type_subject, "FILE", "FILE",
                        _begin, _cleanup, _fetch, _icon_get, NULL);
-
+   EVRY_PLUGIN(p1)->config_path = "extensions/everything-files";
+   evry_plugin_register(p1, 3);
+   
    p2 = EVRY_PLUGIN_NEW(NULL, N_("Files"), type_object, "FILE", "FILE",
                        _begin, _cleanup, _fetch, _icon_get, NULL);
-
-   evry_plugin_register(p1, 3);
+   EVRY_PLUGIN(p2)->config_path = "extensions/everything-files";
    evry_plugin_register(p2, 1);
 
    act1 = EVRY_ACTION_NEW(N_("Open Folder (EFM)"), "FILE", NULL, "folder-open",
index 9bc4e1d..57942e6 100644 (file)
@@ -222,6 +222,9 @@ struct _Evry_Plugin
   Plugin_Config *config;
 
   Eina_Bool changed;
+
+  /* config path registered for the module */
+  const char *config_path;
 };
 
 
index 1f01cb0..d49c5fd 100644 (file)
@@ -550,8 +550,6 @@ evry_plugin_unregister(Evry_Plugin *p)
 {
    DBG("%s", p->name);
 
-   /* evry_conf->plugins = eina_list_remove(evry_conf->plugins, p); */
-
    if (p->type == type_subject)
      {
        char buf[256];
@@ -559,7 +557,6 @@ evry_plugin_unregister(Evry_Plugin *p)
 
        e_action_predef_name_del(_("Everything"), buf);
      }
-   /* cleanup */
 }
 
 void
index ed1d2e3..b5e33cc 100644 (file)
@@ -18,6 +18,7 @@ struct _Plugin_Page
   Evas_Object *o_view_detail;
   Evas_Object *o_view_thumb;
   Evas_Object *o_enabled;
+  Evas_Object *o_cfg_btn;
   
   Eina_List *configs;
 
@@ -289,6 +290,15 @@ _list_select_cb (void *data, Evas_Object *obj)
 
        e_widget_check_checked_set(page->o_enabled, pc->enabled);
        e_widget_disabled_set(page->o_enabled, 0);
+
+       if (pc->plugin && pc->plugin->config_path)
+         {
+            e_widget_disabled_set(page->o_cfg_btn, 0);
+         }
+       else
+         {
+            e_widget_disabled_set(page->o_cfg_btn, 1);
+         }
        
        page->cur = pc;
      }
@@ -302,6 +312,7 @@ _list_select_cb (void *data, Evas_Object *obj)
        e_widget_disabled_set(page->o_view_list, 1);
        e_widget_disabled_set(page->o_view_thumb, 1);
        e_widget_disabled_set(page->o_enabled, 1);
+       e_widget_disabled_set(page->o_cfg_btn, 1);
 
        page->cur = NULL;
      }
@@ -310,6 +321,13 @@ _list_select_cb (void *data, Evas_Object *obj)
 static void
 _plugin_config_cb(void *data, void *data2)
 {
+   Plugin_Page *page = data;
+   if (!page->cur->plugin)
+     return;
+   
+   e_configure_registry_call(page->cur->plugin->config_path,
+                            e_container_current_get(e_manager_current_get()),
+                            NULL);
 }
 
 static Evas_Object *
@@ -338,11 +356,13 @@ _create_plugin_page(E_Config_Dialog_Data *cfdata, Evas *e, Plugin_Page *page)
 
    ob = e_widget_table_add(e, 1);
    e_widget_table_object_append(ob, of, 0, 0, 1, 3, 1, 1, 1, 1);
-
+   e_widget_disabled_set(o, 1);
    of = e_widget_framelist_add(e, _("General"), 0);
    o = e_widget_button_add(e, _("Configure"), NULL,
                           _plugin_config_cb,
-                          page->list, page->configs);
+                          page, NULL);
+   e_widget_disabled_set(o, 1);
+   page->o_cfg_btn = o;
    e_widget_framelist_object_append(of, o);
    o = e_widget_check_add(e, _("Enabled"),
                          &(page->enabled));