[Commits] ldifexport_extension.c 1.2 1.3

miras at claws-mail.org miras at claws-mail.org
Sat Dec 10 00:01:23 CET 2011


Update of /home/claws-mail/contacts/extensions/export
In directory claws-mail:/tmp/cvs-serv2085/extensions/export

Modified Files:
	ldifexport_extension.c 
Log Message:
2011-12-09 [mir]	0.6.0cvs38

	* claws-contacts.pc.in
	* configure.ac
	* extensions/Makefile.am
	* extensions/example/Makefile.am
	* extensions/example/configure.ac
	* extensions/example/config/Makefile.am
	* extensions/example/src/Makefile.am
	* extensions/example/src/example-extension.c
	* extensions/export/ldifexport_extension.c
	* plugins/Makefile.am
	* plugins/example/Makefile.am
	* plugins/example/configure.ac
	* src/Makefile.am
	* src/callbacks.c
	* src/contactwindow.c
	* src/extension-loader.c
	* src/extension-loader.h
	* src/extension.c
	* src/extension.h
	* src/gtk-utils.c
	* src/mainwindow.c
	* src/mainwindow.h
	    Fix a number of bugs
	    Refined the build system
	    Added a plugable extension framework 

Index: ldifexport_extension.c
===================================================================
RCS file: /home/claws-mail/contacts/extensions/export/ldifexport_extension.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ldifexport_extension.c	3 Dec 2011 21:18:38 -0000	1.2
+++ ldifexport_extension.c	9 Dec 2011 23:01:21 -0000	1.3
@@ -36,18 +36,55 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib/gprintf.h>
+#include <gtk/gtk.h>
 #include "extension.h"
 #include "utils.h"
+#include "gtk-utils.h"
 
 #define NAME "LDIF Export extension"
 
 static guint my_id;
 
-static void myhook(const MainWindow* mainwindow, gpointer object) {
-	AddressBook* abook = (AddressBook *) object;
+static void my_cb(GtkWidget* widget, gpointer data) {
+	const MainWindow* mainwindow = (const MainWindow*) data;
 	
-	fprintf(stderr, "Address book [%s] loading\n", abook->abook_name);
-	fprintf(stderr, "Number of contacts: %d\n", g_list_length(abook->contacts));
+	show_message(mainwindow->window, GTK_UTIL_MESSAGE_INFO, "test");
+}
+
+static void setup(const MainWindow* mainwindow, gpointer object) {
+	GtkWidget *menu;
+	MenuItem* menu_item;
+	
+/*	//root = gtk_image_menu_item_new_with_mnemonic("_Test1");
+	menu = gtk_image_menu_item_new_with_mnemonic("_Zest2");
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), mainwindow);
+    menu_item = menu_item_new();
+    menu_item->menu = CONTACTS_MAIN_MENU;
+    menu_item->parent = "file";
+    menu_item->sublabel = "_Test1";
+    menu_item->submenu = TRUE;
+	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
+*/
+	menu = gtk_image_menu_item_new_with_mnemonic("_Zest2");
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), mainwindow);
+    menu_item = menu_item_new();
+    menu_item->menu = CONTACTS_MAIN_MENU;
+    menu_item->parent = "_Menu";
+    menu_item->submenu = FALSE;
+	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
+
+	menu = gtk_image_menu_item_new_with_mnemonic("_Yest1");
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), mainwindow);
+    menu_item = menu_item_new();
+    menu_item->menu = CONTACTS_MAIN_MENU;
+    menu_item->parent = "_Menu";
+    menu_item->sublabel = "_Test1";
+    menu_item->submenu = TRUE;
+	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
+
 }
 
 /**
@@ -61,8 +98,7 @@
 	my_id = id;
 	gchar* error;
 	
-	register_hook_function(my_id, EXTENSION_BEFORE_OPEN_ABOOK_HOOK,
-						   myhook, &error);
+	register_hook_function(my_id, EXTENSION_AFTER_INIT_HOOK, setup, &error);
 	return 0;
 }
 



More information about the Commits mailing list