From 161fcd1ec308625c93a6fef16c75f6e2b368d6db Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 12 May 2010 10:47:00 +0100 Subject: [PATCH] check adddialog entry fields kinda --- SparkleShare/SparkleHelpers.cs | 4 ++++ SparkleShare/SparkleWindow.cs | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/SparkleShare/SparkleHelpers.cs b/SparkleShare/SparkleHelpers.cs index adfed31f..8bd2e496 100644 --- a/SparkleShare/SparkleHelpers.cs +++ b/SparkleShare/SparkleHelpers.cs @@ -96,6 +96,10 @@ namespace SparkleShare { IconLookupFlags.GenericFallback); } + public static bool IsGitUrl (string Url) { + return false; + } + } } diff --git a/SparkleShare/SparkleWindow.cs b/SparkleShare/SparkleWindow.cs index 0a14dcf5..936b41fd 100644 --- a/SparkleShare/SparkleWindow.cs +++ b/SparkleShare/SparkleWindow.cs @@ -468,6 +468,8 @@ namespace SparkleShare { RemoteUrlExample.SetAlignment (0, 0); RemoteUrlLabel.Xalign = 1; + // NameEntry.Text; + HButtonBox ButtonBox = new HButtonBox (); ButtonBox.Layout = ButtonBoxStyle.End; ButtonBox.Spacing = 6; @@ -480,7 +482,17 @@ namespace SparkleShare { AddDialog.Destroy (); }; + AddButton.State = StateType.Insensitive; AddButton.Clicked += delegate { + RemoteUrlCombo.Entry.Changed += delegate { + if (SparkleHelpers.IsGitUrl (RemoteUrlCombo.Entry.Text)) + AddButton.State = StateType.Normal; + }; + + RemoteUrlCombo.Entry.Changed += delegate { + if (RemoteUrlCombo.Entry.Text.Length > 0) + AddButton.State = StateType.Normal; + }; AddDialog.Remove (AddDialog.Child); VBox Box = new VBox (false, 24);