[anjuta] git: Add a dialog to delete tags



commit 2601d8f5f9bf03c94459b4dd73c8c3eca4c46f4f
Author: James Liggett <jrliggett cox net>
Date:   Tue Jul 7 22:46:57 2009 -0700

    git: Add a dialog to delete tags

 plugins/git/Makefile.am              |    8 ++-
 plugins/git/anjuta-git.ui            |  132 ++++++++++++++++++++++++++
 plugins/git/anjuta-git.xml           |    7 +-
 plugins/git/git-delete-tag-dialog.c  |  171 ++++++++++++++++++++++++++++++++++
 plugins/git/git-delete-tag-dialog.h  |   34 +++++++
 plugins/git/git-tag-delete-command.c |   96 +++++++++++++++++++
 plugins/git/git-tag-delete-command.h |   62 ++++++++++++
 plugins/git/git-tag-list-command.c   |   68 ++++++++++++++
 plugins/git/git-tag-list-command.h   |   58 ++++++++++++
 plugins/git/plugin.c                 |   17 ++++
 10 files changed, 651 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index 6f05cf0..7c26fa1 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -193,7 +193,13 @@ libanjuta_git_la_SOURCES = \
 	git-cherry-pick-command.c \
 	git-cherry-pick-command.h \
 	git-cherry-pick-dialog.c \
-	git-cherry-pick-dialog.h
+	git-cherry-pick-dialog.h \
+	git-delete-tag-dialog.c \
+	git-delete-tag-dialog.h \
+	git-tag-delete-command.c \
+	git-tag-delete-command.h \
+	git-tag-list-command.c \
+	git-tag-list-command.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/anjuta-git.ui b/plugins/git/anjuta-git.ui
index 333d54d..0b19b15 100644
--- a/plugins/git/anjuta-git.ui
+++ b/plugins/git/anjuta-git.ui
@@ -27,6 +27,14 @@
       <column type="gboolean"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="tag_list_model">
+    <columns>
+      <!-- column-name selected -->
+      <column type="gboolean"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="commit_dialog">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
     <property name="border_width">5</property>
@@ -4850,4 +4858,128 @@
       <action-widget response="-5">button37</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkDialog" id="delete_tag_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Delete Branch</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox40">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkFrame" id="frame51">
+            <property name="width_request">250</property>
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment51">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow9">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkTreeView" id="delete_tag_view">
+                        <property name="height_request">200</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="model">tag_list_model</property>
+                        <property name="headers_visible">False</property>
+                        <property name="headers_clickable">False</property>
+                        <property name="search_column">1</property>
+                        <child>
+                          <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+                            <property name="title">column</property>
+                            <child>
+                              <object class="GtkCellRendererToggle" id="delete_tag_selected_renderer"/>
+                              <attributes>
+                                <attribute name="active">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" id="treeviewcolumn6">
+                            <property name="title">column</property>
+                            <child>
+                              <object class="GtkCellRendererText" id="delete_tag_name_renderer"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label62">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Tags to delete:</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area41">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button38">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button39">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button38</action-widget>
+      <action-widget response="-5">button39</action-widget>
+    </action-widgets>
+  </object>
 </interface>
diff --git a/plugins/git/anjuta-git.xml b/plugins/git/anjuta-git.xml
index fc9b2cd..8e89261 100644
--- a/plugins/git/anjuta-git.xml
+++ b/plugins/git/anjuta-git.xml
@@ -58,7 +58,12 @@
   		  			</menu>
 				</placeholder>
 				<separator />
-				<menuitem name="Create tag..." action="ActionGitCreateTag" />
+				<placeholder name="PlaceholderTags">
+					<menu name="TagsMenu" action="ActionMenuGitTags">
+						<menuitem name="Create tag..." action="ActionGitCreateTag" />
+						<menuitem name="Delete tag..." action="ActionGitDeleteTag" />
+					</menu>
+				</placeholder>
 				<separator />
 				<menuitem name="Reset tree..." action="ActionGitReset" />
 				<menuitem name="Revert commit..." action="ActionGitRevert" />
diff --git a/plugins/git/git-delete-tag-dialog.c b/plugins/git/git-delete-tag-dialog.c
new file mode 100644
index 0000000..917b921
--- /dev/null
+++ b/plugins/git/git-delete-tag-dialog.c
@@ -0,0 +1,171 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#include "git-delete-tag-dialog.h"
+
+static void
+on_delete_command_finished (AnjutaCommand *command, guint return_code,
+							Git *plugin)
+{
+	AnjutaStatus *status;
+
+	if (return_code == 0)
+	{
+		status = anjuta_shell_get_status (ANJUTA_PLUGIN (plugin)->shell,
+										  NULL);
+		anjuta_status (status, _("Git: Deleted selected tages."), 5);
+	}
+	
+	git_report_errors (command, return_code);
+	
+	g_object_unref (command);
+}
+
+static void
+on_list_tag_command_data_arrived (AnjutaCommand *command,
+                                  GtkListStore *tag_list_model)
+{
+	GQueue *output_queue;
+	gchar *tag_name;
+	GtkTreeIter iter;
+	
+	output_queue = git_raw_output_command_get_output (GIT_RAW_OUTPUT_COMMAND (command));
+	
+	while (g_queue_peek_head (output_queue))
+	{
+		tag_name = g_queue_pop_head (output_queue);
+
+		gtk_list_store_append (tag_list_model, &iter);
+		gtk_list_store_set (tag_list_model, &iter, 1, tag_name, -1);
+		
+		g_free (tag_name);
+	}
+}
+
+static void
+on_delete_tag_dialog_response (GtkDialog *dialog, gint response_id, 
+								  GitUIData *data)
+{
+	GtkWidget *delete_tag_view;
+	GtkWidget *require_merged_check;
+	GtkTreeModel *tag_list_model;
+	GList *selected_tages;
+	GitTagDeleteCommand *delete_command;
+	
+	if (response_id == GTK_RESPONSE_OK)
+	{	
+		delete_tag_view = GTK_WIDGET (gtk_builder_get_object (data->bxml, 
+		                                                      "delete_tag_view"));
+		require_merged_check = GTK_WIDGET (gtk_builder_get_object (data->bxml,
+																   "require_merged_check"));
+		tag_list_model = GTK_TREE_MODEL (gtk_builder_get_object (data->bxml,
+		                                                         "tag_list_model"));
+
+		selected_tages = NULL;
+		gtk_tree_model_foreach (tag_list_model, 
+								(GtkTreeModelForeachFunc) git_get_selected_refs,
+								&selected_tages);
+		
+		delete_command = git_tag_delete_command_new (data->plugin->project_root_directory,
+													 selected_tages);
+		
+		git_command_free_string_list (selected_tages);
+		
+		git_create_message_view (data->plugin);
+		
+		g_signal_connect (G_OBJECT (delete_command), "command-finished",
+						  G_CALLBACK (on_delete_command_finished),
+						  data->plugin);
+		
+		g_signal_connect (G_OBJECT (delete_command), "data-arrived",
+						  G_CALLBACK (on_git_command_info_arrived),
+						  data->plugin);
+		
+		anjuta_command_start (ANJUTA_COMMAND (delete_command));
+	}
+	
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+	git_ui_data_free (data);
+}
+
+static void
+delete_tag_dialog (Git *plugin)
+{
+	GtkBuilder *bxml;
+	gchar *objects[] = {"delete_tag_dialog", "tag_list_model", NULL};
+	GError *error;
+	GtkWidget *dialog;
+	GtkWidget *delete_tag_view;
+	GtkListStore *tag_list_model;
+	GtkCellRenderer *delete_tag_selected_renderer;
+	GitUIData *data;
+	GitTagListCommand *list_command;
+	
+	bxml = gtk_builder_new ();
+	error = NULL;
+
+	if (!gtk_builder_add_objects_from_file (bxml, BUILDER_FILE, objects,
+	                                        &error))
+	{
+		g_warning ("Couldn't load builder file: %s", error->message);
+		g_error_free (error);
+	}
+	
+	dialog = GTK_WIDGET (gtk_builder_get_object (bxml, "delete_tag_dialog"));
+	delete_tag_view = GTK_WIDGET (gtk_builder_get_object (bxml, "delete_tag_view"));
+	tag_list_model = GTK_LIST_STORE (gtk_builder_get_object (bxml, 
+	                                                         "tag_list_model"));
+	delete_tag_selected_renderer = GTK_CELL_RENDERER (gtk_builder_get_object (bxml,
+																			  "delete_tag_selected_renderer")),
+	
+	data = git_ui_data_new (plugin, bxml);
+	                                     
+	list_command = git_tag_list_command_new (plugin->project_root_directory);
+	
+	g_signal_connect (G_OBJECT (list_command), "data-arrived", 
+					  G_CALLBACK (on_list_tag_command_data_arrived), 
+					  tag_list_model);
+	
+	g_signal_connect (G_OBJECT (list_command), "command-finished", 
+					  G_CALLBACK (on_git_command_finished), 
+					  NULL);
+	
+	anjuta_command_start (ANJUTA_COMMAND (list_command));
+	
+	g_signal_connect (G_OBJECT (dialog), "response", 
+					  G_CALLBACK (on_delete_tag_dialog_response), 
+					  data);
+
+	g_signal_connect (G_OBJECT (delete_tag_selected_renderer), "toggled",
+					  G_CALLBACK (on_git_selected_column_toggled),
+					  tag_list_model);
+	
+	gtk_widget_show_all (dialog);
+}
+
+void
+on_menu_git_delete_tag (GtkAction *action, Git *plugin)
+{
+	delete_tag_dialog (plugin);
+}
diff --git a/plugins/git/git-delete-tag-dialog.h b/plugins/git/git-delete-tag-dialog.h
new file mode 100644
index 0000000..3491a10
--- /dev/null
+++ b/plugins/git/git-delete-tag-dialog.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#ifndef _GIT_DELETE_TAG_DIALOG_H
+#define _GIT_DELETE_TAG_DIALOG_H
+
+#include "git-tag-list-command.h"
+#include "git-tag-delete-command.h"
+#include "git-ui-utils.h"
+
+void on_menu_git_delete_tag (GtkAction *action, Git *plugin);
+
+#endif
diff --git a/plugins/git/git-tag-delete-command.c b/plugins/git/git-tag-delete-command.c
new file mode 100644
index 0000000..f2bc522
--- /dev/null
+++ b/plugins/git/git-tag-delete-command.c
@@ -0,0 +1,96 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#include "git-tag-delete-command.h"
+
+struct _GitTagDeleteCommandPriv
+{
+	GList *tags;
+};
+
+G_DEFINE_TYPE (GitTagDeleteCommand, git_tag_delete_command, GIT_TYPE_COMMAND);
+
+static void
+git_tag_delete_command_init (GitTagDeleteCommand *self)
+{
+	self->priv = g_new0 (GitTagDeleteCommandPriv, 1);
+}
+
+static void
+git_tag_delete_command_finalize (GObject *object)
+{
+	GitTagDeleteCommand *self;
+	
+	self = GIT_TAG_DELETE_COMMAND (object);
+	
+	git_command_free_string_list (self->priv->tags);
+	g_free (self->priv);
+
+	G_OBJECT_CLASS (git_tag_delete_command_parent_class)->finalize (object);
+}
+
+static guint
+git_tag_delete_command_run (AnjutaCommand *command)
+{
+	GitTagDeleteCommand *self;
+	
+	self = GIT_TAG_DELETE_COMMAND (command);
+	
+	git_command_add_arg (GIT_COMMAND (command), "tag");
+	git_command_add_arg (GIT_COMMAND (command), "-d");
+	
+	git_command_add_list_to_args (GIT_COMMAND (command), self->priv->tags);
+	
+	return 0;
+}
+
+static void
+git_tag_delete_command_class_init (GitTagDeleteCommandClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+	GitCommandClass* parent_class = GIT_COMMAND_CLASS (klass);
+	AnjutaCommandClass* command_class = ANJUTA_COMMAND_CLASS (klass);
+
+	object_class->finalize = git_tag_delete_command_finalize;
+	parent_class->output_handler = git_command_send_output_to_info;
+	command_class->run = git_tag_delete_command_run;
+}
+
+
+GitTagDeleteCommand *
+git_tag_delete_command_new (const gchar *working_directory, 
+							GList *tags)
+{
+	GitTagDeleteCommand *self;
+	
+	self = g_object_new (GIT_TYPE_TAG_DELETE_COMMAND,
+						 "working-directory", working_directory,
+						 "single-line-output", TRUE,
+						 NULL);
+	
+	self->priv->tags = git_command_copy_string_list (tags);
+	
+	return self;
+}
+
diff --git a/plugins/git/git-tag-delete-command.h b/plugins/git/git-tag-delete-command.h
new file mode 100644
index 0000000..03026ef
--- /dev/null
+++ b/plugins/git/git-tag-delete-command.h
@@ -0,0 +1,62 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#ifndef _GIT_TAG_DELETE_COMMAND_H_
+#define _GIT_TAG_DELETE_COMMAND_H_
+
+#include <glib-object.h>
+#include "git-command.h"
+
+G_BEGIN_DECLS
+
+#define GIT_TYPE_TAG_DELETE_COMMAND             (git_tag_delete_command_get_type ())
+#define GIT_TAG_DELETE_COMMAND(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_TAG_DELETE_COMMAND, GitTagDeleteCommand))
+#define GIT_TAG_DELETE_COMMAND_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_TAG_DELETE_COMMAND, GitTagDeleteCommandClass))
+#define GIT_IS_TAG_DELETE_COMMAND(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_TAG_DELETE_COMMAND))
+#define GIT_IS_TAG_DELETE_COMMAND_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_TAG_DELETE_COMMAND))
+#define GIT_TAG_DELETE_COMMAND_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_TAG_DELETE_COMMAND, GitTagDeleteCommandClass))
+
+typedef struct _GitTagDeleteCommandClass GitTagDeleteCommandClass;
+typedef struct _GitTagDeleteCommand GitTagDeleteCommand;
+typedef struct _GitTagDeleteCommandPriv GitTagDeleteCommandPriv;
+
+struct _GitTagDeleteCommandClass
+{
+	GitCommandClass parent_class;
+};
+
+struct _GitTagDeleteCommand
+{
+	GitCommand parent_instance;
+	
+	GitTagDeleteCommandPriv *priv;
+};
+
+GType git_tag_delete_command_get_type (void) G_GNUC_CONST;
+GitTagDeleteCommand *git_tag_delete_command_new (const gchar *working_directory, 
+												 GList *tags);
+
+G_END_DECLS
+
+#endif /* _GIT_TAG_DELETE_COMMAND_H_ */
diff --git a/plugins/git/git-tag-list-command.c b/plugins/git/git-tag-list-command.c
new file mode 100644
index 0000000..75f1d32
--- /dev/null
+++ b/plugins/git/git-tag-list-command.c
@@ -0,0 +1,68 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#include "git-tag-list-command.h"
+
+G_DEFINE_TYPE (GitTagListCommand, git_tag_list_command, GIT_TYPE_RAW_OUTPUT_COMMAND);
+
+static void
+git_tag_list_command_init (GitTagListCommand *self)
+{
+
+}
+
+static void
+git_tag_list_command_finalize (GObject *object)
+{
+	G_OBJECT_CLASS (git_tag_list_command_parent_class)->finalize (object);
+}
+
+static guint
+git_tag_list_command_run (AnjutaCommand *command)
+{	
+	git_command_add_arg (GIT_COMMAND (command), "tag");
+	
+	return 0;
+}
+
+static void
+git_tag_list_command_class_init (GitTagListCommandClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+	AnjutaCommandClass *command_class = ANJUTA_COMMAND_CLASS (klass);
+
+	object_class->finalize = git_tag_list_command_finalize;
+	command_class->run = git_tag_list_command_run;
+}
+
+
+GitTagListCommand *
+git_tag_list_command_new (const gchar *working_directory)
+{
+	return g_object_new (GIT_TYPE_TAG_LIST_COMMAND, 
+						 "working-directory", working_directory,
+						 "single-line-output", TRUE,
+						 "strip-newlines", TRUE,
+						 NULL);
+}
diff --git a/plugins/git/git-tag-list-command.h b/plugins/git/git-tag-list-command.h
new file mode 100644
index 0000000..e74480a
--- /dev/null
+++ b/plugins/git/git-tag-list-command.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2008 <jrliggett cox net>
+ * 
+ * anjuta is free software.
+ * 
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * 
+ * anjuta 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 anjuta.  If not, write to:
+ * 	The Free Software Foundation, Inc.,
+ * 	51 Franklin Street, Fifth Floor
+ * 	Boston, MA  02110-1301, USA.
+ */
+
+#ifndef _GIT_TAG_LIST_COMMAND_H_
+#define _GIT_TAG_LIST_COMMAND_H_
+
+#include <glib-object.h>
+#include "git-raw-output-command.h"
+
+G_BEGIN_DECLS
+
+#define GIT_TYPE_TAG_LIST_COMMAND             (git_tag_list_command_get_type ())
+#define GIT_TAG_LIST_COMMAND(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_TAG_LIST_COMMAND, GitTagListCommand))
+#define GIT_TAG_LIST_COMMAND_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_TAG_LIST_COMMAND, GitTagListCommandClass))
+#define GIT_IS_TAG_LIST_COMMAND(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_TAG_LIST_COMMAND))
+#define GIT_IS_TAG_LIST_COMMAND_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_TAG_LIST_COMMAND))
+#define GIT_TAG_LIST_COMMAND_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_TAG_LIST_COMMAND, GitTagListCommandClass))
+
+typedef struct _GitTagListCommandClass GitTagListCommandClass;
+typedef struct _GitTagListCommand GitTagListCommand;
+
+struct _GitTagListCommandClass
+{
+	GitRawOutputCommandClass parent_class;
+};
+
+struct _GitTagListCommand
+{
+	GitRawOutputCommand parent_instance;
+};
+
+GType git_tag_list_command_get_type (void) G_GNUC_CONST;
+GitTagListCommand *git_tag_list_command_new (const gchar *working_directory);
+
+G_END_DECLS
+
+#endif /* _GIT_TAG_LIST_COMMAND_H_ */
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 083e11a..a338cb0 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -48,6 +48,7 @@
 #include "git-push-dialog.h"
 #include "git-apply-mailbox-dialog.h"
 #include "git-cherry-pick-dialog.h"
+#include "git-delete-tag-dialog.h"
 
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-git.xml"
 
@@ -320,6 +321,14 @@ static GtkActionEntry actions_git[] =
 		G_CALLBACK (on_menu_git_delete_remote)    /* action callback */
 	},
 	{
+		"ActionMenuGitTags",                       /* Action name */
+		NULL,                            /* Stock icon, if any */
+		N_("Tags"),                     /* Display label */
+		NULL,                                     /* short-cut */
+		NULL,                      /* Tooltip */
+		NULL    /* action callback */
+	},
+	{
 		"ActionGitCreateTag",                       /* Action name */
 		NULL,                            /* Stock icon, if any */
 		N_("_Create tag..."),                     /* Display label */
@@ -328,6 +337,14 @@ static GtkActionEntry actions_git[] =
 		G_CALLBACK (on_menu_git_create_tag)    /* action callback */
 	},
 	{
+		"ActionGitDeleteTag",                       /* Action name */
+		NULL,                            /* Stock icon, if any */
+		N_("_Delete tag..."),                     /* Display label */
+		NULL,                                     /* short-cut */
+		N_("Delete tags"),                      /* Tooltip */
+		G_CALLBACK (on_menu_git_delete_tag)    /* action callback */
+	},
+	{
 		"ActionGitReset",                       /* Action name */
 		GTK_STOCK_REFRESH,                            /* Stock icon, if any */
 		N_("_Reset tree..."),                     /* Display label */



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