[anjuta/git-shell: 60/61] git: Implement the Resolve Conflicts pane



commit 5049fd3b060a71c7fa2347cab64a383e8081aed5
Author: James Liggett <jrliggett cox net>
Date:   Thu Jul 15 14:04:36 2010 -0700

    git: Implement the Resolve Conflicts pane

 plugins/git/Makefile.am                  |    4 ++-
 plugins/git/git-resolve-conflicts-pane.c |   52 ++++++++++++++++++++++++++++++
 plugins/git/git-resolve-conflicts-pane.h |   28 ++++++++++++++++
 plugins/git/plugin.c                     |   10 +++++-
 4 files changed, 92 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index 99cafcd..bd22acb 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -193,7 +193,9 @@ libanjuta_git_la_SOURCES = \
 	git-delete-remote-pane.c \
 	git-delete-remote-pane.h \
 	git-fetch-pane.c \
-	git-fetch-pane.h
+	git-fetch-pane.h \
+	git-resolve-conflicts-pane.c \
+	git-resolve-conflicts-pane.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/git-resolve-conflicts-pane.c b/plugins/git/git-resolve-conflicts-pane.c
new file mode 100644
index 0000000..73528c0
--- /dev/null
+++ b/plugins/git/git-resolve-conflicts-pane.c
@@ -0,0 +1,52 @@
+/* -*- 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-resolve-conflicts-pane.h"
+
+void
+on_resolve_conflicts_button_clicked (GtkAction *action, Git *plugin)
+{
+	GList *paths;
+	GitAddCommand *add_command;
+
+	paths = git_status_pane_get_all_selected_items (GIT_STATUS_PANE (plugin->status_pane),
+	                                                ANJUTA_VCS_STATUS_CONFLICTED);
+
+	if (paths)
+	{
+		add_command = git_add_command_new_list (plugin->project_root_directory,
+		                                        paths, FALSE);
+
+		git_command_free_string_list (paths);
+
+		g_signal_connect (G_OBJECT (add_command), "command-finished",
+		                  G_CALLBACK (git_pane_report_errors),
+		                  plugin);
+
+
+		g_signal_connect (G_OBJECT (add_command), "command-finished",
+		                  G_CALLBACK (g_object_unref),
+		                  NULL);
+
+		anjuta_command_start (ANJUTA_COMMAND (add_command));
+	}
+	else
+		anjuta_util_dialog_error (NULL, _("No conflicted files selected."));
+}
+ 
\ No newline at end of file
diff --git a/plugins/git/git-resolve-conflicts-pane.h b/plugins/git/git-resolve-conflicts-pane.h
new file mode 100644
index 0000000..0585688
--- /dev/null
+++ b/plugins/git/git-resolve-conflicts-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_RESOLVE_CONFLICTS_PANE_H_
+#define _GIT_RESOLVE_CONFLICTS_PANE_H_
+
+#include "git-add-command.h"
+#include "git-status-pane.h"
+
+void on_resolve_conflicts_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 dc1057e..ab1185f 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -39,6 +39,7 @@
 #include "git-add-remote-pane.h"
 #include "git-delete-remote-pane.h"
 #include "git-fetch-pane.h"
+#include "git-resolve-conflicts-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -149,8 +150,15 @@ AnjutaCommandBarEntry status_entries[] =
 		N_("Remove staged files from the index"),
 		GTK_STOCK_CANCEL,
 		G_CALLBACK (on_unstage_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"ResolveConflicts",
+		N_("Resolve conflicts"),
+		N_("Mark selected conflicted files as resolved"),
+		GTK_STOCK_PREFERENCES,
+		G_CALLBACK (on_resolve_conflicts_button_clicked)
 	}
-	
 };
 
 AnjutaCommandBarEntry remotes_entries[] =



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