[evolution-kolab/ek-wip-gui: 5/13] EPlugin: added hooks for context menu extensions



commit a395587d7f98def3964c317ef795d7b3b1b0759f
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Feb 10 17:14:57 2012 +0100

    EPlugin: added hooks for context menu extensions
    
    * added hooks for mail and backends (addressbook,
      calendar) to extend the right-click context menus
      to the eplug XML file
    * added stub implementations for the hook functions

 src/eplugin/e-kolab-plugin.c          |   69 ++++++++++++-
 src/eplugin/e-kolab-plugin.h          |   21 ++++
 src/eplugin/org-gnome-kolab.eplug.xml |  183 ++++++++++++++++++++-------------
 3 files changed, 198 insertions(+), 75 deletions(-)
---
diff --git a/src/eplugin/e-kolab-plugin.c b/src/eplugin/e-kolab-plugin.c
index ba0f3c2..4ea52e4 100644
--- a/src/eplugin/e-kolab-plugin.c
+++ b/src/eplugin/e-kolab-plugin.c
@@ -57,7 +57,7 @@ e_plugin_lib_enable (EPlugin *epl,
 }
 
 /*----------------------------------------------------------------------------*/
-/* calendar */
+/* calendar backend creation */
 
 gboolean
 e_kolab_plugin_calendar_check (EPlugin *epl,
@@ -97,7 +97,7 @@ e_kolab_plugin_calendar_create (EPlugin *epl,
 }
 
 /*----------------------------------------------------------------------------*/
-/* address book */
+/* addressbook backend creation */
 
 gboolean
 e_kolab_plugin_addressbook_check (EPlugin *epl,
@@ -137,7 +137,7 @@ e_kolab_plugin_addressbook_create (EPlugin *epl,
 }
 
 /*----------------------------------------------------------------------------*/
-/* mail */
+/* mail account setup */
 
 gboolean
 e_kolab_plugin_mail_account_check (EPlugin *epl,
@@ -181,3 +181,66 @@ e_kolab_plugin_mail_account_setup (EPlugin *epl,
 }
 
 /*----------------------------------------------------------------------------*/
+/* Kolab folder UI extensions init */
+
+gboolean
+e_kolab_plugin_init_mail (GtkUIManager *ui_manager,
+                          EShellView *shell_view)
+{
+	g_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), FALSE);
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
+
+	g_debug ("%s: called.", __func__);
+
+	return TRUE;
+}
+
+gboolean
+e_kolab_plugin_init_calendar (GtkUIManager *ui_manager,
+                              EShellView *shell_view)
+{
+	g_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), FALSE);
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
+
+	g_debug ("%s: called.", __func__);
+
+	return TRUE;
+}
+
+gboolean
+e_kolab_plugin_init_tasks (GtkUIManager *ui_manager,
+                           EShellView *shell_view)
+{
+	g_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), FALSE);
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
+
+	g_debug ("%s: called.", __func__);
+
+	return TRUE;
+}
+
+gboolean
+e_kolab_plugin_init_memos (GtkUIManager *ui_manager,
+                           EShellView *shell_view)
+{
+	g_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), FALSE);
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
+
+	g_debug ("%s: called.", __func__);
+
+	return TRUE;
+}
+
+gboolean
+e_kolab_plugin_init_contacts (GtkUIManager *ui_manager,
+                              EShellView *shell_view)
+{
+	g_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), FALSE);
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
+
+	g_debug ("%s: called.", __func__);
+
+	return TRUE;
+}
+
+/*----------------------------------------------------------------------------*/
diff --git a/src/eplugin/e-kolab-plugin.h b/src/eplugin/e-kolab-plugin.h
index 59f97e9..4b1edcf 100644
--- a/src/eplugin/e-kolab-plugin.h
+++ b/src/eplugin/e-kolab-plugin.h
@@ -36,6 +36,7 @@
 
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
+#include <shell/e-shell-view.h>
 
 /*----------------------------------------------------------------------------*/
 
@@ -79,6 +80,26 @@ GtkWidget*
 e_kolab_plugin_mail_account_setup (EPlugin *epl,
                                    EConfigHookItemFactoryData *data);
 
+gboolean
+e_kolab_plugin_init_mail (GtkUIManager *ui_manager,
+                          EShellView *shell_view);
+
+gboolean
+e_kolab_plugin_init_calendar (GtkUIManager *ui_manager,
+                              EShellView *shell_view);
+
+gboolean
+e_kolab_plugin_init_tasks (GtkUIManager *ui_manager,
+                           EShellView *shell_view);
+
+gboolean
+e_kolab_plugin_init_memos (GtkUIManager *ui_manager,
+                           EShellView *shell_view);
+
+gboolean
+e_kolab_plugin_init_contacts (GtkUIManager *ui_manager,
+                              EShellView *shell_view);
+
 /*----------------------------------------------------------------------------*/
 
 #endif /* _E_KOLAB_PLUGIN_H_ */
diff --git a/src/eplugin/org-gnome-kolab.eplug.xml b/src/eplugin/org-gnome-kolab.eplug.xml
index 6b7aff5..358ff46 100644
--- a/src/eplugin/org-gnome-kolab.eplug.xml
+++ b/src/eplugin/org-gnome-kolab.eplug.xml
@@ -1,82 +1,121 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <e-plugin-list>
-	<e-plugin type="shlib"
-		  location="@PLUGINDIR@/liborg-gnome-kolab.so"
-		  load-on-startup="true"
-		  id="org.gnome.evolution.plugin.kolab"
-		  name="Kolab"
-		  system_plugin="true">
+  <e-plugin type="shlib"
+	    location="@PLUGINDIR@/liborg-gnome-kolab.so"
+	    load-on-startup="true"
+	    id="org.gnome.evolution.plugin.kolab"
+	    name="Kolab"
+	    system_plugin="true">
 
-		<author name="Christian Hilberg" email="hilberg kernelconcepts de"/>
-		<author name="Silvan M. Fin" email="silvan kernelconcepts de"/>
+    <author name="Christian Hilberg" email="hilberg kernelconcepts de" />
+    <author name="Silvan M. Fin" email="silvan kernelconcepts de" />
 
-		<description>Kolab2 Plugin</description>
+    <description>Kolab2 Plugin</description>
 
-		<hook class="org.gnome.evolution.addressbook.config:1.0">
-			<group
-				target="source"
-				id="com.novell.evolution.addressbook.config.accountEditor"
-				check="e_kolab_plugin_addressbook_check"
-				commit="e_kolab_plugin_addressbook_commit">
-				<item
-					type="item"
-					path="00.general/10.display/50.createcontacts"
-					factory="e_kolab_plugin_addressbook_create"/>
-			</group>
-		</hook>
-		<hook class="org.gnome.evolution.calendar.config:1.0">
-			<group
-				target="source"
-				id="org.gnome.evolution.calendar.calendarProperties"
-				check="e_kolab_plugin_calendar_check"
-				commit="e_kolab_plugin_calendar_commit">
-				<item
-					type="item_table"
-					path="00.general/10.source/40.pcalendar"
-					factory="e_kolab_plugin_calendar_create"/>
-			</group>
-		</hook>
+    <!-- backend configuration -->
 
-		<!--
+    <!-- addressbook configuration -->
+    <hook class="org.gnome.evolution.addressbook.config:1.0">
+      <group target="source"
+	     id="com.novell.evolution.addressbook.config.accountEditor"
+	     check="e_kolab_plugin_addressbook_check"
+	     commit="e_kolab_plugin_addressbook_commit">
+	<item type="item"
+	      path="00.general/10.display/50.createcontacts"
+	      factory="e_kolab_plugin_addressbook_create" />
+      </group>
+    </hook>
+    <!-- calendar configuration -->
+    <hook class="org.gnome.evolution.calendar.config:1.0">
+      <group target="source"
+	     id="org.gnome.evolution.calendar.calendarProperties"
+	     check="e_kolab_plugin_calendar_check"
+	     commit="e_kolab_plugin_calendar_commit">
+	<item type="item_table"
+	      path="00.general/10.source/40.pcalendar"
+	      factory="e_kolab_plugin_calendar_create" />
+      </group>
+    </hook>
 
-		<hook class="org.gnome.evolution.plugin.kolab.mail.config:1.0">
-			<group
-				target="account"
-				id="org.gnome.evolution.mail.config.accountWizard"
-				check="e_kolab_plugin_mail_account_check">
-				commit="e_kolab_plugin_mail_account_commit">
-				<item
-					type="item_table"
-					path="10.receive/20.config/30.kolab"
-					factory="e_kolab_plugin_mail_account_setup"/>
-			</group>
-		</hook>
-		<hook class="org.gnome.evolution.mail.config:1.0">
-			<group
-				target="account"
-				id="org.gnome.evolution.mail.config.accountAssistant"
-				check="e_kolab_plugin_mail_account_check">
-				commit="e_kolab_plugin_mail_account_commit">
-				<item
-					type="item_table"
-					path="10.receive/20.config/30.kolab"
-					factory="e_kolab_plugin_mail_account_setup"/>
-			</group>
-		</hook>
-		<hook class="org.gnome.evolution.mail.config:1.0">
-			<group
-				target="account"
-				id="org.gnome.evolution.mail.config.accountEditor"
-				check="e_kolab_plugin_mail_account_check">
-				commit="e_kolab_plugin_mail_account_commit">
-				<item
-					type="item_table"
-					path="10.receive/20.config/30.kolab"
-					factory="e_kolab_plugin_mail_account_setup"/>
-			</group>
-		</hook>
+    <!-- Kolab folder UI extensions -->
 
-		-->
+    <hook class="org.gnome.evolution.ui:1.0">
+      <ui-manager id="org.gnome.evolution.mail" callback="e_kolab_plugin_init_mail">
+	<popup name="mail-folder-popup">
+	  <placeholder name="mail-folder-popup-actions">
+	    <menuitem action="kolab-mail-folder-permissions" />
+	    <menuitem action="kolab-mail-folder-metadata" />
+	  </placeholder>
+	</popup>
+      </ui-manager>
+      <ui-manager id="org.gnome.evolution.calendars" callback="e_kolab_plugin_init_calendar">
+	<popup name="calendar-popup">
+	  <placeholder name="calendar-popup-actions">
+	    <menuitem action="kolab-calendar-folder-permissions" />
+	    <menuitem action="kolab-calendar-folder-metadata" />
+	  </placeholder>
+	</popup>
+      </ui-manager>
+      <ui-manager id="org.gnome.evolution.tasks" callback="e_kolab_plugin_init_tasks">
+	<popup name="task-list-popup">
+	  <placeholder name="task-list-popup-actions">
+	    <menuitem action="kolab-tasks-folder-permissions" />
+	    <menuitem action="kolab-tasks-folder-metadata" />
+	  </placeholder>
+	</popup>
+      </ui-manager>
+      <ui-manager id="org.gnome.evolution.memos" callback="e_kolab_plugin_init_memos">
+	<popup name="memo-list-popup">
+	  <placeholder name="memo-list-popup-actions">
+	    <menuitem action="kolab-memo-folder-permissions" />
+	    <menuitem action="kolab-memo-folder-metadata" />
+	  </placeholder>
+	</popup>
+      </ui-manager>
+      <ui-manager id="org.gnome.evolution.contacts" callback="e_kolab_plugin_init_contacts">
+	<popup name="address-book-popup">
+	  <placeholder name="address-book-popup-actions">
+	    <menuitem action="kolab-contacts-folder-permissions" />
+	    <menuitem action="kolab-contacts-folder-metadata" />
+	  </placeholder>
+	</popup>
+      </ui-manager>
+    </hook>
 
-	</e-plugin>
+    <!--
+
+    <hook class="org.gnome.evolution.plugin.kolab.mail.config:1.0">
+      <group target="account"
+	     id="org.gnome.evolution.mail.config.accountWizard"
+	     check="e_kolab_plugin_mail_account_check"
+	     commit="e_kolab_plugin_mail_account_commit">
+	<item type="item_table"
+	      path="10.receive/20.config/30.kolab"
+	      factory="e_kolab_plugin_mail_account_setup" />
+      </group>
+    </hook>
+    <hook class="org.gnome.evolution.mail.config:1.0">
+      <group target="account"
+	     id="org.gnome.evolution.mail.config.accountAssistant"
+	     check="e_kolab_plugin_mail_account_check"
+	     commit="e_kolab_plugin_mail_account_commit">
+	<item type="item_table"
+	      path="10.receive/20.config/30.kolab"
+	      factory="e_kolab_plugin_mail_account_setup" />
+      </group>
+    </hook>
+    <hook class="org.gnome.evolution.mail.config:1.0">
+      <group target="account"
+	     id="org.gnome.evolution.mail.config.accountEditor"
+	     check="e_kolab_plugin_mail_account_check"
+	     commit="e_kolab_plugin_mail_account_commit">
+	<item type="item_table"
+	      path="10.receive/20.config/30.kolab"
+	      factory="e_kolab_plugin_mail_account_setup" />
+      </group>
+    </hook>
+
+    -->
+
+  </e-plugin>
 </e-plugin-list>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]