gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1264 - in gnunet-gtk: . src/core


From: grothoff
Subject: [GNUnet-SVN] r1264 - in gnunet-gtk: . src/core
Date: Mon, 4 Jul 2005 17:03:23 -0700 (PDT)

Author: grothoff
Date: 2005-07-04 17:03:19 -0700 (Mon, 04 Jul 2005)
New Revision: 1264

Modified:
   gnunet-gtk/ChangeLog
   gnunet-gtk/src/core/main.c
Log:
update

Modified: gnunet-gtk/ChangeLog
===================================================================
--- gnunet-gtk/ChangeLog        2005-07-04 23:45:28 UTC (rev 1263)
+++ gnunet-gtk/ChangeLog        2005-07-05 00:03:19 UTC (rev 1264)
@@ -1,3 +1,7 @@
+Tue Jul  5 01:48:30 CEST 2005
+       Refactored code to use plugins for the different
+       applications (die monolithic code, die!).
+       
 Sat Jul  2 17:21:07 CEST 2005
        Fixed omissions from glade file.  Implemented
        aborting downloads and clearing completed

Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c  2005-07-04 23:45:28 UTC (rev 1263)
+++ gnunet-gtk/src/core/main.c  2005-07-05 00:03:19 UTC (rev 1264)
@@ -97,6 +97,35 @@
   void * library;
 } Plugin;
 
+static void connector(const gchar *handler_name,
+                     GObject *object,
+                     const gchar *signal_name,
+                     const gchar *signal_data,
+                     GObject *connect_object,
+                     gboolean after,
+                     gpointer user_data) {
+  Plugin * plug = user_data;
+  void * method;
+
+  while (plug != NULL) {
+    method = trybindDynamicMethod(plug->library,
+                                 "",
+                                 handler_name);
+    if (method != NULL)
+      break;
+    plug = plug->next;
+  }
+  if (method == NULL) {
+    LOG(LOG_WARNING,
+       _("Failed to find handler for '%s'\n"),
+       handler_name);
+    return;
+  }
+  glade_xml_signal_connect(mainXML,
+                          handler_name,
+                          (GCallback) method);
+}
+
 static Plugin * loadPlugin(const char * name,
                           Plugin * next) {
   Plugin * p;
@@ -192,7 +221,7 @@
                          
   /* connect the signals in the interface */
   setCustomLogProc(&addLogEntry);
-  glade_xml_signal_autoconnect(mainXML);
+  glade_xml_signal_autoconnect_full(mainXML, &connector, plugin);
 
   /* start the event loop */
   gdk_threads_enter();  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]