[banshee] Muinshee: Don't close the dialog when pressing Enqueue (bgo#557882)
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Muinshee: Don't close the dialog when pressing Enqueue (bgo#557882)
- Date: Sun, 23 Oct 2011 17:26:26 +0000 (UTC)
commit fa11fa11f775da301790ee2a619d4acf6edbc6d4
Author: Adam Lofts <Adam Lofts gmail com>
Date: Thu Oct 20 16:48:39 2011 +0100
Muinshee: Don't close the dialog when pressing Enqueue (bgo#557882)
Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>
src/Clients/Muinshee/Muinshee/BaseDialog.cs | 24 ++++++++++++---------
src/Clients/Muinshee/Muinshee/MuinsheeActions.cs | 4 +-
2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/src/Clients/Muinshee/Muinshee/BaseDialog.cs b/src/Clients/Muinshee/Muinshee/BaseDialog.cs
index bb36cb9..261ae86 100644
--- a/src/Clients/Muinshee/Muinshee/BaseDialog.cs
+++ b/src/Clients/Muinshee/Muinshee/BaseDialog.cs
@@ -102,20 +102,24 @@ namespace Muinshee
window_controller = new PersistentWindowController (this, String.Format ("muinshee.{0}", addType), 500, 475, WindowPersistOptions.Size);
window_controller.Restore ();
ShowAll ();
+
+ Response += OnResponse;
}
- public void TryRun ()
+ private void OnResponse (object o, ResponseArgs args)
{
- try {
- var response = Run ();
- if (response == ResponseType.Apply) {
- Queue ();
- } else if (response == ResponseType.Ok) {
- Play ();
- }
- } finally {
- Destroy ();
+ ResponseType response = args.ResponseId;
+
+ if (response == ResponseType.Apply) {
+ Queue ();
+ return;
}
+
+ if (response == ResponseType.Ok) {
+ Play ();
+ }
+
+ Destroy ();
}
private void OnFilterChanged (object o, EventArgs args)
diff --git a/src/Clients/Muinshee/Muinshee/MuinsheeActions.cs b/src/Clients/Muinshee/Muinshee/MuinsheeActions.cs
index 59fb318..aff9332 100644
--- a/src/Clients/Muinshee/Muinshee/MuinsheeActions.cs
+++ b/src/Clients/Muinshee/Muinshee/MuinsheeActions.cs
@@ -65,12 +65,12 @@ namespace Muinshee
private void OnPlaySong (object sender, EventArgs args)
{
- new SongDialog (queue).TryRun ();
+ new SongDialog (queue).Show ();
}
private void OnPlayAlbum (object sender, EventArgs args)
{
- new AlbumDialog (queue).TryRun ();
+ new AlbumDialog (queue).Show ();
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]