[anjuta/git-shell: 44/61] git: Implement the Fetch pane



commit 372ae5ed1a5f580f8606d31169cccba978a82eb2
Author: James Liggett <jrliggett cox net>
Date:   Mon Jul 12 15:46:44 2010 -0700

    git: Implement the Fetch pane

 plugins/git/Makefile.am      |    4 ++-
 plugins/git/git-fetch-pane.c |   45 ++++++++++++++++++++++++++++++++++++++++++
 plugins/git/git-fetch-pane.h |   28 ++++++++++++++++++++++++++
 plugins/git/plugin.c         |    9 ++++++++
 4 files changed, 85 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index b9d44e4..99cafcd 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -191,7 +191,9 @@ libanjuta_git_la_SOURCES = \
 	git-add-remote-pane.c \
 	git-add-remote-pane.h \
 	git-delete-remote-pane.c \
-	git-delete-remote-pane.h
+	git-delete-remote-pane.h \
+	git-fetch-pane.c \
+	git-fetch-pane.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/git-fetch-pane.c b/plugins/git/git-fetch-pane.c
new file mode 100644
index 0000000..ce86c1d
--- /dev/null
+++ b/plugins/git/git-fetch-pane.c
@@ -0,0 +1,45 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * git-shell-test
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * git-shell-test is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * git-shell-test is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "git-fetch-pane.h"
+
+void
+on_fetch_button_clicked (GtkAction *action, Git *plugin)
+{
+	GitFetchCommand *fetch_command;
+
+	fetch_command = git_fetch_command_new (plugin->project_root_directory);
+
+	git_pane_create_message_view (plugin);
+
+	g_signal_connect (G_OBJECT (fetch_command), "data-arrived",
+	                  G_CALLBACK (git_pane_on_command_info_arrived),
+	                  plugin);
+
+	g_signal_connect (G_OBJECT (fetch_command), "command-finished",
+	                  G_CALLBACK (git_pane_report_errors),
+	                  plugin);
+
+	g_signal_connect (G_OBJECT (fetch_command), "command-finished",
+	                  G_CALLBACK (g_object_unref),
+	                  NULL);
+
+	anjuta_command_start (ANJUTA_COMMAND (fetch_command));
+}
+ 
\ No newline at end of file
diff --git a/plugins/git/git-fetch-pane.h b/plugins/git/git-fetch-pane.h
new file mode 100644
index 0000000..1dcda59
--- /dev/null
+++ b/plugins/git/git-fetch-pane.h
@@ -0,0 +1,28 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * git-shell-test
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * git-shell-test is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * git-shell-test is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GIT_FETCH_PANE_H_
+#define _GIT_FETCH_PANE_H_
+
+#include "git-pane.h"
+#include "git-fetch-command.h"
+
+void on_fetch_button_clicked (GtkAction *action, Git *plugin);
+
+#endif
\ No newline at end of file
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index b3dd4f9..dc1057e 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -38,6 +38,7 @@
 #include "git-diff-pane.h"
 #include "git-add-remote-pane.h"
 #include "git-delete-remote-pane.h"
+#include "git-fetch-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -193,6 +194,14 @@ AnjutaCommandBarEntry remotes_entries[] =
 		N_("Pull changes from a remote repository"),
 		GTK_STOCK_GO_BACK,
 		G_CALLBACK (on_pull_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"Fetch",
+		N_("Fetch"),
+		N_("Fetch changes from remote repositories"),
+		GTK_STOCK_CONNECT,
+		G_CALLBACK (on_fetch_button_clicked)
 	}
 	
 };



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