[anjuta] starter: Fix some show/hide issues and faq url



commit 888739367298c3ff600f137b0364cb8389ca6513
Author: Johannes Schmid <jhs gnome org>
Date:   Wed Feb 23 22:02:52 2011 +0100

    starter: Fix some show/hide issues and faq url

 plugins/starter/plugin.c   |   38 +++++++-------------------------------
 plugins/starter/starter.ui |    2 +-
 2 files changed, 8 insertions(+), 32 deletions(-)
---
diff --git a/plugins/starter/plugin.c b/plugins/starter/plugin.c
index 346d7fe..caa2028 100644
--- a/plugins/starter/plugin.c
+++ b/plugins/starter/plugin.c
@@ -227,32 +227,6 @@ on_value_added_current_project (AnjutaPlugin *plugin, const gchar *name,
 	}
 }
 
-static void
-on_value_removed_current_editor (AnjutaPlugin *plugin, const gchar *name,
-								 gpointer data)
-{
-	AnjutaShell* shell = anjuta_plugin_get_shell (plugin);
-	StarterPlugin* splugin = ANJUTA_PLUGIN_STARTER (plugin);
-	IAnjutaDocumentManager* docman = anjuta_shell_get_interface (shell,
-	                                                             IAnjutaDocumentManager,
-	                                                             NULL);
-	
-	if (!ianjuta_document_manager_get_doc_widgets (docman,
-	                                               NULL))
-	{
-		DEBUG_PRINT ("Showing starter");
-		splugin->starter = create_starter_widget (splugin);
-		anjuta_shell_add_widget (shell, splugin->starter,
-		                         "AnjutaStarter",
-		                         _("Start"),
-		                         GTK_STOCK_ABOUT,
-		                         ANJUTA_SHELL_PLACEMENT_CENTER,
-		                         NULL);
-		anjuta_shell_present_widget (shell, splugin->starter, NULL);
-		anjuta_shell_maximize_widget (shell, "AnjutaStarter", NULL);
-		g_object_unref (splugin->starter);
-	}
-}
 
 /* Remove the starter plugin once a document was opened */
 static void
@@ -275,8 +249,8 @@ on_value_added_current_editor (AnjutaPlugin *plugin, const gchar *name,
 }
 
 static void
-on_value_removed_current_project (AnjutaPlugin *plugin, const gchar *name,
-                                  gpointer data)
+on_value_removed (AnjutaPlugin *plugin, const gchar *name,
+                  gpointer data)
 {
 	AnjutaShell* shell = anjuta_plugin_get_shell (plugin);
 	StarterPlugin* splugin = ANJUTA_PLUGIN_STARTER (plugin);
@@ -313,6 +287,8 @@ on_session_load (AnjutaShell* shell,
 {
 	if (phase == ANJUTA_SESSION_PHASE_END)
 	{
+		if (!plugin->starter)
+			on_value_removed (ANJUTA_PLUGIN (plugin), NULL, plugin);
 		if (plugin->starter)
 		{
 			anjuta_shell_maximize_widget (shell,
@@ -333,15 +309,15 @@ activate_plugin (AnjutaPlugin *plugin)
 		anjuta_plugin_add_watch (plugin,
 								  IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT,
 								 on_value_added_current_editor,
-								 on_value_removed_current_editor,
+								 on_value_removed,
 								 NULL);
 	splugin->project_watch_id = 
 		anjuta_plugin_add_watch (plugin,
 								  IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT,
 								 on_value_added_current_project,
-								 on_value_removed_current_project,
+								 on_value_removed,
 								 NULL);
-	on_value_removed_current_editor (plugin, NULL, splugin);
+	on_value_removed (plugin, NULL, splugin);
 
 	g_signal_connect (anjuta_plugin_get_shell (plugin),
 	                  "load-session",
diff --git a/plugins/starter/starter.ui b/plugins/starter/starter.ui
index 1990265..9a31270 100644
--- a/plugins/starter/starter.ui
+++ b/plugins/starter/starter.ui
@@ -243,7 +243,7 @@
                         <property name="halign">start</property>
                         <property name="use_action_appearance">False</property>
                         <property name="relief">none</property>
-                        <property name="uri">ghelp:anjuta-faq</property>
+                        <property name="uri">ghelp:anjuta-faqs</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>



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