[banshee] [BansheeDialog] override Dialog.Run for nicer API



commit cb70e01e1dfc9ca9386be88c6ac85765780d21a6
Author: Aaron Bockover <abockover novell com>
Date:   Sat Feb 6 14:46:25 2010 -0500

    [BansheeDialog] override Dialog.Run for nicer API
    
    Gtk#'s Dialog.Run returns int when it should return ResponseType, so
    provide a new Run method that returns the base.Run method's int as a
    ResponseType.
    
    Fix the Muinshee usage of this API as well.

 src/Clients/Muinshee/Muinshee/BaseDialog.cs        |    6 +++---
 .../Banshee.Gui.Dialogs/BansheeDialog.cs           |    5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/Clients/Muinshee/Muinshee/BaseDialog.cs b/src/Clients/Muinshee/Muinshee/BaseDialog.cs
index b7b2817..e48e7c0 100644
--- a/src/Clients/Muinshee/Muinshee/BaseDialog.cs
+++ b/src/Clients/Muinshee/Muinshee/BaseDialog.cs
@@ -94,10 +94,10 @@ namespace Muinshee
         public void TryRun ()
         {
             try {
-                int response = Run ();
-                if (response == (int)ResponseType.Apply) {
+                var response = Run ();
+                if (response == ResponseType.Apply) {
                     Queue ();
-                } else if (response == (int)ResponseType.Ok) {
+                } else if (response == ResponseType.Ok) {
                     Play ();
                 }
             } finally {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
index e6e28bc..b1291f3 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
@@ -68,6 +68,11 @@ namespace Banshee.Gui.Dialogs
             AddAccelGroup (accel_group);
         }
 
+        public new ResponseType Run ()
+        {
+            return (ResponseType)base.Run ();
+        }
+
         public Button AddDefaultCloseButton ()
         {
             return AddStockButton (Stock.Close, ResponseType.Close);



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