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 |
} |