[blam] AddChannelDialog: make OK button sensitive when url comes from the clipboard



commit 40297efd5e5b5df10a3ca6eb8c6831117b8eaecf
Author: Carlos Martín Nieto <cmn dwim me>
Date:   Sat Jun 15 22:45:38 2013 +0200

    AddChannelDialog: make OK button sensitive when url comes from the clipboard
    
    The button needs to be sensitive if the text comes from the the
    clipboard as well, instead of only when the user types something.

 src/AddChannelDialog.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/AddChannelDialog.cs b/src/AddChannelDialog.cs
index 961ed4b..48bdb26 100644
--- a/src/AddChannelDialog.cs
+++ b/src/AddChannelDialog.cs
@@ -6,6 +6,11 @@ namespace Imendio.Blam
 {
     public partial class AddChannelDialog : Gtk.Dialog
     {
+               bool OkSensitive()
+               {
+                       return !string.IsNullOrEmpty(Url);
+               }
+
         public AddChannelDialog(Gtk.Window window)
         {
             this.Build();
@@ -20,11 +25,12 @@ namespace Imendio.Blam
                 }
             });
 
+            buttonOk.Sensitive = OkSensitive();
             UrlEntry.Activated += OnEntryActivated;
             UsernameEntry.Activated += OnEntryActivated;
             PasswordEntry.Activated += OnEntryActivated;
 
-            UrlEntry.Changed += (sender, e) => buttonOk.Sensitive = !String.IsNullOrEmpty(Url);
+            UrlEntry.Changed += (sender, e) => buttonOk.Sensitive = OkSensitive();
         }
 
         public string Username {


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