[anjuta/git-shell: 37/61] git: Implement the Delete Remote pane



commit 9c65d4c2d21aa6648123fac9d2f26d4af393013a
Author: James Liggett <jrliggett cox net>
Date:   Sun Jul 11 16:52:51 2010 -0700

    git: Implement the Delete Remote pane

 plugins/git/Makefile.am              |    4 ++-
 plugins/git/git-delete-remote-pane.c |   51 ++++++++++++++++++++++++++++++++++
 plugins/git/git-delete-remote-pane.h |   28 ++++++++++++++++++
 plugins/git/plugin.c                 |    9 ++++++
 4 files changed, 91 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index ccd6a4e..b9d44e4 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -189,7 +189,9 @@ libanjuta_git_la_SOURCES = \
 	git-diff-pane.c \
 	git-diff-pane.h \
 	git-add-remote-pane.c \
-	git-add-remote-pane.h
+	git-add-remote-pane.h \
+	git-delete-remote-pane.c \
+	git-delete-remote-pane.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/git-delete-remote-pane.c b/plugins/git/git-delete-remote-pane.c
new file mode 100644
index 0000000..442393a
--- /dev/null
+++ b/plugins/git/git-delete-remote-pane.c
@@ -0,0 +1,51 @@
+/* -*- 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-delete-remote-pane.h"
+
+void
+on_delete_remote_button_clicked (GtkAction *action, Git *plugin)
+{
+	gchar *remote;
+	GitRemoteDeleteCommand *delete_remote_command;
+
+	remote = git_remotes_pane_get_selected_remote (GIT_REMOTES_PANE (plugin->remotes_pane));
+
+	if (remote)
+	{
+		delete_remote_command = git_remote_delete_command_new (plugin->project_root_directory,
+		                                                       remote);
+
+		g_free (remote);
+
+		g_signal_connect (G_OBJECT (delete_remote_command), "command-finished",
+		                  G_CALLBACK (git_pane_report_errors),
+		                  plugin);
+
+
+		g_signal_connect (G_OBJECT (delete_remote_command), "command-finished",
+		                  G_CALLBACK (g_object_unref),
+		                  NULL);
+
+		anjuta_command_start (ANJUTA_COMMAND (delete_remote_command));
+	}
+	else
+		anjuta_util_dialog_error (NULL, _("No remote selected."));
+}
+ 
\ No newline at end of file
diff --git a/plugins/git/git-delete-remote-pane.h b/plugins/git/git-delete-remote-pane.h
new file mode 100644
index 0000000..bf2956d
--- /dev/null
+++ b/plugins/git/git-delete-remote-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_DELETE_REMOTE_PANE_H_
+#define _GIT_DELETE_REMOTE_PANE_H_
+
+#include "git-remote-delete-command.h"
+#include "git-remotes-pane.h"
+
+void on_delete_remote_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 422bce0..b3dd4f9 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -37,6 +37,7 @@
 #include "git-unstage-pane.h"
 #include "git-diff-pane.h"
 #include "git-add-remote-pane.h"
+#include "git-delete-remote-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -171,6 +172,14 @@ AnjutaCommandBarEntry remotes_entries[] =
 	},
 	{
 		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"DeleteRemote",
+		N_("Delete selected remote"),
+		N_("Delete a remote"),
+		GTK_STOCK_DELETE,
+		G_CALLBACK (on_delete_remote_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
 		"Push",
 		N_("Push"),
 		N_("Push changes to a remote repository"),



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