[Commits] example-extension.c 1.4 1.5

miras at claws-mail.org miras at claws-mail.org
Sat Dec 31 15:32:24 CET 2011


Update of /home/claws-mail/contacts/extensions/example/src
In directory claws-mail:/tmp/cvs-serv17716/extensions/example/src

Modified Files:
	example-extension.c 
Log Message:
2011-12-31 [mir]	0.6.0cvs63

	* extensions/example/src/example-extension.c
	* extensions/export/ldifexport_extension.c
	* extensions/export/wizard.c
	* extensions/export/wizard.h
	* extensions/import/ldifimport_extension.c
	* src/extension.h
	    Necessary changes to be able to support more
	    possibilities for making extensions.

Index: example-extension.c
===================================================================
RCS file: /home/claws-mail/contacts/extensions/example/src/example-extension.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- example-extension.c	14 Dec 2011 08:27:03 -0000	1.4
+++ example-extension.c	31 Dec 2011 14:32:21 -0000	1.5
@@ -46,9 +46,9 @@
 static guint my_id;
 
 static void my_cb(GtkWidget* widget, gpointer data) {
-	MainWindow* mainwindow = (MainWindow*) data;
+	MenuItem* item = (MenuItem *) data;
 	
-	show_message(mainwindow->window, GTK_UTIL_MESSAGE_INFO, "test");
+	show_message(item->mainwindow->window, GTK_UTIL_MESSAGE_INFO, "test");
 }
 
 static void setup(const MainWindow* mainwindow, gpointer object) {
@@ -57,54 +57,59 @@
 	
 	// Add a menu item into the file menu
 	menu = gtk_image_menu_item_new_with_mnemonic("_Test2");
-    g_signal_connect(menu, "activate",
-            G_CALLBACK(my_cb), (gpointer) mainwindow);
     menu_item = menu_item_new();
     menu_item->menu = CONTACTS_MAIN_MENU;
     menu_item->parent = "file";
     menu_item->submenu = FALSE;
+	menu_item->mainwindow = mainwindow;
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), (gpointer) menu_item);
 	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
 
 	// Add a menu item into the context menu of contact
 	menu = gtk_image_menu_item_new_with_mnemonic("_Test3");
-    g_signal_connect(menu, "activate",
-            G_CALLBACK(my_cb), (gpointer) mainwindow);
     menu_item = menu_item_new();
     menu_item->menu = CONTACTS_CONTACT_MENU;
     menu_item->submenu = FALSE;
+	menu_item->mainwindow = mainwindow;
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), (gpointer) menu_item);
 	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
 
 	// Add a menu item into the context menu of address book
 	// Will create another submenu since ldifimport also has
 	// a menu item under '_Import'
 	menu = gtk_image_menu_item_new_with_mnemonic("_Test");
-    g_signal_connect(menu, "activate",
-            G_CALLBACK(my_cb), (gpointer) mainwindow);
     menu_item = menu_item_new();
     menu_item->menu = CONTACTS_ADDRESSBOOK_MENU;
     menu_item->sublabel = "_Import";
     menu_item->submenu = TRUE;
+	menu_item->mainwindow = mainwindow;
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), (gpointer) menu_item);
 	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
 
 	// Add a menu item into the menu bar
 	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;
+	menu_item->mainwindow = mainwindow;
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), menu_item);
 	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
 
 	// Add another menu item into the menu bar. This time as a submenu
 	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;
+	menu_item->mainwindow = mainwindow;
+    g_signal_connect(menu, "activate",
+            G_CALLBACK(my_cb), menu_item);
 	add_menu_item(GTK_IMAGE_MENU_ITEM(menu), menu_item);
 }
 



More information about the Commits mailing list