firefox-kde.patch
changeset 779 354c672efefa
parent 766 e0b23b7851e9
child 784 50b18808abdc
equal deleted inserted replaced
778:9483ff78d5a0 779:354c672efefa
  1261                  default="true"
  1261                  default="true"
  1262                  oncommand="StarUI.panel.hidePopup();"/>
  1262                  oncommand="StarUI.panel.hidePopup();"/>
  1263          <button id="editBookmarkPanelDeleteButton"
  1263          <button id="editBookmarkPanelDeleteButton"
  1264                  class="editBookmarkPanelBottomButton"
  1264                  class="editBookmarkPanelBottomButton"
  1265                  label="&editBookmark.cancel.label;"
  1265                  label="&editBookmark.cancel.label;"
  1266 @@ -1164,17 +1164,17 @@
  1266 @@ -1150,17 +1150,17 @@
  1267  
  1267  
  1268    <hbox id="full-screen-warning-container" hidden="true" fadeout="true">
  1268    <hbox id="full-screen-warning-container" hidden="true" fadeout="true">
  1269      <hbox style="width: 100%;" pack="center"> <!-- Inner hbox needed due to bug 579776. -->
  1269      <hbox style="width: 100%;" pack="center"> <!-- Inner hbox needed due to bug 579776. -->
  1270        <vbox id="full-screen-warning-message" align="center">
  1270        <vbox id="full-screen-warning-message" align="center">
  1271          <description id="full-screen-domain-text"/>
  1271          <description id="full-screen-domain-text"/>
  1297 +*       content/browser/browser-kde.xul               (content/browser-kde.xul)
  1297 +*       content/browser/browser-kde.xul               (content/browser-kde.xul)
  1298 +%       override chrome://browser/content/browser.xul chrome://browser/content/browser-kde.xul desktop=kde
  1298 +%       override chrome://browser/content/browser.xul chrome://browser/content/browser-kde.xul desktop=kde
  1299  *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
  1299  *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
  1300  *       content/browser/chatWindow.xul                (content/chatWindow.xul)
  1300  *       content/browser/chatWindow.xul                (content/chatWindow.xul)
  1301          content/browser/content.js                    (content/content.js)
  1301          content/browser/content.js                    (content/content.js)
  1302          content/browser/newtab/newTab.xul             (content/newtab/newTab.xul)
  1302          content/browser/defaultthemes/1.footer.jpg    (content/defaultthemes/1.footer.jpg)
  1303  *       content/browser/newtab/newTab.js              (content/newtab/newTab.js)
  1303          content/browser/defaultthemes/1.header.jpg    (content/defaultthemes/1.header.jpg)
  1304          content/browser/newtab/newTab.css             (content/newtab/newTab.css)
  1304          content/browser/defaultthemes/1.icon.jpg      (content/defaultthemes/1.icon.jpg)
  1305  *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
  1305          content/browser/defaultthemes/1.preview.jpg   (content/defaultthemes/1.preview.jpg)
  1306          content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
  1306          content/browser/defaultthemes/2.footer.jpg    (content/defaultthemes/2.footer.jpg)
  1307 diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp
  1307 diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp
  1308 --- a/browser/components/build/nsModule.cpp
  1308 --- a/browser/components/build/nsModule.cpp
  1309 +++ b/browser/components/build/nsModule.cpp
  1309 +++ b/browser/components/build/nsModule.cpp
  1310 @@ -8,17 +8,17 @@
  1310 @@ -8,17 +8,17 @@
  1311  #include "nsBrowserCompsCID.h"
  1311  #include "nsBrowserCompsCID.h"
  1362  #if defined(XP_WIN)
  1362  #if defined(XP_WIN)
  1363      { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
  1363      { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
  1364  #elif defined(XP_MACOSX)
  1364  #elif defined(XP_MACOSX)
  1365      { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
  1365      { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
  1366  #endif
  1366  #endif
  1367 diff --git a/browser/components/preferences/advanced.js b/browser/components/preferences/advanced.js
  1367 diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
  1368 --- a/browser/components/preferences/advanced.js
  1368 --- a/browser/components/preferences/main.js
  1369 +++ b/browser/components/preferences/advanced.js
  1369 +++ b/browser/components/preferences/main.js
  1370 @@ -25,16 +25,22 @@ var gAdvancedPane = {
  1370 @@ -12,16 +12,22 @@ var gMainPane = {
  1371      if (extraArgs && extraArgs["advancedTab"]){
  1371  
  1372        advancedPrefs.selectedTab = document.getElementById(extraArgs["advancedTab"]);
  1372    /**
  1373      } else {
  1373     * Initialization of this.
  1374        var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
  1374     */
  1375        if (preference.value !== null)
  1375    init: function ()
  1376          advancedPrefs.selectedIndex = preference.value;
  1376    {
  1377      }
  1377      this._pane = document.getElementById("paneMain");
  1378  
  1378  
  1379 +    var env = Components.classes["@mozilla.org/process/environment;1"]
  1379 +    var env = Components.classes["@mozilla.org/process/environment;1"]
  1380 +                        .getService(Components.interfaces.nsIEnvironment);
  1380 +                        .getService(Components.interfaces.nsIEnvironment);
  1381 +    var kde_session = 0;
  1381 +    var kde_session = 0;
  1382 +    if (env.get('KDE_FULL_SESSION') == "true")
  1382 +    if (env.get('KDE_FULL_SESSION') == "true")
  1388      // In Windows 8 we launch the control panel since it's the only
  1388      // In Windows 8 we launch the control panel since it's the only
  1389      // way to get all file type association prefs. So we don't know
  1389      // way to get all file type association prefs. So we don't know
  1390      // when the user will select the default.  We refresh here periodically
  1390      // when the user will select the default.  We refresh here periodically
  1391      // in case the default changes.  On other Windows OS's defaults can also
  1391      // in case the default changes.  On other Windows OS's defaults can also
  1392      // be set while the prefs are open.
  1392      // be set while the prefs are open.
  1393 @@ -889,14 +895,25 @@ var gAdvancedPane = {
  1393 @@ -497,16 +503,27 @@ var gMainPane = {
  1394     * Set browser as the operating system default browser.
       
  1395     */
  1394     */
  1396    setDefaultBrowser: function()
  1395    setDefaultBrowser: function()
  1397    {
  1396    {
  1398      let shellSvc = getShellService();
  1397      let shellSvc = getShellService();
  1399      if (!shellSvc)
  1398      if (!shellSvc)
  1400        return;
  1399        return;
  1401      shellSvc.setDefaultBrowser(true, false);
  1400      try {
  1402 +    if (kde_session == 1) {
  1401        shellSvc.setDefaultBrowser(true, false);
  1403 +      var shellObj = Components.classes["@mozilla.org/file/local;1"]
  1402 +      if (kde_session == 1) {
  1404 +                               .createInstance(Components.interfaces.nsILocalFile);
  1403 +        var shellObj = Components.classes["@mozilla.org/file/local;1"]
  1405 +      shellObj.initWithPath("/usr/bin/kwriteconfig");
  1404 +                                 .createInstance(Components.interfaces.nsILocalFile);
  1406 +      var process = Components.classes["@mozilla.org/process/util;1"]
  1405 +        shellObj.initWithPath("/usr/bin/kwriteconfig");
  1407 +                              .createInstance(Components.interfaces.nsIProcess);
  1406 +        var process = Components.classes["@mozilla.org/process/util;1"]
  1408 +      process.init(shellObj);
  1407 +                                .createInstance(Components.interfaces.nsIProcess);
  1409 +      var args = ["--file", "kdeglobals", "--group", "General", "--key",
  1408 +        process.init(shellObj);
  1410 +          "BrowserApplication", "MozillaFirefox"];
  1409 +        var args = ["--file", "kdeglobals", "--group", "General", "--key",
  1411 +      process.run(false, args, args.length);
  1410 +            "BrowserApplication", "MozillaFirefox"];
  1412 +    }
  1411 +        process.run(false, args, args.length);
       
  1412 +      }
       
  1413      } catch (ex) {
       
  1414        Components.utils.reportError(ex);
       
  1415        return;
       
  1416      }
  1413      let selectedIndex =
  1417      let selectedIndex =
  1414        shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
  1418        shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
  1415      document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
  1419      document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
  1416    }
  1420    }
  1417  #endif
  1421 diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build
  1418  };
  1422 --- a/browser/components/shell/moz.build
  1419 diff --git a/browser/components/shell/src/Makefile.in b/browser/components/shell/src/Makefile.in
  1423 +++ b/browser/components/shell/moz.build
  1420 --- a/browser/components/shell/src/Makefile.in
  1424 @@ -30,16 +30,18 @@ if CONFIG['OS_ARCH'] == 'WINNT':
  1421 +++ b/browser/components/shell/src/Makefile.in
       
  1422 @@ -2,10 +2,12 @@
       
  1423  # This Source Code Form is subject to the terms of the Mozilla Public
       
  1424  # License, v. 2.0. If a copy of the MPL was not distributed with this
       
  1425  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
       
  1426  
       
  1427  include $(topsrcdir)/config/rules.mk
       
  1428  
       
  1429  CXXFLAGS += $(TK_CFLAGS)
       
  1430  
       
  1431 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
       
  1432 +
       
  1433  clobber::
       
  1434  	rm -f $(DIST)/lib/$(LIBRARY_NAME).lib
       
  1435 diff --git a/browser/components/shell/src/moz.build b/browser/components/shell/src/moz.build
       
  1436 --- a/browser/components/shell/src/moz.build
       
  1437 +++ b/browser/components/shell/src/moz.build
       
  1438 @@ -10,16 +10,18 @@ if CONFIG['OS_ARCH'] == 'WINNT':
       
  1439      ]
  1425      ]
  1440  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
  1426  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
  1441      SOURCES += [
  1427      SOURCES += [
  1442          'nsMacShellService.cpp',
  1428          'nsMacShellService.cpp',
  1443      ]
  1429      ]
  1452      FINAL_LIBRARY = 'browsercomps'
  1438      FINAL_LIBRARY = 'browsercomps'
  1453  
  1439  
  1454  EXTRA_COMPONENTS += [
  1440  EXTRA_COMPONENTS += [
  1455      'nsSetDefaultBrowser.js',
  1441      'nsSetDefaultBrowser.js',
  1456      'nsSetDefaultBrowser.manifest',
  1442      'nsSetDefaultBrowser.manifest',
  1457 diff --git a/browser/components/shell/src/nsKDEShellService.cpp b/browser/components/shell/src/nsKDEShellService.cpp
  1443 diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp
  1458 new file mode 100644
  1444 new file mode 100644
  1459 --- /dev/null
  1445 --- /dev/null
  1460 +++ b/browser/components/shell/src/nsKDEShellService.cpp
  1446 +++ b/browser/components/shell/nsKDEShellService.cpp
  1461 @@ -0,0 +1,238 @@
  1447 @@ -0,0 +1,238 @@
  1462 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1448 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1463 +/* This Source Code Form is subject to the terms of the Mozilla Public
  1449 +/* This Source Code Form is subject to the terms of the Mozilla Public
  1464 + * License, v. 2.0. If a copy of the MPL was not distributed with this
  1450 + * License, v. 2.0. If a copy of the MPL was not distributed with this
  1465 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  1451 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  1695 +        return NS_ERROR_FAILURE;
  1681 +        return NS_ERROR_FAILURE;
  1696 +
  1682 +
  1697 +    NS_ADDREF(*_retval = defaultReader);
  1683 +    NS_ADDREF(*_retval = defaultReader);
  1698 +    return NS_OK;
  1684 +    return NS_OK;
  1699 +}
  1685 +}
  1700 diff --git a/browser/components/shell/src/nsKDEShellService.h b/browser/components/shell/src/nsKDEShellService.h
  1686 diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h
  1701 new file mode 100644
  1687 new file mode 100644
  1702 --- /dev/null
  1688 --- /dev/null
  1703 +++ b/browser/components/shell/src/nsKDEShellService.h
  1689 +++ b/browser/components/shell/nsKDEShellService.h
  1704 @@ -0,0 +1,60 @@
  1690 @@ -0,0 +1,60 @@
  1705 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1691 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1706 +/* ***** BEGIN LICENSE BLOCK *****
  1692 +/* ***** BEGIN LICENSE BLOCK *****
  1707 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1693 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1708 + *
  1694 + *
  1760 +
  1746 +
  1761 +  bool mCheckedThisSession;
  1747 +  bool mCheckedThisSession;
  1762 +};
  1748 +};
  1763 +
  1749 +
  1764 +#endif // nskdeshellservice_h____
  1750 +#endif // nskdeshellservice_h____
  1765 diff --git a/browser/components/shell/src/nsUnixShellService.cpp b/browser/components/shell/src/nsUnixShellService.cpp
  1751 diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp
  1766 new file mode 100644
  1752 new file mode 100644
  1767 --- /dev/null
  1753 --- /dev/null
  1768 +++ b/browser/components/shell/src/nsUnixShellService.cpp
  1754 +++ b/browser/components/shell/nsUnixShellService.cpp
  1769 @@ -0,0 +1,52 @@
  1755 @@ -0,0 +1,52 @@
  1770 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1756 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1771 +/* ***** BEGIN LICENSE BLOCK *****
  1757 +/* ***** BEGIN LICENSE BLOCK *****
  1772 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1758 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1773 + *
  1759 + *
  1817 +{
  1803 +{
  1818 +    if( nsKDEUtils::kdeSupport())
  1804 +    if( nsKDEUtils::kdeSupport())
  1819 +        return nsKDEShellServiceConstructor( aOuter, aIID, aResult );
  1805 +        return nsKDEShellServiceConstructor( aOuter, aIID, aResult );
  1820 +    return nsGNOMEShellServiceConstructor( aOuter, aIID, aResult );
  1806 +    return nsGNOMEShellServiceConstructor( aOuter, aIID, aResult );
  1821 +}
  1807 +}
  1822 diff --git a/browser/components/shell/src/nsUnixShellService.h b/browser/components/shell/src/nsUnixShellService.h
  1808 diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h
  1823 new file mode 100644
  1809 new file mode 100644
  1824 --- /dev/null
  1810 --- /dev/null
  1825 +++ b/browser/components/shell/src/nsUnixShellService.h
  1811 +++ b/browser/components/shell/nsUnixShellService.h
  1826 @@ -0,0 +1,45 @@
  1812 @@ -0,0 +1,45 @@
  1827 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1813 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  1828 +/* ***** BEGIN LICENSE BLOCK *****
  1814 +/* ***** BEGIN LICENSE BLOCK *****
  1829 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1815 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  1830 + *
  1816 + *
  1870 +
  1856 +
  1871 +#endif // nsunixshellservice_h____
  1857 +#endif // nsunixshellservice_h____
  1872 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
  1858 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
  1873 --- a/browser/installer/package-manifest.in
  1859 --- a/browser/installer/package-manifest.in
  1874 +++ b/browser/installer/package-manifest.in
  1860 +++ b/browser/installer/package-manifest.in
  1875 @@ -658,19 +658,21 @@
  1861 @@ -685,19 +685,21 @@
  1876  @BINPATH@/defaults/autoconfig/prefcalls.js
  1862  @BINPATH@/defaults/autoconfig/prefcalls.js
  1877  @BINPATH@/browser/defaults/profile/prefs.js
  1863  @BINPATH@/browser/defaults/profile/prefs.js
  1878  
  1864  
  1879  #ifndef LIBXUL_SDK
  1865  #ifndef LIBXUL_SDK
  1880  ; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
  1866  ; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)