View | Details | Raw Unified | Return to bug 21509
Collapse All | Expand All

(-)a/browser/base/content/nsContextMenu.js (-1 / +3 lines)
Lines 210-222 nsContextMenu.prototype = { Link Here
210
    // Set as Desktop background depends on whether an image was clicked on,
210
    // Set as Desktop background depends on whether an image was clicked on,
211
    // and only works if we have a shell service.
211
    // and only works if we have a shell service.
212
    var haveSetDesktopBackground = false;
212
    var haveSetDesktopBackground = false;
213
#ifdef HAVE_SHELL_SERVICE
213
#ifdef HAVE_SHELL_SERVICE
214
    // Only enable Set as Desktop Background if we can get the shell service.
214
    // Only enable Set as Desktop Background if we can get the shell service.
215
    var shell = getShellService();
215
    var shell = getShellService();
216
    if (shell)
216
    var env = Components.classes["@mozilla.org/process/environment;1"]
217
                        .getService(Components.interfaces.nsIEnvironment);
218
    if (shell && env.get('DESKTOP_SESSION') == "gnome")
217
      haveSetDesktopBackground = true;
219
      haveSetDesktopBackground = true;
218
#endif
220
#endif
219
    this.showItem("context-setDesktopBackground",
221
    this.showItem("context-setDesktopBackground",
220
                  haveSetDesktopBackground && this.onLoadedImage);
222
                  haveSetDesktopBackground && this.onLoadedImage);
221
223
222
    if (haveSetDesktopBackground && this.onLoadedImage) {
224
    if (haveSetDesktopBackground && this.onLoadedImage) {
(-)a/browser/components/preferences/advanced.js (-1 / +19 lines)
Lines 594-613 var gAdvancedPane = { Link Here
594
    var brandShortName = brandBundle.getString("brandShortName");
594
    var brandShortName = brandBundle.getString("brandShortName");
595
    var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
595
    var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
596
    var promptMessage;
596
    var promptMessage;
597
    const IPS = Components.interfaces.nsIPromptService;
597
    const IPS = Components.interfaces.nsIPromptService;
598
    var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
598
    var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
599
                         .getService(IPS);
599
                         .getService(IPS);
600
601
    var env = Components.classes["@mozilla.org/process/environment;1"]
602
                        .getService(Components.interfaces.nsIEnvironment);
603
    var kde_session = 0;
604
    if (env.get('KDE_FULL_SESSION') == "true")
605
      kde_session = 1;
606
     
600
    if (!shellSvc.isDefaultBrowser(false)) {
607
    if (!shellSvc.isDefaultBrowser(false)) {
601
      promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage", 
608
      promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage", 
602
                                                     [brandShortName]);
609
                                                     [brandShortName]);
603
      var rv = psvc.confirmEx(window, promptTitle, promptMessage, 
610
      var rv = psvc.confirmEx(window, promptTitle, promptMessage, 
604
                              IPS.STD_YES_NO_BUTTONS,
611
                              IPS.STD_YES_NO_BUTTONS,
605
                              null, null, null, null, { });
612
                              null, null, null, null, { });
606
      if (rv == 0)
613
      if (rv == 0) {
607
        shellSvc.setDefaultBrowser(true, false);
614
        shellSvc.setDefaultBrowser(true, false);
615
        if (kde_session == 1) {
616
          var shellObj = Components.classes["@mozilla.org/file/local;1"]
617
                                   .createInstance(Components.interfaces.nsILocalFile);
618
          shellObj.initWithPath("/usr/bin/kwriteconfig");
619
          var process = Components.classes["@mozilla.org/process/util;1"]
620
                                  .createInstance(Components.interfaces.nsIProcess);
621
          process.init(shellObj);
622
          var args = ["--file", "kdeglobals", "--group", "General", "--key", "BrowserApplication", "MozillaFirefox"];
623
          process.run(false, args, args.length);
624
        }
625
      }
608
    }
626
    }
609
    else {
627
    else {
610
      promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
628
      promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
611
                                                     [brandShortName]);
629
                                                     [brandShortName]);
612
      psvc.alert(window, promptTitle, promptMessage);
630
      psvc.alert(window, promptTitle, promptMessage);
613
    }
631
    }

Return to bug 21509