[banshee] [GlobalUIActions] don't present the main window
- From: Aaron Bockover <abock src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [GlobalUIActions] don't present the main window
- Date: Mon, 5 Apr 2010 16:19:08 +0000 (UTC)
commit d2e434641553f15335c99c6f2e54f50a38633c80
Author: Aaron Bockover <abockover novell com>
Date: Mon Apr 5 12:12:20 2010 -0400
[GlobalUIActions] don't present the main window
When proxying the show dialog commands over DBus, ensure the main
window does not get shown. Also do not block the DBus invocations
and instead yield the call to the next main loop iteration.
src/Clients/Halie/Halie/Client.cs | 14 +++++++++++---
.../Banshee.Gui/GlobalActions.cs | 8 ++++----
2 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/Clients/Halie/Halie/Client.cs b/src/Clients/Halie/Halie/Client.cs
index 113e5a8..0039950 100644
--- a/src/Clients/Halie/Halie/Client.cs
+++ b/src/Clients/Halie/Halie/Client.cs
@@ -82,8 +82,10 @@ namespace Halie
command = DBusServiceManager.FindInstance<DBusCommandService> ("/DBusCommandService");
hide_field = ApplicationContext.CommandLine.Contains ("hide-field");
- bool present = HandlePlayerCommands () && !ApplicationContext.CommandLine.Contains ("indexer");
- HandleGlobalUIActions ();
+ bool present =
+ HandlePlayerCommands () &&
+ HandleGlobalUIActions () &&
+ !ApplicationContext.CommandLine.Contains ("indexer");
HandleWindowCommands (present);
HandleFiles ();
}
@@ -123,26 +125,32 @@ namespace Halie
}
}
- private static void HandleGlobalUIActions ()
+ private static bool HandleGlobalUIActions ()
{
var global_ui_actions = DBusServiceManager.FindInstance<IGlobalUIActions> ("/GlobalUIActions");
+ var handled = false;
if (ApplicationContext.CommandLine.Contains ("show-import-media")) {
global_ui_actions.ShowImportDialog ();
+ handled |= true;
}
if (ApplicationContext.CommandLine.Contains ("show-about")) {
global_ui_actions.ShowAboutDialog ();
+ handled |= true;
}
if (ApplicationContext.CommandLine.Contains ("show-preferences")) {
global_ui_actions.ShowPreferencesDialog ();
+ handled |= true;
}
if (ApplicationContext.CommandLine.Contains ("show-open-location")) {
global_ui_actions.ShowOpenLocationDialog ();
+ handled |= true;
}
+ return !handled;
}
private static bool HandlePlayerCommands ()
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/GlobalActions.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/GlobalActions.cs
index 6abeb3e..8a9f6c4 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/GlobalActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/GlobalActions.cs
@@ -249,22 +249,22 @@ namespace Banshee.Gui
void IGlobalUIActions.ShowImportDialog ()
{
- OnImport (null, null);
+ Gtk.Application.Invoke (OnImport);
}
void IGlobalUIActions.ShowAboutDialog ()
{
- OnAbout (null, null);
+ Gtk.Application.Invoke (OnAbout);
}
void IGlobalUIActions.ShowOpenLocationDialog ()
{
- OnOpenLocation (null, null);
+ Gtk.Application.Invoke (OnOpenLocation);
}
void IGlobalUIActions.ShowPreferencesDialog ()
{
- OnPreferences (null, null);
+ Gtk.Application.Invoke (OnPreferences);
}
IDBusExportable IDBusExportable.Parent {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]