[anjuta] git: Add option to sign tags with the default GPG key



commit e244893fe87062a0fb4b948874100f718e6f0cee
Author: James Liggett <jrliggett cox net>
Date:   Tue May 19 14:01:23 2009 -0700

    git: Add option to sign tags with the default GPG key
---
 plugins/git/anjuta-git.ui            |   16 ++++++++++++++--
 plugins/git/git-create-tag-dialog.c  |    4 ++++
 plugins/git/git-tag-create-command.c |    8 +++++++-
 plugins/git/git-tag-create-command.h |    1 +
 4 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/plugins/git/anjuta-git.ui b/plugins/git/anjuta-git.ui
index 9da6dd3..4cfe743 100644
--- a/plugins/git/anjuta-git.ui
+++ b/plugins/git/anjuta-git.ui
@@ -2434,6 +2434,18 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkCheckButton" id="tag_sign_check">
+                        <property name="label" translatable="yes">Sign this tag</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkCheckButton" id="tag_annotate_check">
                         <property name="label" translatable="yes">Annotate this tag</property>
                         <property name="visible">True</property>
@@ -2442,7 +2454,7 @@
                         <property name="draw_indicator">True</property>
                       </object>
                       <packing>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                     <child>
@@ -2461,7 +2473,7 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="position">2</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                   </object>
diff --git a/plugins/git/git-create-tag-dialog.c b/plugins/git/git-create-tag-dialog.c
index 23f1080..9c7c247 100644
--- a/plugins/git/git-create-tag-dialog.c
+++ b/plugins/git/git-create-tag-dialog.c
@@ -62,6 +62,7 @@ on_create_tag_dialog_response (GtkDialog *dialog, gint response_id,
 	GtkWidget *tag_revision_radio;
 	GtkWidget *tag_revision_entry;
 	GtkWidget *tag_force_check;
+	GtkWidget *tag_sign_check;
 	GtkWidget *tag_annotate_check;
 	GtkWidget *tag_log_view;
 	gchar *log;
@@ -81,6 +82,8 @@ on_create_tag_dialog_response (GtkDialog *dialog, gint response_id,
 																 "tag_revision_entry"));
 		tag_force_check = GTK_WIDGET (gtk_builder_get_object (data->bxml,
 															  "tag_force_check"));
+		tag_sign_check = GTK_WIDGET (gtk_builder_get_object (data->bxml,
+		                                                     "tag_sign_check"));
 		tag_annotate_check = GTK_WIDGET (gtk_builder_get_object (data->bxml,
 																 "tag_annotate_check"));
 		tag_log_view = GTK_WIDGET (gtk_builder_get_object (data->bxml,
@@ -143,6 +146,7 @@ on_create_tag_dialog_response (GtkDialog *dialog, gint response_id,
 													 tag_name,
 													 revision,
 													 log,
+		                                             gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tag_sign_check)),
 													 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tag_force_check)));
 		
 		g_free (tag_name);
diff --git a/plugins/git/git-tag-create-command.c b/plugins/git/git-tag-create-command.c
index bf80fc7..e1d6206 100644
--- a/plugins/git/git-tag-create-command.c
+++ b/plugins/git/git-tag-create-command.c
@@ -29,6 +29,7 @@ struct _GitTagCreateCommandPriv
 	gchar *name;
 	gchar *revision;
 	gchar *log;
+	gboolean sign;
 	gboolean force;
 };
 
@@ -70,6 +71,9 @@ git_tag_create_command_run (AnjutaCommand *command)
 		git_command_add_arg (GIT_COMMAND (command), "-m");
 		git_command_add_arg (GIT_COMMAND (command), self->priv->log);
 	}
+
+	if (self->priv->sign)
+		git_command_add_arg (GIT_COMMAND (command), "-s");
 	
 	if (self->priv->force)
 		git_command_add_arg (GIT_COMMAND (command), "-f");
@@ -98,7 +102,8 @@ git_tag_create_command_class_init (GitTagCreateCommandClass *klass)
 GitTagCreateCommand *
 git_tag_create_command_new (const gchar *working_directory, 
 							const gchar *name, const gchar *revision,
-							const gchar *log, gboolean force)
+							const gchar *log, 
+                            gboolean sign, gboolean force)
 {
 	GitTagCreateCommand *self;
 	
@@ -110,6 +115,7 @@ git_tag_create_command_new (const gchar *working_directory,
 	self->priv->name = g_strdup (name);
 	self->priv->revision = g_strdup (revision);
 	self->priv->log = g_strdup (log);
+	self->priv->sign = sign;
 	self->priv->force = force;
 	
 	return self;
diff --git a/plugins/git/git-tag-create-command.h b/plugins/git/git-tag-create-command.h
index 07da51e..361e5d7 100644
--- a/plugins/git/git-tag-create-command.h
+++ b/plugins/git/git-tag-create-command.h
@@ -58,6 +58,7 @@ GitTagCreateCommand *git_tag_create_command_new (const gchar *working_directory,
 												 const gchar *name,
 												 const gchar *revision, 
 												 const gchar *log,
+                                                 gboolean sign,
 												 gboolean force);
 gchar *git_tag_create_command_get_tag_name (GitTagCreateCommand *self);
 



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