mozilla-kde.patch
branchfirefox52
changeset 944 ce8a98f8d8d7
parent 942 66115255ad6f
child 952 8094e6bba260
child 957 b28ad21f195e
equal deleted inserted replaced
943:ace605efe50f 944:ce8a98f8d8d7
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  0e88a32ef7263e76f6970bab17458130d1f3677f
     2 # Parent  5c8ae59424f5318bf7a387257771bf95d3893063
     3 Description: Add KDE integration to Firefox (toolkit parts)
     3 Description: Add KDE integration to Firefox (toolkit parts)
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     5 Author: Lubos Lunak <lunak@suse.com>
     5 Author: Lubos Lunak <lunak@suse.com>
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
  2198 +#    PrefWindow IV  (April 24, 2000)
  2198 +#    PrefWindow IV  (April 24, 2000)
  2199 +#    PrefWindow III (January 6, 2000)
  2199 +#    PrefWindow III (January 6, 2000)
  2200 +#    PrefWindow II  (???)
  2200 +#    PrefWindow II  (???)
  2201 +#    PrefWindow I   (June 4, 1999)
  2201 +#    PrefWindow I   (June 4, 1999)
  2202 +#
  2202 +#
       
  2203 diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
       
  2204 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
       
  2205 +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
       
  2206 @@ -627,17 +627,17 @@ nsUnknownContentTypeDialog.prototype = {
       
  2207        else
       
  2208          typeString = mimeInfo.MIMEType;
       
  2209      }
       
  2210      // When the length is unknown, contentLength would be -1
       
  2211      if (this.mLauncher.contentLength >= 0) {
       
  2212        let [size, unit] = DownloadUtils.
       
  2213                           convertByteUnits(this.mLauncher.contentLength);
       
  2214        type.value = this.dialogElement("strings")
       
  2215 -                       .getFormattedString("orderedFileSizeWithType", 
       
  2216 +                       .getFormattedString("orderedFileSizeWithType",
       
  2217                                             [typeString, size, unit]);
       
  2218      }
       
  2219      else {
       
  2220        type.value = typeString;
       
  2221      }
       
  2222    },
       
  2223  
       
  2224    // Returns true if opening the default application makes sense.
       
  2225 @@ -801,17 +801,17 @@ nsUnknownContentTypeDialog.prototype = {
       
  2226        switch (this.dialogElement("openHandler").selectedIndex) {
       
  2227        case 0:
       
  2228          // No app need be specified in this case.
       
  2229          ok = true;
       
  2230          break;
       
  2231        case 1:
       
  2232          // only enable the OK button if we have a default app to use or if
       
  2233          // the user chose an app....
       
  2234 -        ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path")); 
       
  2235 +        ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
       
  2236          break;
       
  2237        }
       
  2238      }
       
  2239  
       
  2240      // Enable Ok button if ok to press.
       
  2241      this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
       
  2242    },
       
  2243  
       
  2244 @@ -1068,30 +1068,56 @@ nsUnknownContentTypeDialog.prototype = {
       
  2245            params.handlerApp.executable &&
       
  2246            params.handlerApp.executable.isFile()) {
       
  2247          // Remember the file they chose to run.
       
  2248          this.chosenApp = params.handlerApp;
       
  2249        }
       
  2250      }
       
  2251      else {
       
  2252  #if MOZ_WIDGET_GTK == 3
       
  2253 -      var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
       
  2254 -      var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
       
  2255 -                                 .createInstance(nsIApplicationChooser);
       
  2256 -      appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
       
  2257 -      var contentTypeDialogObj = this;
       
  2258 -      let appChooserCallback = function appChooserCallback_done(aResult) {
       
  2259 -        if (aResult) {
       
  2260 -           contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
       
  2261 +      // handle the KDE case which is implemented in the filepicker
       
  2262 +      // therefore falling back to Gtk2 like behaviour if KDE is running
       
  2263 +      // FIXME this should be better handled in the nsIApplicationChooser interface
       
  2264 +      var env = Components.classes["@mozilla.org/process/environment;1"]
       
  2265 +                          .getService(Components.interfaces.nsIEnvironment);
       
  2266 +      if (env.get('KDE_FULL_SESSION') == "true")
       
  2267 +      {
       
  2268 +        var nsIFilePicker = Components.interfaces.nsIFilePicker;
       
  2269 +        var fp = Components.classes["@mozilla.org/filepicker;1"]
       
  2270 +                           .createInstance(nsIFilePicker);
       
  2271 +        fp.init(this.mDialog,
       
  2272 +                this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
       
  2273 +                nsIFilePicker.modeOpen);
       
  2274 +
       
  2275 +        fp.appendFilters(nsIFilePicker.filterApps);
       
  2276 +
       
  2277 +        if (fp.show() == nsIFilePicker.returnOK && fp.file) {
       
  2278 +          // Remember the file they chose to run.
       
  2279 +          var localHandlerApp =
       
  2280 +            Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
       
  2281 +                       createInstance(Components.interfaces.nsILocalHandlerApp);
       
  2282 +          localHandlerApp.executable = fp.file;
       
  2283 +          this.chosenApp = localHandlerApp;
       
  2284          }
       
  2285 -        contentTypeDialogObj.finishChooseApp();
       
  2286 -      };
       
  2287 -      appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
       
  2288 -      // The finishChooseApp is called from appChooserCallback
       
  2289 -      return;
       
  2290 +      } else {
       
  2291 +        var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
       
  2292 +        var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
       
  2293 +                                   .createInstance(nsIApplicationChooser);
       
  2294 +        appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
       
  2295 +        var contentTypeDialogObj = this;
       
  2296 +        let appChooserCallback = function appChooserCallback_done(aResult) {
       
  2297 +          if (aResult) {
       
  2298 +             contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
       
  2299 +          }
       
  2300 +          contentTypeDialogObj.finishChooseApp();
       
  2301 +        };
       
  2302 +        appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
       
  2303 +        // The finishChooseApp is called from appChooserCallback
       
  2304 +        return;
       
  2305 +      }
       
  2306  #else
       
  2307        var nsIFilePicker = Components.interfaces.nsIFilePicker;
       
  2308        var fp = Components.classes["@mozilla.org/filepicker;1"]
       
  2309                           .createInstance(nsIFilePicker);
       
  2310        fp.init(this.mDialog,
       
  2311                this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
       
  2312                nsIFilePicker.modeOpen);
       
  2313  
  2203 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2314 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2204 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2315 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2205 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2316 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
  2206 @@ -15,16 +15,17 @@
  2317 @@ -15,16 +15,17 @@
  2207  #include "nsPrintfCString.h"
  2318  #include "nsPrintfCString.h"
  3694  if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
  3805  if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
  3695      CXXFLAGS += CONFIG['TK_CFLAGS']
  3806      CXXFLAGS += CONFIG['TK_CFLAGS']
  3696 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3807 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3697 --- a/xpcom/io/nsLocalFileUnix.cpp
  3808 --- a/xpcom/io/nsLocalFileUnix.cpp
  3698 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3809 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3699 @@ -45,16 +45,17 @@
  3810 @@ -46,16 +46,17 @@
  3700  #include "prproces.h"
  3811  #include "prproces.h"
  3701  #include "nsIDirectoryEnumerator.h"
  3812  #include "nsIDirectoryEnumerator.h"
  3702  #include "nsISimpleEnumerator.h"
  3813  #include "nsISimpleEnumerator.h"
  3703  #include "private/pprio.h"
  3814  #include "private/pprio.h"
  3704  #include "prlink.h"
  3815  #include "prlink.h"
  3712  #include <Carbon/Carbon.h>
  3823  #include <Carbon/Carbon.h>
  3713  #include "CocoaFileUtils.h"
  3824  #include "CocoaFileUtils.h"
  3714  #include "prmem.h"
  3825  #include "prmem.h"
  3715  #include "plbase64.h"
  3826  #include "plbase64.h"
  3716  
  3827  
  3717 @@ -1947,42 +1948,52 @@ nsLocalFile::SetPersistentDescriptor(con
  3828 @@ -1948,42 +1949,52 @@ nsLocalFile::SetPersistentDescriptor(con
  3718    return InitWithNativePath(aPersistentDescriptor);
  3829    return InitWithNativePath(aPersistentDescriptor);
  3719  #endif
  3830  #endif
  3720  }
  3831  }
  3721  
  3832  
  3722  NS_IMETHODIMP
  3833  NS_IMETHODIMP
  3771      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3882      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3772      ::CFRelease(url);
  3883      ::CFRelease(url);
  3773      return rv;
  3884      return rv;
  3774    }
  3885    }
  3775    return NS_ERROR_FAILURE;
  3886    return NS_ERROR_FAILURE;
  3776 @@ -1990,16 +2001,22 @@ nsLocalFile::Reveal()
  3887 @@ -1991,16 +2002,22 @@ nsLocalFile::Reveal()
  3777    return NS_ERROR_FAILURE;
  3888    return NS_ERROR_FAILURE;
  3778  #endif
  3889  #endif
  3779  }
  3890  }
  3780  
  3891  
  3781  NS_IMETHODIMP
  3892  NS_IMETHODIMP