[anjuta/git-shell: 5/12] git: Check input in the create branch pane



commit 59f3d8984a56bd83c639da6741f8394b5d2fb54f
Author: James Liggett <jrliggett cox net>
Date:   Thu Jun 10 17:05:49 2010 -0700

    git: Check input in the create branch pane
    
    That should be the last of them. Input checking should now be standard on all
    new dialog panes from now on.

 plugins/git/git-create-branch-pane.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/plugins/git/git-create-branch-pane.c b/plugins/git/git-create-branch-pane.c
index 49c8d4a..76c30ed 100644
--- a/plugins/git/git-create-branch-pane.c
+++ b/plugins/git/git-create-branch-pane.c
@@ -50,10 +50,29 @@ on_ok_button_clicked (GtkButton *button, GitCreateBranchPane *self)
 	name = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1);
 	revision = NULL;
 
+	if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
+	                           GTK_WIDGET (name_entry), name,
+	                           _("Please enter a branch name.")))
+	{
+		g_free (name);
+
+		return;
+	}
+
 	if (gtk_toggle_button_get_active (revision_radio))
 	{
 		revision = gtk_editable_get_chars (GTK_EDITABLE (revision_entry), 0, 
 		                                   -1);
+
+		if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
+		                           GTK_WIDGET (revision_entry), revision,
+		                           _("Please enter a revision.")))
+		{
+			g_free (name);
+			g_free (revision);
+
+			return;
+		}
 	}
 
 	create_command = git_branch_create_command_new (plugin->project_root_directory,



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