[banshee/stable-1.6] [GlobalUIActions] don't present the main window
- From: Aaron Bockover <abock src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/stable-1.6] [GlobalUIActions] don't present the main window
- Date: Wed, 14 Apr 2010 02:29:09 +0000 (UTC)
commit 3042e3d8d8f459787865560b9ecd53c2314ea1dd
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]