aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/groupwise-features/share-folder-common.c
diff options
context:
space:
mode:
authorVivek Jain <jvivek@novell.com>2005-05-24 13:12:20 +0800
committerJain Vivek <jvivek@src.gnome.org>2005-05-24 13:12:20 +0800
commit52df90026f24374924516e7a02588b57a573f594 (patch)
treec4af78662b9393c7d39a92ab57cb577cad21af6c /plugins/groupwise-features/share-folder-common.c
parent179aec8eac14dd0dfba319b22e3c3a63138e3b5f (diff)
downloadgsoc2013-evolution-52df90026f24374924516e7a02588b57a573f594.tar.gz
gsoc2013-evolution-52df90026f24374924516e7a02588b57a573f594.tar.zst
gsoc2013-evolution-52df90026f24374924516e7a02588b57a573f594.zip
removed "Item" tag entries, included a factory method
2005-05-24 Vivek Jain <jvivek@novell.com> * org-gnome-groupwise-features.eplug.xml: removed "Item" tag entries, included a factory method * shared-folder-common.c: changed callback (org_gnome_create_option) to a factory method, check uri before adding the option to the menu. New folder dialog now comes in another callback (create_shared_folder) also added a function to free the item list. svn path=/trunk/; revision=29404
Diffstat (limited to 'plugins/groupwise-features/share-folder-common.c')
-rw-r--r--plugins/groupwise-features/share-folder-common.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c
index 388ec39260..cde5069a34 100644
--- a/plugins/groupwise-features/share-folder-common.c
+++ b/plugins/groupwise-features/share-folder-common.c
@@ -60,6 +60,8 @@ struct ShareInfo {
GtkWidget * org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
void org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *target);
+static void create_shared_folder(EPopup *ep, EPopupItem *p, void *data);
+static void popup_free (EPopup *ep, GSList *items, void *data);
void shared_folder_commit (EPlugin *ep, EConfigTarget *tget);
void shared_folder_abort (EPlugin *ep, EConfigTarget *target);
@@ -331,8 +333,43 @@ new_folder_response (EMFolderSelector *emfs, int response, EMFolderTreeModel *mo
}
+static EPopupItem popup_items[] = {
+{ E_POPUP_ITEM, "20.emc.001", N_("New _Shared Folder..."), create_shared_folder, NULL, "stock_new-dir", 0, EM_POPUP_FOLDER_INFERIORS }
+};
+
+static void
+popup_free (EPopup *ep, GSList *items, void *data)
+{
+g_slist_free (items);
+}
+
void
-org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *target)
+org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *t)
+{
+ GSList *menus = NULL;
+ int i = 0;
+ static int first =1;
+
+ if (! g_strrstr (t->uri, "groupwise://"))
+ return ;
+
+ /* for translation*/
+ if (first) {
+ popup_items[0].label = _(popup_items[0].label);
+
+ }
+
+ first++;
+
+ for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
+ menus = g_slist_prepend (menus, &popup_items[i]);
+
+ e_popup_add_items (t->target.popup, menus, NULL, popup_free, NULL);
+
+}
+
+static void
+create_shared_folder(EPopup *ep, EPopupItem *p, void *data)
{
EMFolderTreeModel *model;