From f45f92afdbad7b69cece0c9946eac03a3023a609548f063705c37ee45459601f Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 21 Aug 2009 15:38:41 +0000 Subject: [PATCH] Accepting request 18344 from mozilla:Factory Copy from mozilla:Factory/MozillaFirefox based on submit request 18344 from user wrosenauer OBS-URL: https://build.opensuse.org/request/show/18344 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/MozillaFirefox?expand=0&rev=66 --- MozillaFirefox.changes | 9 +++++ MozillaFirefox.spec | 4 +- firefox-contextmenu-gnome.patch | 26 ------------- firefox-cross-desktop.patch | 69 +++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 28 deletions(-) delete mode 100644 firefox-contextmenu-gnome.patch create mode 100644 firefox-cross-desktop.patch diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index 3cdb969..ace63da 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Aug 19 22:14:07 CEST 2009 - wr@rosenauer.org + +- renamed patch firefox-contextmenu-gnome to firefox-cross-desktop + as it contains more tweaks to handle non-Gnome environments and + especially KDE integration: + * added the ability to set the KDE default browser + (still part of bnc#170055) + ------------------------------------------------------------------- Sat Aug 8 00:14:18 CEST 2009 - wr@rosenauer.org diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 9516256..f2b8c56 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -29,7 +29,7 @@ License: GPL v2 or later ; LGPL v2.1 or later ; MPL 1.1 or later Provides: web_browser Provides: firefox Version: 3.5.2 -Release: 2 +Release: 3 Summary: Mozilla Firefox Web Browser Url: http://www.mozilla.org/ Group: Productivity/Networking/Web/Browsers @@ -49,7 +49,7 @@ Patch2: firefox-no-update.patch Patch3: toolkit-download-folder.patch Patch4: mozilla-linkorder.patch Patch5: firefox-bug506901.patch -Patch6: firefox-contextmenu-gnome.patch +Patch6: firefox-cross-desktop.patch Patch14: credits.patch Patch17: firefox-appname.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/firefox-contextmenu-gnome.patch b/firefox-contextmenu-gnome.patch deleted file mode 100644 index 6f99a5e..0000000 --- a/firefox-contextmenu-gnome.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Wolfgang Rosenauer -Subject: Some context menu items are really confusing if not running in Gnome -References: -https://bugzilla.novell.com/show_bug.cgi?id=170055 - - -diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js ---- a/browser/base/content/nsContextMenu.js -+++ b/browser/base/content/nsContextMenu.js -@@ -210,13 +210,15 @@ nsContextMenu.prototype = { - // Set as Desktop background depends on whether an image was clicked on, - // and only works if we have a shell service. - var haveSetDesktopBackground = false; - #ifdef HAVE_SHELL_SERVICE - // Only enable Set as Desktop Background if we can get the shell service. - var shell = getShellService(); -- if (shell) -+ var env = Components.classes["@mozilla.org/process/environment;1"] -+ .getService(Components.interfaces.nsIEnvironment); -+ if (shell && env.get('DESKTOP_SESSION') == "gnome") - haveSetDesktopBackground = true; - #endif - this.showItem("context-setDesktopBackground", - haveSetDesktopBackground && this.onLoadedImage); - - if (haveSetDesktopBackground && this.onLoadedImage) { diff --git a/firefox-cross-desktop.patch b/firefox-cross-desktop.patch new file mode 100644 index 0000000..4b7b9e7 --- /dev/null +++ b/firefox-cross-desktop.patch @@ -0,0 +1,69 @@ +From: Wolfgang Rosenauer +Subject: NonGnome/KDE integration +References: +https://bugzilla.novell.com/show_bug.cgi?id=170055 +Caveats: desktop file name of Firefox is hardcoded to MozillaFirefox + +diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js +--- a/browser/base/content/nsContextMenu.js ++++ b/browser/base/content/nsContextMenu.js +@@ -210,13 +210,15 @@ nsContextMenu.prototype = { + // Set as Desktop background depends on whether an image was clicked on, + // and only works if we have a shell service. + var haveSetDesktopBackground = false; + #ifdef HAVE_SHELL_SERVICE + // Only enable Set as Desktop Background if we can get the shell service. + var shell = getShellService(); +- if (shell) ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ if (shell && env.get('DESKTOP_SESSION') == "gnome") + haveSetDesktopBackground = true; + #endif + this.showItem("context-setDesktopBackground", + haveSetDesktopBackground && this.onLoadedImage); + + if (haveSetDesktopBackground && this.onLoadedImage) { +diff --git a/browser/components/preferences/advanced.js b/browser/components/preferences/advanced.js +--- a/browser/components/preferences/advanced.js ++++ b/browser/components/preferences/advanced.js +@@ -594,20 +594,38 @@ var gAdvancedPane = { + var brandShortName = brandBundle.getString("brandShortName"); + var promptTitle = shellBundle.getString("setDefaultBrowserTitle"); + var promptMessage; + const IPS = Components.interfaces.nsIPromptService; + var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(IPS); ++ ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ var kde_session = 0; ++ if (env.get('KDE_FULL_SESSION') == "true") ++ kde_session = 1; ++ + if (!shellSvc.isDefaultBrowser(false)) { + promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage", + [brandShortName]); + var rv = psvc.confirmEx(window, promptTitle, promptMessage, + IPS.STD_YES_NO_BUTTONS, + null, null, null, null, { }); +- if (rv == 0) ++ if (rv == 0) { + shellSvc.setDefaultBrowser(true, false); ++ if (kde_session == 1) { ++ var shellObj = Components.classes["@mozilla.org/file/local;1"] ++ .createInstance(Components.interfaces.nsILocalFile); ++ shellObj.initWithPath("/usr/bin/kwriteconfig"); ++ var process = Components.classes["@mozilla.org/process/util;1"] ++ .createInstance(Components.interfaces.nsIProcess); ++ process.init(shellObj); ++ var args = ["--file", "kdeglobals", "--group", "General", "--key", "BrowserApplication", "MozillaFirefox"]; ++ process.run(false, args, args.length); ++ } ++ } + } + else { + promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser", + [brandShortName]); + psvc.alert(window, promptTitle, promptMessage); + }