[anjuta/git-shell: 24/26] git: Run the remote branch list command after the local one



commit d274903acc89b49c242dcc8cea55ca92e03b1477
Author: James Liggett <jrliggett cox net>
Date:   Mon May 17 16:57:11 2010 -0700

    git: Run the remote branch list command after the local one

 plugins/git/plugin.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 77f2f1f..ae908d7 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -91,7 +91,7 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
 
 	anjuta_command_start_automatic_monitor (ANJUTA_COMMAND (git_plugin->local_branch_list_command));
 	anjuta_command_start (ANJUTA_COMMAND (git_plugin->local_branch_list_command));
-	anjuta_command_start (ANJUTA_COMMAND (git_plugin->remote_branch_list_command));
+	
 
 	gtk_widget_set_sensitive (git_plugin->dock, TRUE);
 	gtk_widget_set_sensitive (git_plugin->command_bar, TRUE);
@@ -155,6 +155,15 @@ on_editor_removed (AnjutaPlugin *plugin, const gchar *name, gpointer user_data)
 	git_plugin->current_editor_filename = NULL;
 }
 
+static void
+on_local_branch_list_command_finished (AnjutaCommand *command, 
+                                       guint return_code, Git *plugin)
+{
+	/* Always run the remote list command after the local command finishes */
+	if (return_code == 0)
+		anjuta_command_start (ANJUTA_COMMAND (plugin->remote_branch_list_command));
+}
+
 static gboolean
 git_activate_plugin (AnjutaPlugin *plugin)
 {
@@ -213,6 +222,11 @@ git_activate_plugin (AnjutaPlugin *plugin)
 	git_plugin->remote_branch_list_command = git_branch_list_command_new (NULL,
 	                                                                      GIT_BRANCH_TYPE_REMOTE);
 
+	g_signal_connect (G_OBJECT (git_plugin->local_branch_list_command), 
+	                  "command-finished",
+	                  G_CALLBACK (on_local_branch_list_command_finished),
+	                  git_plugin);
+
 	/* Add the panes to the dock */
 	git_plugin->branches_pane = git_branches_pane_new (git_plugin);
 	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Branches", 



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