SF.net SVN: geany-plugins:[1131] trunk/geany-plugins/addons

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Jan 17 15:24:05 UTC 2010


Revision: 1131
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1131&view=rev
Author:   eht16
Date:     2010-01-17 15:24:04 +0000 (Sun, 17 Jan 2010)

Log Message:
-----------
Use the new "geany-startup-complete" signal to initially update the tasks list.

Modified Paths:
--------------
    trunk/geany-plugins/addons/ChangeLog
    trunk/geany-plugins/addons/src/addons.c
    trunk/geany-plugins/addons/src/ao_tasks.c
    trunk/geany-plugins/addons/src/ao_tasks.h

Modified: trunk/geany-plugins/addons/ChangeLog
===================================================================
--- trunk/geany-plugins/addons/ChangeLog	2010-01-17 13:22:49 UTC (rev 1130)
+++ trunk/geany-plugins/addons/ChangeLog	2010-01-17 15:24:04 UTC (rev 1131)
@@ -1,3 +1,10 @@
+2010-01-17  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/addons.c, src/ao_tasks.c, src/ao_tasks.h:
+   Use the new "geany-startup-complete" signal to initially update
+   the tasks list.
+
+
 2010-01-10  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * AUTHORS, README, src/ao_blanklines.c, src/ao_blanklines.h,

Modified: trunk/geany-plugins/addons/src/addons.c
===================================================================
--- trunk/geany-plugins/addons/src/addons.c	2010-01-17 13:22:49 UTC (rev 1130)
+++ trunk/geany-plugins/addons/src/addons.c	2010-01-17 15:24:04 UTC (rev 1131)
@@ -39,7 +39,7 @@
 GeanyFunctions	*geany_functions;
 
 
-PLUGIN_VERSION_CHECK(165)
+PLUGIN_VERSION_CHECK(170)
 PLUGIN_SET_INFO(_("Addons"), _("Various small addons for Geany."), VERSION,
 	"Enrico Tröger, Bert Vermeulen, Eugene Arshinov")
 
@@ -89,6 +89,7 @@
 static void ao_document_save_cb(GObject *obj, GeanyDocument *doc, gpointer data);
 static void ao_document_before_save_cb(GObject *obj, GeanyDocument *doc, gpointer data);
 static void ao_document_close_cb(GObject *obj, GeanyDocument *doc, gpointer data);
+static void ao_startup_complete_cb(GObject *obj, gpointer data);
 gboolean ao_editor_notify_cb(GObject *object, GeanyEditor *editor,
 	SCNotification *nt, gpointer data);
 
@@ -103,11 +104,18 @@
 	{ "document-close", (GCallback) &ao_document_close_cb, TRUE, NULL },
 	{ "document-activate", (GCallback) &ao_document_activate_cb, TRUE, NULL },
 	{ "document-before-save", (GCallback) &ao_document_before_save_cb, TRUE, NULL },
+	{ "geany-startup-complete", (GCallback) &ao_startup_complete_cb, TRUE, NULL },
 
 	{ NULL, NULL, FALSE, NULL }
 };
 
 
+static void ao_startup_complete_cb(GObject *obj, gpointer data)
+{
+	ao_tasks_set_active(ao_info->tasks);
+}
+
+
 static void kb_bmlist_activate(guint key_id)
 {
 	ao_bookmark_list_activate(ao_info->bookmarklist);

Modified: trunk/geany-plugins/addons/src/ao_tasks.c
===================================================================
--- trunk/geany-plugins/addons/src/ao_tasks.c	2010-01-17 13:22:49 UTC (rev 1130)
+++ trunk/geany-plugins/addons/src/ao_tasks.c	2010-01-17 15:24:04 UTC (rev 1131)
@@ -383,22 +383,6 @@
 }
 
 
-static gboolean update_list_delay(gpointer t)
-{
-	/* TODO add a signal in Geany when the main window is realised or the startup process
-	 * has been in general */
-	if (main_is_realized())
-	{
-		AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);
-		priv->active = TRUE;
-		ao_tasks_update(AO_TASKS(t), NULL);
-		return FALSE;
-	}
-	else
-		return TRUE;
-}
-
-
 static void ao_tasks_show(AoTasks *t)
 {
 	GtkCellRenderer *text_renderer;
@@ -489,13 +473,6 @@
 		gtk_label_new(_("Tasks")));
 
 	priv->popup_menu = create_popup_menu(t);
-
-	/* initial update */
-#if GLIB_CHECK_VERSION(2, 14, 0)
-	g_timeout_add_seconds(3, update_list_delay, t);
-#else
-	g_timeout_add(3, update_list_delay, t);
-#endif
 }
 
 
@@ -665,6 +642,15 @@
 }
 
 
+void ao_tasks_set_active(AoTasks *t)
+{
+	AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);
+	priv->active = TRUE;
+
+	ao_tasks_update(t, NULL);
+}
+
+
 void ao_tasks_update(AoTasks *t, GeanyDocument *cur_doc)
 {
 	AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);

Modified: trunk/geany-plugins/addons/src/ao_tasks.h
===================================================================
--- trunk/geany-plugins/addons/src/ao_tasks.h	2010-01-17 13:22:49 UTC (rev 1130)
+++ trunk/geany-plugins/addons/src/ao_tasks.h	2010-01-17 15:24:04 UTC (rev 1131)
@@ -43,6 +43,7 @@
 void			ao_tasks_update_single	(AoTasks *t, GeanyDocument *cur_doc);
 void			ao_tasks_remove			(AoTasks *t, GeanyDocument *cur_doc);
 void			ao_tasks_activate		(AoTasks *t);
+void			ao_tasks_set_active		(AoTasks *t);
 
 G_END_DECLS
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list