/[packages]/updates/5/firefox/current/SOURCES/mozilla-kde.patch
ViewVC logotype

Diff of /updates/5/firefox/current/SOURCES/mozilla-kde.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1097033 by lmenut, Wed Sep 7 20:02:01 2016 UTC revision 1097034 by neoclust, Fri Apr 21 23:33:37 2017 UTC
# Line 1  Line 1 
1  # HG changeset patch  # HG changeset patch
2  # Parent  797d5f17b080f54439602f107ecaf6b09a0ef5c1  # Parent  5f1979729aa3c6bc50f7097202991e73be677e5e
3  Description: Add KDE integration to Firefox (toolkit parts)  Description: Add KDE integration to Firefox (toolkit parts)
4  Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>  Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
5  Author: Lubos Lunak <lunak@suse.com>  Author: Lubos Lunak <lunak@suse.com>
# Line 9  Bug: https://bugzilla.mozilla.org/show_b Line 9  Bug: https://bugzilla.mozilla.org/show_b
9  diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp  diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
10  --- a/modules/libpref/Preferences.cpp  --- a/modules/libpref/Preferences.cpp
11  +++ b/modules/libpref/Preferences.cpp  +++ b/modules/libpref/Preferences.cpp
12  @@ -30,16 +30,17 @@  @@ -31,16 +31,17 @@
13   #include "nsIZipReader.h"   #include "nsIZipReader.h"
14   #include "nsPrefBranch.h"   #include "nsPrefBranch.h"
15   #include "nsXPIDLString.h"   #include "nsXPIDLString.h"
# Line 27  diff --git a/modules/libpref/Preferences Line 27  diff --git a/modules/libpref/Preferences
27   #include "prefread.h"   #include "prefread.h"
28   #include "prefapi_private_data.h"   #include "prefapi_private_data.h"
29    
30  @@ -1136,16 +1137,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char  @@ -1174,16 +1175,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
31    
32   static nsresult pref_LoadPrefsInDirList(const char *listId)   static nsresult pref_LoadPrefsInDirList(const char *listId)
33   {   {
# Line 62  diff --git a/modules/libpref/Preferences Line 62  diff --git a/modules/libpref/Preferences
62       return NS_OK;       return NS_OK;
63    
64     bool hasMore;     bool hasMore;
65  @@ -1161,17 +1180,17 @@ static nsresult pref_LoadPrefsInDirList(  @@ -1199,17 +1218,17 @@ static nsresult pref_LoadPrefsInDirList(
66    
67       nsAutoCString leaf;       nsAutoCString leaf;
68       path->GetNativeLeafName(leaf);       path->GetNativeLeafName(leaf);
# Line 81  diff --git a/modules/libpref/Preferences Line 81  diff --git a/modules/libpref/Preferences
81   {   {
82     nsZipItemPtr<char> manifest(jarReader, name, true);     nsZipItemPtr<char> manifest(jarReader, name, true);
83     NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);     NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
84  @@ -1265,26 +1284,38 @@ static nsresult pref_InitInitialObjects(  @@ -1303,24 +1322,36 @@ static nsresult pref_InitInitialObjects(
85     /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */     /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
86     static const char* specialFiles[] = {     static const char* specialFiles[] = {
87   #if defined(XP_MACOSX)   #if defined(XP_MACOSX)
# Line 91  diff --git a/modules/libpref/Preferences Line 91  diff --git a/modules/libpref/Preferences
91   #elif defined(XP_UNIX)   #elif defined(XP_UNIX)
92       "unix.js"       "unix.js"
93  +    , "" // placeholder for KDE  (empty is otherwise harmless)  +    , "" // placeholder for KDE  (empty is otherwise harmless)
94   #if defined(VMS)   #if defined(_AIX)
      , "openvms.js"  
  #elif defined(_AIX)  
95       , "aix.js"       , "aix.js"
96   #endif   #endif
97   #elif defined(XP_BEOS)   #elif defined(XP_BEOS)
# Line 143  diff --git a/modules/libpref/moz.build b Line 141  diff --git a/modules/libpref/moz.build b
141   DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']   DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
142   DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']   DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
143    
144   if CONFIG['GNU_CXX']:   FINAL_TARGET_PP_FILES += [
145  diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py  diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
146  --- a/python/mozbuild/mozpack/chrome/flags.py  --- a/python/mozbuild/mozpack/chrome/flags.py
147  +++ b/python/mozbuild/mozpack/chrome/flags.py  +++ b/python/mozbuild/mozpack/chrome/flags.py
# Line 189  diff --git a/python/mozbuild/mozpack/chr Line 187  diff --git a/python/mozbuild/mozpack/chr
187  diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build  diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
188  --- a/toolkit/components/downloads/moz.build  --- a/toolkit/components/downloads/moz.build
189  +++ b/toolkit/components/downloads/moz.build  +++ b/toolkit/components/downloads/moz.build
190  @@ -65,15 +65,16 @@ if not CONFIG['MOZ_SUITE']:  @@ -57,16 +57,17 @@ if not CONFIG['MOZ_SUITE']:
          'nsDownloadManagerUI.js',  
191           'nsDownloadManagerUI.manifest',           'nsDownloadManagerUI.manifest',
192       ]       ]
193    
# Line 198  diff --git a/toolkit/components/download Line 195  diff --git a/toolkit/components/download
195    
196   LOCAL_INCLUDES += [   LOCAL_INCLUDES += [
197       '../protobuf',       '../protobuf',
198  -    '/ipc/chromium/src'       '/ipc/chromium/src',
199  +    '/ipc/chromium/src',  +    '/toolkit/xre',
200  +    '/toolkit/xre'       'chromium'
201   ]   ]
202    
203   DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True   DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
204   DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True   DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
205    
206   CXXFLAGS += CONFIG['TK_CFLAGS']   CXXFLAGS += CONFIG['TK_CFLAGS']
207    
208  diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp  diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
209  --- a/toolkit/components/downloads/nsDownloadManager.cpp  --- a/toolkit/components/downloads/nsDownloadManager.cpp
210  +++ b/toolkit/components/downloads/nsDownloadManager.cpp  +++ b/toolkit/components/downloads/nsDownloadManager.cpp
211  @@ -51,16 +51,20 @@  @@ -52,16 +52,20 @@
212   #ifdef XP_WIN   #ifdef XP_WIN
213   #include <shlobj.h>   #include <shlobj.h>
214   #include "nsWindowsHelpers.h"   #include "nsWindowsHelpers.h"
# Line 228  diff --git a/toolkit/components/download Line 226  diff --git a/toolkit/components/download
226   #endif   #endif
227    
228   #ifdef MOZ_WIDGET_ANDROID   #ifdef MOZ_WIDGET_ANDROID
229   #include "AndroidBridge.h"   #include "FennecJNIWrappers.h"
230   #endif   #endif
231    
232  @@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat  @@ -2723,16 +2727,25 @@ nsDownload::SetState(DownloadState aStat
233         nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));         nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
234    
235         // Master pref to control this function.         // Master pref to control this function.
# Line 257  diff --git a/toolkit/components/download Line 255  diff --git a/toolkit/components/download
255           int64_t goat = PR_Now() - mStartTime;           int64_t goat = PR_Now() - mStartTime;
256           showTaskbarAlert = goat > alertIntervalUSec;           showTaskbarAlert = goat > alertIntervalUSec;
257    
258  @@ -2759,16 +2772,17 @@ nsDownload::SetState(DownloadState aStat  @@ -2764,16 +2777,17 @@ nsDownload::SetState(DownloadState aStat
                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,  
259                     message, !removeWhenDone,                     message, !removeWhenDone,
260                     mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),                     mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
261                     mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),                     mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
262                     EmptyString(), EmptyString(), nullptr, mPrivate);                     EmptyString(), EmptyString(), nullptr, mPrivate,
263                       false /* requireInteraction */);
264               }               }
265           }           }
266         }         }
# Line 278  diff --git a/toolkit/components/download Line 276  diff --git a/toolkit/components/download
276  diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn  diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
277  --- a/toolkit/content/jar.mn  --- a/toolkit/content/jar.mn
278  +++ b/toolkit/content/jar.mn  +++ b/toolkit/content/jar.mn
279  @@ -64,29 +64,33 @@ toolkit.jar:  @@ -70,29 +70,33 @@ toolkit.jar:
     content/global/viewZoomOverlay.js  
  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)  
     content/global/bindings/browser.xml         (widgets/browser.xml)  
280      content/global/bindings/button.xml          (widgets/button.xml)      content/global/bindings/button.xml          (widgets/button.xml)
281      content/global/bindings/checkbox.xml        (widgets/checkbox.xml)      content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
282      content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)      content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
283      content/global/bindings/datetimepicker.xml  (widgets/datetimepicker.xml)      content/global/bindings/datetimepicker.xml  (widgets/datetimepicker.xml)
284   *+ content/global/bindings/dialog.xml          (widgets/dialog.xml)      content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
285  +*+ content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)      content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
286        content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
287     *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
288    +*  content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)
289  +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde  +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
290      content/global/bindings/editor.xml          (widgets/editor.xml)      content/global/bindings/editor.xml          (widgets/editor.xml)
291      content/global/bindings/expander.xml        (widgets/expander.xml)      content/global/bindings/expander.xml        (widgets/expander.xml)
292   *  content/global/bindings/filefield.xml       (widgets/filefield.xml)      content/global/bindings/filefield.xml       (widgets/filefield.xml)
293   *+ content/global/bindings/findbar.xml         (widgets/findbar.xml)   *  content/global/bindings/findbar.xml         (widgets/findbar.xml)
294      content/global/bindings/general.xml         (widgets/general.xml)      content/global/bindings/general.xml         (widgets/general.xml)
295      content/global/bindings/groupbox.xml        (widgets/groupbox.xml)      content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
296   *+ content/global/bindings/listbox.xml         (widgets/listbox.xml)      content/global/bindings/listbox.xml         (widgets/listbox.xml)
297      content/global/bindings/menu.xml            (widgets/menu.xml)      content/global/bindings/menu.xml            (widgets/menu.xml)
298      content/global/bindings/menulist.xml        (widgets/menulist.xml)      content/global/bindings/menulist.xml        (widgets/menulist.xml)
299      content/global/bindings/notification.xml    (widgets/notification.xml)      content/global/bindings/notification.xml    (widgets/notification.xml)
300      content/global/bindings/numberbox.xml       (widgets/numberbox.xml)      content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
301      content/global/bindings/popup.xml           (widgets/popup.xml)      content/global/bindings/popup.xml           (widgets/popup.xml)
302   *+ content/global/bindings/preferences.xml     (widgets/preferences.xml)   *  content/global/bindings/preferences.xml     (widgets/preferences.xml)
303  +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)  +*  content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
304  +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde  +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
305      content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)      content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
306      content/global/bindings/radio.xml           (widgets/radio.xml)      content/global/bindings/radio.xml           (widgets/radio.xml)
# Line 316  diff --git a/toolkit/content/widgets/dia Line 314  diff --git a/toolkit/content/widgets/dia
314  new file mode 100644  new file mode 100644
315  --- /dev/null  --- /dev/null
316  +++ b/toolkit/content/widgets/dialog-kde.xml  +++ b/toolkit/content/widgets/dialog-kde.xml
317  @@ -0,0 +1,460 @@  @@ -0,0 +1,457 @@
318  +<?xml version="1.0"?>  +<?xml version="1.0"?>
319  +<!-- This Source Code Form is subject to the terms of the Mozilla Public  +<!-- This Source Code Form is subject to the terms of the Mozilla Public
320  +   - License, v. 2.0. If a copy of the MPL was not distributed with this  +   - License, v. 2.0. If a copy of the MPL was not distributed with this
# Line 327  new file mode 100644 Line 325  new file mode 100644
325  +          xmlns="http://www.mozilla.org/xbl"  +          xmlns="http://www.mozilla.org/xbl"
326  +          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"  +          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
327  +          xmlns:xbl="http://www.mozilla.org/xbl">  +          xmlns:xbl="http://www.mozilla.org/xbl">
328  +    +
329  +  <binding id="dialog" extends="chrome://global/content/bindings/general.xml#root-element">  +  <binding id="dialog" extends="chrome://global/content/bindings/general.xml#root-element">
330  +    <resources>  +    <resources>
331  +      <stylesheet src="chrome://global/skin/dialog.css"/>  +      <stylesheet src="chrome://global/skin/dialog.css"/>
# Line 336  new file mode 100644 Line 334  new file mode 100644
334  +      <xul:vbox class="box-inherit dialog-content-box" flex="1">  +      <xul:vbox class="box-inherit dialog-content-box" flex="1">
335  +        <children/>  +        <children/>
336  +      </xul:vbox>  +      </xul:vbox>
337  +            +
338  +      <xul:hbox class="dialog-button-box" anonid="buttons"  +      <xul:hbox class="dialog-button-box" anonid="buttons"
339  +                xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"  +                xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"
340  +#ifdef XP_UNIX_GNOME  +#ifdef XP_UNIX_GNOME
# Line 350  new file mode 100644 Line 348  new file mode 100644
348  +        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>  +        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
349  +#elif XP_UNIX  +#elif XP_UNIX
350  +                >  +                >
351  +       <xul:button dlgtype="help" class="dialog-button" hidden="true"/>  +        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
352  +       <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>  +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
353  +       <xul:spacer anonid="spacer" flex="1"/>  +        <xul:spacer anonid="spacer" flex="1"/>
354  +       <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>  +        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
355  +       <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>  +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
356  +       <xul:button dlgtype="cancel" class="dialog-button"/>  +        <xul:button dlgtype="cancel" class="dialog-button"/>
357  +       <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>  +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
358  +#else  +#else
359  +                pack="end">  +                pack="end">
360  +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>  +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
# Line 386  new file mode 100644 Line 384  new file mode 100644
384  +        <![CDATA[  +        <![CDATA[
385  +          if (this.hasAttribute("defaultButton"))  +          if (this.hasAttribute("defaultButton"))
386  +            return this.getAttribute("defaultButton");  +            return this.getAttribute("defaultButton");
387  +          else // default to the accept button  +          return "accept";  // default to the accept button
 +            return "accept";  
388  +        ]]>  +        ]]>
389  +        </getter>  +        </getter>
390  +        <setter>  +        <setter>
# Line 405  new file mode 100644 Line 402  new file mode 100644
402  +        ]]>  +        ]]>
403  +        </body>  +        </body>
404  +      </method>  +      </method>
405  +        +
406  +      <method name="cancelDialog">  +      <method name="cancelDialog">
407  +        <body>  +        <body>
408  +        <![CDATA[  +        <![CDATA[
# Line 413  new file mode 100644 Line 410  new file mode 100644
410  +        ]]>  +        ]]>
411  +        </body>  +        </body>
412  +      </method>  +      </method>
413  +        +
414  +      <method name="getButton">  +      <method name="getButton">
415  +        <parameter name="aDlgType"/>  +        <parameter name="aDlgType"/>
416  +        <body>  +        <body>
# Line 463  new file mode 100644 Line 460  new file mode 100644
460  +        <body>  +        <body>
461  +        <![CDATA[  +        <![CDATA[
462  +          var xOffset = screen.availWidth/2 - window.outerWidth/2;  +          var xOffset = screen.availWidth/2 - window.outerWidth/2;
463  +          var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10;  +          var yOffset = screen.availHeight/2 - window.outerHeight/2;
464  +    +
465  +          xOffset = xOffset > 0 ? xOffset : 0;  +          xOffset = xOffset > 0 ? xOffset : 0;
466  +          yOffset = yOffset > 0 ? yOffset : 0;  +          yOffset = yOffset > 0 ? yOffset : 0;
467  +          window.moveTo(xOffset, yOffset);  +          window.moveTo(xOffset, yOffset);
# Line 516  new file mode 100644 Line 513  new file mode 100644
513  +                    initialFocusedElt.focus();  +                    initialFocusedElt.focus();
514  +                  }  +                  }
515  +                }  +                }
516  +#ifndef XP_MACOSX  +                else if (!/Mac/.test(navigator.platform) &&
517  +                else if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {  +                         focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
518  +                  defaultButton.focus();  +                  defaultButton.focus();
519  +                }  +                }
 +#endif  
520  +              }  +              }
521  +            }  +            }
522  +  +
# Line 534  new file mode 100644 Line 530  new file mode 100644
530  +          setTimeout(focusInit, 0);  +          setTimeout(focusInit, 0);
531  +        ]]>  +        ]]>
532  +        </body>  +        </body>
533  +      </method>                  +      </method>
534  +  +
535  +      <property name="mStrBundle">  +      <property name="mStrBundle">
536  +        <getter>  +        <getter>
# Line 549  new file mode 100644 Line 545  new file mode 100644
545  +          return this._mStrBundle;  +          return this._mStrBundle;
546  +        ]]></getter>  +        ]]></getter>
547  +      </property>  +      </property>
548  +        +
549  +      <method name="_configureButtons">  +      <method name="_configureButtons">
550  +        <parameter name="aButtons"/>  +        <parameter name="aButtons"/>
551  +        <body>  +        <body>
# Line 602  new file mode 100644 Line 598  new file mode 100644
598  +              else  +              else
599  +                switch (dlgtype) {  +                switch (dlgtype) {
600  +                  case "accept":  +                  case "accept":
601  +                    button.setAttribute("icon","accept");  +                    button.setAttribute("icon", "accept");
602  +                    break;  +                    break;
603  +                  case "cancel":  +                  case "cancel":
604  +                    button.setAttribute("icon","cancel");  +                    button.setAttribute("icon", "cancel");
605  +                    break;  +                    break;
606  +                  case "disclosure":  +                  case "disclosure":
607  +                    button.setAttribute("icon","properties");  +                    button.setAttribute("icon", "properties");
608  +                    break;  +                    break;
609  +                  case "help":  +                  case "help":
610  +                    button.setAttribute("icon","help");  +                    button.setAttribute("icon", "help");
611  +                    break;  +                    break;
612  +                  default:  +                  default:
613  +                    break;  +                    break;
# Line 621  new file mode 100644 Line 617  new file mode 100644
617  +  +
618  +          // ensure that hitting enter triggers the default button command  +          // ensure that hitting enter triggers the default button command
619  +          this.defaultButton = this.defaultButton;  +          this.defaultButton = this.defaultButton;
620  +            +
621  +          // if there is a special button configuration, use it  +          // if there is a special button configuration, use it
622  +          if (aButtons) {  +          if (aButtons) {
623  +            // expect a comma delimited list of dlgtype values  +            // expect a comma delimited list of dlgtype values
# Line 634  new file mode 100644 Line 630  new file mode 100644
630  +              shown[list[i].replace(/ /g, "")] = true;  +              shown[list[i].replace(/ /g, "")] = true;
631  +  +
632  +            // hide/show the buttons we want  +            // hide/show the buttons we want
633  +            for (dlgtype in buttons)  +            for (dlgtype in buttons)
634  +              buttons[dlgtype].hidden = !shown[dlgtype];  +              buttons[dlgtype].hidden = !shown[dlgtype];
635  +  +
636  +#ifdef XP_WIN  +            // show the spacer on Windows only when the extra2 button is present
637  +#           show the spacer on Windows only when the extra2 button is present  +            if (/Win/.test(navigator.platform)) {
638  +            var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");  +              var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
639  +            spacer.removeAttribute("hidden");  +              spacer.removeAttribute("hidden");
640  +            spacer.setAttribute("flex", shown["extra2"]?"1":"0");  +              spacer.setAttribute("flex", shown["extra2"]?"1":"0");
641  +#endif  +            }
 +  
642  +          }  +          }
643  +        ]]>  +        ]]>
644  +        </body>  +        </body>
# Line 681  new file mode 100644 Line 676  new file mode 100644
676  +        ]]>  +        ]]>
677  +        </body>  +        </body>
678  +      </method>  +      </method>
679  +        +
680  +      <method name="_doButtonCommand">  +      <method name="_doButtonCommand">
681  +        <parameter name="aDlgType"/>  +        <parameter name="aDlgType"/>
682  +        <body>  +        <body>
# Line 705  new file mode 100644 Line 700  new file mode 100644
700  +        ]]>  +        ]]>
701  +        </body>  +        </body>
702  +      </method>  +      </method>
703  +        +
704  +      <method name="_fireButtonEvent">  +      <method name="_fireButtonEvent">
705  +        <parameter name="aDlgType"/>  +        <parameter name="aDlgType"/>
706  +        <body>  +        <body>
707  +        <![CDATA[  +        <![CDATA[
708  +          var event = document.createEvent("Events");  +          var event = document.createEvent("Events");
709  +          event.initEvent("dialog"+aDlgType, true, true);  +          event.initEvent("dialog"+aDlgType, true, true);
710  +            +
711  +          // handle dom event handlers  +          // handle dom event handlers
712  +          var noCancel = this.dispatchEvent(event);  +          var noCancel = this.dispatchEvent(event);
713  +            +
714  +          // handle any xml attribute event handlers  +          // handle any xml attribute event handlers
715  +          var handler = this.getAttribute("ondialog"+aDlgType);  +          var handler = this.getAttribute("ondialog"+aDlgType);
716  +          if (handler != "") {  +          if (handler != "") {
# Line 724  new file mode 100644 Line 719  new file mode 100644
719  +            if (returned == false)  +            if (returned == false)
720  +              noCancel = false;  +              noCancel = false;
721  +          }  +          }
722  +            +
723  +          return noCancel;  +          return noCancel;
724  +        ]]>  +        ]]>
725  +        </body>  +        </body>
# Line 745  new file mode 100644 Line 740  new file mode 100644
740  +      </method>  +      </method>
741  +  +
742  +    </implementation>  +    </implementation>
743  +      +
744  +    <handlers>  +    <handlers>
745  +      <handler event="keypress" keycode="VK_RETURN"  +      <handler event="keypress" keycode="VK_RETURN"
746  +               group="system" action="this._hitEnter(event);"/>  +               group="system" action="this._hitEnter(event);"/>
# Line 781  diff --git a/toolkit/content/widgets/pre Line 776  diff --git a/toolkit/content/widgets/pre
776  new file mode 100644  new file mode 100644
777  --- /dev/null  --- /dev/null
778  +++ b/toolkit/content/widgets/preferences-kde.xml  +++ b/toolkit/content/widgets/preferences-kde.xml
779  @@ -0,0 +1,1403 @@  @@ -0,0 +1,1411 @@
780  +<?xml version="1.0"?>  +<?xml version="1.0"?>
781  +  +
782  +<!DOCTYPE bindings [  +<!DOCTYPE bindings [
# Line 848  new file mode 100644 Line 843  new file mode 100644
843  +        ]]>  +        ]]>
844  +        </body>  +        </body>
845  +      </method>  +      </method>
846  +        +
847  +      <method name="fireChangedEvent">  +      <method name="fireChangedEvent">
848  +        <parameter name="aPreference"/>  +        <parameter name="aPreference"/>
849  +        <body>  +        <body>
# Line 865  new file mode 100644 Line 860  new file mode 100644
860  +        ]]>  +        ]]>
861  +        </body>  +        </body>
862  +      </method>  +      </method>
863  +        +
864  +      <field name="service">  +      <field name="service">
865  +        Components.classes["@mozilla.org/preferences-service;1"]  +        Components.classes["@mozilla.org/preferences-service;1"]
866  +                  .getService(Components.interfaces.nsIPrefService);  +                  .getService(Components.interfaces.nsIPrefService);
# Line 915  new file mode 100644 Line 910  new file mode 100644
910  +            .addObserver(this.name, this.preferences, false);  +            .addObserver(this.name, this.preferences, false);
911  +        // In non-instant apply mode, we must try and use the last saved state  +        // In non-instant apply mode, we must try and use the last saved state
912  +        // from any previous opens of a child dialog instead of the value from  +        // from any previous opens of a child dialog instead of the value from
913  +        // preferences, to pick up any edits a user may have made.  +        // preferences, to pick up any edits a user may have made.
914  +  +
915  +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]  +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
916  +                    .getService(Components.interfaces.nsIScriptSecurityManager);  +                    .getService(Components.interfaces.nsIScriptSecurityManager);
917  +        if (this.preferences.type == "child" &&  +        if (this.preferences.type == "child" &&
918  +            !this.instantApply && window.opener &&  +            !this.instantApply && window.opener &&
919  +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {  +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
920  +          var pdoc = window.opener.document;  +          var pdoc = window.opener.document;
# Line 951  new file mode 100644 Line 946  new file mode 100644
946  +      <field name="_constructed">false</field>  +      <field name="_constructed">false</field>
947  +      <property name="instantApply">  +      <property name="instantApply">
948  +        <getter>  +        <getter>
949    +          if (this.getAttribute("instantApply") == "false")
950    +            return false;
951  +          return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;  +          return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
952  +        </getter>  +        </getter>
953  +      </property>  +      </property>
# Line 960  new file mode 100644 Line 957  new file mode 100644
957  +        <setter>  +        <setter>
958  +          if (val == this.name)  +          if (val == this.name)
959  +            return val;  +            return val;
960  +              +
961  +          this.preferences.rootBranchInternal  +          this.preferences.rootBranchInternal
962  +              .removeObserver(this.name, this.preferences);  +              .removeObserver(this.name, this.preferences);
963  +          this.setAttribute('name', val);  +          this.setAttribute('name', val);
964  +          this.preferences.rootBranchInternal  +          this.preferences.rootBranchInternal
965  +              .addObserver(val, this.preferences, false);  +              .addObserver(val, this.preferences, false);
966  +                +
967  +          return val;  +          return val;
968  +        </setter>  +        </setter>
969  +      </property>  +      </property>
# Line 993  new file mode 100644 Line 990  new file mode 100644
990  +        </body>  +        </body>
991  +      </method>  +      </method>
992  +      <property name="value" onget="return this._value" onset="return this._setValue(val);"/>  +      <property name="value" onget="return this._value" onset="return this._setValue(val);"/>
993  +        +
994  +      <property name="locked">  +      <property name="locked">
995  +        <getter>  +        <getter>
996  +          return this.preferences.rootBranch.prefIsLocked(this.name);  +          return this.preferences.rootBranch.prefIsLocked(this.name);
997  +        </getter>  +        </getter>
998  +      </property>  +      </property>
999  +        +
1000  +      <property name="disabled">  +      <property name="disabled">
1001  +        <getter>  +        <getter>
1002  +          return this.getAttribute("disabled") == "true";  +          return this.getAttribute("disabled") == "true";
1003  +        </getter>  +        </getter>
1004  +        <setter>  +        <setter>
1005  +        <![CDATA[  +        <![CDATA[
1006  +          if (val)  +          if (val)
1007  +            this.setAttribute("disabled", "true");  +            this.setAttribute("disabled", "true");
1008  +          else  +          else
1009  +            this.removeAttribute("disabled");  +            this.removeAttribute("disabled");
# Line 1017  new file mode 100644 Line 1014  new file mode 100644
1014  +          var elements = document.getElementsByAttribute("preference", this.id);  +          var elements = document.getElementsByAttribute("preference", this.id);
1015  +          for (var i = 0; i < elements.length; ++i) {  +          for (var i = 0; i < elements.length; ++i) {
1016  +            elements[i].disabled = val;  +            elements[i].disabled = val;
1017  +              +
1018  +            var labels = document.getElementsByAttribute("control", elements[i].id);  +            var labels = document.getElementsByAttribute("control", elements[i].id);
1019  +            for (var j = 0; j < labels.length; ++j)  +            for (var j = 0; j < labels.length; ++j)
1020  +              labels[j].disabled = val;  +              labels[j].disabled = val;
1021  +          }  +          }
1022  +              +
1023  +          return val;  +          return val;
1024  +        ]]>  +        ]]>
1025  +        </setter>  +        </setter>
1026  +      </property>  +      </property>
1027  +        +
1028  +      <property name="tabIndex">  +      <property name="tabIndex">
1029  +        <getter>  +        <getter>
1030  +          return parseInt(this.getAttribute("tabindex"));  +          return parseInt(this.getAttribute("tabindex"));
1031  +        </getter>  +        </getter>
1032  +        <setter>  +        <setter>
1033  +        <![CDATA[  +        <![CDATA[
1034  +          if (val)  +          if (val)
1035  +            this.setAttribute("tabindex", val);  +            this.setAttribute("tabindex", val);
1036  +          else  +          else
1037  +            this.removeAttribute("tabindex");  +            this.removeAttribute("tabindex");
# Line 1045  new file mode 100644 Line 1042  new file mode 100644
1042  +          var elements = document.getElementsByAttribute("preference", this.id);  +          var elements = document.getElementsByAttribute("preference", this.id);
1043  +          for (var i = 0; i < elements.length; ++i) {  +          for (var i = 0; i < elements.length; ++i) {
1044  +            elements[i].tabIndex = val;  +            elements[i].tabIndex = val;
1045  +              +
1046  +            var labels = document.getElementsByAttribute("control", elements[i].id);  +            var labels = document.getElementsByAttribute("control", elements[i].id);
1047  +            for (var j = 0; j < labels.length; ++j)  +            for (var j = 0; j < labels.length; ++j)
1048  +              labels[j].tabIndex = val;  +              labels[j].tabIndex = val;
1049  +          }  +          }
1050  +              +
1051  +          return val;  +          return val;
1052  +        ]]>  +        ]]>
1053  +        </setter>  +        </setter>
# Line 1064  new file mode 100644 Line 1061  new file mode 100644
1061  +        ]]>  +        ]]>
1062  +        </getter>  +        </getter>
1063  +      </property>  +      </property>
1064  +        +
1065  +      <method name="reset">  +      <method name="reset">
1066  +        <body>  +        <body>
1067  +          // defer reset until preference update  +          // defer reset until preference update
# Line 1072  new file mode 100644 Line 1069  new file mode 100644
1069  +        </body>  +        </body>
1070  +      </method>  +      </method>
1071  +  +
1072  +      <field name="_useDefault">false</field>        +      <field name="_useDefault">false</field>
1073  +      <property name="defaultValue">  +      <property name="defaultValue">
1074  +        <getter>  +        <getter>
1075  +        <![CDATA[  +        <![CDATA[
# Line 1083  new file mode 100644 Line 1080  new file mode 100644
1080  +        ]]>  +        ]]>
1081  +        </getter>  +        </getter>
1082  +      </property>  +      </property>
1083  +        +
1084  +      <property name="_branch">  +      <property name="_branch">
1085  +        <getter>  +        <getter>
1086  +          return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch;  +          return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch;
1087  +        </getter>  +        </getter>
1088  +      </property>  +      </property>
1089  +        +
1090  +      <field name="batching">false</field>  +      <field name="batching">false</field>
1091  +        +
1092  +      <method name="_reportUnknownType">  +      <method name="_reportUnknownType">
1093  +        <body>  +        <body>
1094  +        <![CDATA[  +        <![CDATA[
1095  +          var consoleService = Components.classes["@mozilla.org/consoleservice;1"]  +          var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
1096  +                                         .getService(Components.interfaces.nsIConsoleService);  +                                         .getService(Components.interfaces.nsIConsoleService);
1097  +          var msg = "<preference> with id='" + this.id + "' and name='" +  +          var msg = "<preference> with id='" + this.id + "' and name='" +
1098  +                    this.name + "' has unknown type '" + this.type + "'.";  +                    this.name + "' has unknown type '" + this.type + "'.";
1099  +          consoleService.logStringMessage(msg);  +          consoleService.logStringMessage(msg);
1100  +        ]]>  +        ]]>
1101  +        </body>  +        </body>
1102  +      </method>  +      </method>
1103  +        +
1104  +      <property name="valueFromPreferences">  +      <property name="valueFromPreferences">
1105  +        <getter>  +        <getter>
1106  +        <![CDATA[  +        <![CDATA[
# Line 1188  new file mode 100644 Line 1185  new file mode 100644
1185  +              if (!lf.exists())  +              if (!lf.exists())
1186  +                lf.initWithPath(val);  +                lf.initWithPath(val);
1187  +            }  +            }
1188  +            else  +            else
1189  +              lf = val.QueryInterface(Components.interfaces.nsILocalFile);  +              lf = val.QueryInterface(Components.interfaces.nsILocalFile);
1190  +            this.preferences.rootBranch  +            this.preferences.rootBranch
1191  +                .setComplexValue(this.name, Components.interfaces.nsILocalFile, lf);  +                .setComplexValue(this.name, Components.interfaces.nsILocalFile, lf);
# Line 1202  new file mode 100644 Line 1199  new file mode 100644
1199  +        ]]>  +        ]]>
1200  +        </setter>  +        </setter>
1201  +      </property>  +      </property>
1202  +        +
1203  +      <method name="setElementValue">  +      <method name="setElementValue">
1204  +        <parameter name="aElement"/>  +        <parameter name="aElement"/>
1205  +        <body>  +        <body>
# Line 1219  new file mode 100644 Line 1216  new file mode 100644
1216  +            try {  +            try {
1217  +              var event = document.createEvent("Events");  +              var event = document.createEvent("Events");
1218  +              event.initEvent("syncfrompreference", true, true);  +              event.initEvent("syncfrompreference", true, true);
1219  +              var f = new Function ("event",  +              var f = new Function ("event",
1220  +                                    aElement.getAttribute("onsyncfrompreference"));  +                                    aElement.getAttribute("onsyncfrompreference"));
1221  +              rv = f.call(aElement, event);  +              rv = f.call(aElement, event);
1222  +            }  +            }
# Line 1227  new file mode 100644 Line 1224  new file mode 100644
1224  +              Components.utils.reportError(e);  +              Components.utils.reportError(e);
1225  +            }  +            }
1226  +          }  +          }
1227  +          var val = rv !== undefined ? rv : (this.instantApply ? this.valueFromPreferences : this.value);  +          var val = rv;
1228    +          if (val === undefined)
1229    +            val = this.instantApply ? this.valueFromPreferences : this.value;
1230  +          // if the preference is marked for reset, show default value in UI  +          // if the preference is marked for reset, show default value in UI
1231  +          if (val === undefined)  +          if (val === undefined)
1232  +            val = this.defaultValue;  +            val = this.defaultValue;
1233  +  +
1234  +          /**  +          /**
1235  +           * Initialize a UI element property with a value. Handles the case  +           * Initialize a UI element property with a value. Handles the case
1236  +           * where an element has not yet had a XBL binding attached for it and  +           * where an element has not yet had a XBL binding attached for it and
1237  +           * the property setter does not yet exist by setting the same attribute  +           * the property setter does not yet exist by setting the same attribute
1238  +           * on the XUL element using DOM apis and assuming the element's  +           * on the XUL element using DOM apis and assuming the element's
1239  +           * constructor or property getters appropriately handle this state.  +           * constructor or property getters appropriately handle this state.
1240  +           */  +           */
1241  +          function setValue(element, attribute, value) {  +          function setValue(element, attribute, value) {
1242  +            if (attribute in element)  +            if (attribute in element)
1243  +              element[attribute] = value;  +              element[attribute] = value;
1244  +            else  +            else
1245  +              element.setAttribute(attribute, value);  +              element.setAttribute(attribute, value);
# Line 1272  new file mode 100644 Line 1271  new file mode 100644
1271  +            try {  +            try {
1272  +              var event = document.createEvent("Events");  +              var event = document.createEvent("Events");
1273  +              event.initEvent("synctopreference", true, true);  +              event.initEvent("synctopreference", true, true);
1274  +              var f = new Function ("event",  +              var f = new Function ("event",
1275  +                                    aElement.getAttribute("onsynctopreference"));  +                                    aElement.getAttribute("onsynctopreference"));
1276  +              var rv = f.call(aElement, event);  +              var rv = f.call(aElement, event);
1277  +              if (rv !== undefined)  +              if (rv !== undefined)
1278  +                return rv;  +                return rv;
1279  +            }  +            }
1280  +            catch (e) {  +            catch (e) {
1281  +              Components.utils.reportError(e);  +              Components.utils.reportError(e);
1282  +            }  +            }
1283  +          }  +          }
1284  +            +
1285  +          /**  +          /**
1286  +           * Read the value of an attribute from an element, assuming the  +           * Read the value of an attribute from an element, assuming the
1287  +           * attribute is a property on the element's node API. If the property  +           * attribute is a property on the element's node API. If the property
1288  +           * is not present in the API, then assume its value is contained in  +           * is not present in the API, then assume its value is contained in
1289  +           * an attribute, as is the case before a binding has been attached.  +           * an attribute, as is the case before a binding has been attached.
# Line 1312  new file mode 100644 Line 1311  new file mode 100644
1311  +        ]]>  +        ]]>
1312  +        </body>  +        </body>
1313  +      </method>  +      </method>
1314  +        +
1315  +      <method name="isElementEditable">  +      <method name="isElementEditable">
1316  +        <parameter name="aElement"/>  +        <parameter name="aElement"/>
1317  +        <body>  +        <body>
# Line 1328  new file mode 100644 Line 1327  new file mode 100644
1327  +            return true;  +            return true;
1328  +          }  +          }
1329  +          return aElement.getAttribute("preference-editable") == "true";  +          return aElement.getAttribute("preference-editable") == "true";
1330  +        ]]>  +        ]]>
1331  +        </body>  +        </body>
1332  +      </method>  +      </method>
1333  +        +
1334  +      <method name="updateElements">  +      <method name="updateElements">
1335  +        <body>  +        <body>
1336  +        <![CDATA[  +        <![CDATA[
1337  +          if (!this.id)  +          if (!this.id)
1338  +            return;  +            return;
1339  +  +
1340  +          // This "change" event handler tracks changes made to preferences by  +          // This "change" event handler tracks changes made to preferences by
1341  +          // sources other than the user in this window.  +          // sources other than the user in this window.
1342  +          var elements = document.getElementsByAttribute("preference", this.id);  +          var elements = document.getElementsByAttribute("preference", this.id);
1343  +          for (var i = 0; i < elements.length; ++i)  +          for (var i = 0; i < elements.length; ++i)
1344  +            this.setElementValue(elements[i]);  +            this.setElementValue(elements[i]);
1345  +        ]]>  +        ]]>
1346  +        </body>  +        </body>
1347  +      </method>  +      </method>
1348  +    </implementation>  +    </implementation>
1349  +      +
1350  +    <handlers>  +    <handlers>
1351  +      <handler event="change">  +      <handler event="change">
1352  +        this.updateElements();  +        this.updateElements();
# Line 1415  new file mode 100644 Line 1414  new file mode 100644
1414  +            var acceptButton = docElt.getButton("accept");  +            var acceptButton = docElt.getButton("accept");
1415  +            acceptButton.hidden = true;  +            acceptButton.hidden = true;
1416  +            var cancelButton  = docElt.getButton("cancel");  +            var cancelButton  = docElt.getButton("cancel");
1417  +#ifdef XP_MACOSX  +            if (/Mac/.test(navigator.platform)) {
1418  +            // no buttons on Mac except Help  +              // no buttons on Mac except Help
1419  +            cancelButton.hidden = true;  +              cancelButton.hidden = true;
1420  +            // Move Help button to the end  +              // Move Help button to the end
1421  +            document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;          +              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
1422  +            // Also, don't fire onDialogAccept on enter  +              // Also, don't fire onDialogAccept on enter
1423  +            acceptButton.disabled = true;  +              acceptButton.disabled = true;
1424  +#else  +            } else {
1425  +            // morph the Cancel button into the Close button  +              // morph the Cancel button into the Close button
1426  +            cancelButton.setAttribute ("icon", "close");  +              cancelButton.setAttribute ("icon", "close");
1427  +            cancelButton.label = docElt.getAttribute("closebuttonlabel");  +              cancelButton.label = docElt.getAttribute("closebuttonlabel");
1428  +            cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");  +              cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");
1429  +#endif  +            }
1430  +          }  +          }
1431  +        }  +        }
1432  +        this.setAttribute("animated", this._shouldAnimate ? "true" : "false");  +        this.setAttribute("animated", this._shouldAnimate ? "true" : "false");
# Line 1496  new file mode 100644 Line 1495  new file mode 100644
1495  +                onget="return document.getAnonymousElementByAttribute(this, 'class', 'paneDeckContainer');"/>  +                onget="return document.getAnonymousElementByAttribute(this, 'class', 'paneDeckContainer');"/>
1496  +      <property name="_selector"  +      <property name="_selector"
1497  +                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'selector');"/>  +                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'selector');"/>
1498  +      <property name="lastSelected"  +      <property name="lastSelected"
1499  +                onget="return this.getAttribute('lastSelected');">  +                onget="return this.getAttribute('lastSelected');">
1500  +        <setter>  +        <setter>
1501  +          this.setAttribute("lastSelected", val);  +          this.setAttribute("lastSelected", val);
1502  +          document.persist(this.id, "lastSelected");  +          document.persist(this.id, "lastSelected");
1503  +          return val;  +          return val;
1504  +        </setter>            +        </setter>
1505  +      </property>  +      </property>
1506  +      <property name="currentPane"  +      <property name="currentPane"
1507  +                onset="return this._currentPane = val;">  +                onset="return this._currentPane = val;">
1508  +        <getter>  +        <getter>
1509  +          if (!this._currentPane)  +          if (!this._currentPane)
1510  +            this._currentPane = this.preferencePanes[0];  +            this._currentPane = this.preferencePanes[0];
1511  +            +
1512  +          return this._currentPane;  +          return this._currentPane;
1513  +        </getter>  +        </getter>
1514  +      </property>  +      </property>
1515  +      <field name="_currentPane">null</field>  +      <field name="_currentPane">null</field>
1516  +        +
1517  +        +
1518  +      <method name="_makePaneButton">  +      <method name="_makePaneButton">
1519  +        <parameter name="aPaneElement"/>  +        <parameter name="aPaneElement"/>
1520  +        <body>  +        <body>
# Line 1547  new file mode 100644 Line 1546  new file mode 100644
1546  +            {  +            {
1547  +              this._pane = aPane;  +              this._pane = aPane;
1548  +            }  +            }
1549  +            OverlayLoadObserver.prototype = {  +            OverlayLoadObserver.prototype = {
1550  +              _outer: this,  +              _outer: this,
1551  +              observe: function (aSubject, aTopic, aData)  +              observe: function (aSubject, aTopic, aData)
1552  +              {  +              {
1553  +                this._pane.loaded = true;  +                this._pane.loaded = true;
1554  +                this._outer._fireEvent("paneload", this._pane);  +                this._outer._fireEvent("paneload", this._pane);
1555  +                this._outer._selectPane(this._pane);  +                this._outer._selectPane(this._pane);
1556  +              }  +              }
1557  +            };  +            };
1558  +              +
1559  +            var obs = new OverlayLoadObserver(aPaneElement);  +            var obs = new OverlayLoadObserver(aPaneElement);
1560  +            document.loadOverlay(aPaneElement.src, obs);  +            document.loadOverlay(aPaneElement.src, obs);
1561  +          }  +          }
# Line 1565  new file mode 100644 Line 1564  new file mode 100644
1564  +        ]]>  +        ]]>
1565  +        </body>  +        </body>
1566  +      </method>  +      </method>
1567  +        +
1568  +      <method name="_fireEvent">  +      <method name="_fireEvent">
1569  +        <parameter name="aEventName"/>  +        <parameter name="aEventName"/>
1570  +        <parameter name="aTarget"/>  +        <parameter name="aTarget"/>
1571  +        <body>  +        <body>
1572  +        <![CDATA[  +        <![CDATA[
1573  +          // Panel loaded, synthesize a load event.  +          // Panel loaded, synthesize a load event.
1574  +          try {  +          try {
1575  +            var event = document.createEvent("Events");  +            var event = document.createEvent("Events");
1576  +            event.initEvent(aEventName, true, true);  +            event.initEvent(aEventName, true, true);
# Line 1582  new file mode 100644 Line 1581  new file mode 100644
1581  +              if (rv == false)  +              if (rv == false)
1582  +                cancel = true;  +                cancel = true;
1583  +            }  +            }
1584  +            return !cancel;    +            return !cancel;
1585  +          }  +          }
1586  +          catch (e) {  +          catch (e) {
1587  +            Components.utils.reportError(e);  +            Components.utils.reportError(e);
1588  +          }  +          }
1589  +          return false;  +          return false;
1590  +        ]]>  +        ]]>
1591  +        </body>  +        </body>
1592  +      </method>  +      </method>
1593  +        +
1594  +      <field name="_initialized">false</field>  +      <field name="_initialized">false</field>
1595  +      <method name="_selectPane">  +      <method name="_selectPane">
1596  +        <parameter name="aPaneElement"/>  +        <parameter name="aPaneElement"/>
1597  +        <body>  +        <body>
1598  +        <![CDATA[  +        <![CDATA[
1599  +#ifdef XP_MACOSX  +          if (/Mac/.test(navigator.platform)) {
1600  +          var paneTitle = aPaneElement.label;  +            var paneTitle = aPaneElement.label;
1601  +          if (paneTitle != "")  +            if (paneTitle != "")
1602  +            document.title = paneTitle;  +              document.title = paneTitle;
1603  +#endif  +          }
1604  +          var helpButton = document.documentElement.getButton("help");  +          var helpButton = document.documentElement.getButton("help");
1605  +          if (aPaneElement.helpTopic)  +          if (aPaneElement.helpTopic)
1606  +            helpButton.hidden = false;  +            helpButton.hidden = false;
1607  +          else  +          else
1608  +            helpButton.hidden = true;  +            helpButton.hidden = true;
1609  +  +
1610  +          // Find this pane's index in the deck and set the deck's  +          // Find this pane's index in the deck and set the deck's
1611  +          // selectedIndex to that value to switch to it.  +          // selectedIndex to that value to switch to it.
1612  +          var prefpanes = this.preferencePanes;  +          var prefpanes = this.preferencePanes;
1613  +          for (var i = 0; i < prefpanes.length; ++i) {  +          for (var i = 0; i < prefpanes.length; ++i) {
1614  +            if (prefpanes[i] == aPaneElement) {  +            if (prefpanes[i] == aPaneElement) {
1615  +              this._paneDeck.selectedIndex = i;  +              this._paneDeck.selectedIndex = i;
1616  +                +
1617  +              if (this.type != "child") {  +              if (this.type != "child") {
1618  +                if (aPaneElement.hasAttribute("flex") && this._shouldAnimate &&  +                if (aPaneElement.hasAttribute("flex") && this._shouldAnimate &&
1619  +                    prefpanes.length > 1)  +                    prefpanes.length > 1)
# Line 1667  new file mode 100644 Line 1666  new file mode 100644
1666  +        ]]>  +        ]]>
1667  +        </body>  +        </body>
1668  +      </method>  +      </method>
1669  +        +
1670  +      <property name="_shouldAnimate">  +      <property name="_shouldAnimate">
1671  +        <getter>  +        <getter>
1672  +        <![CDATA[  +        <![CDATA[
1673  +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]  +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
1674  +                               .getService(Components.interfaces.nsIPrefBranch);  +                               .getService(Components.interfaces.nsIPrefBranch);
1675  +#ifdef XP_MACOSX  +          var animate = /Mac/.test(navigator.platform);
 +          var animate = true;  
 +#else  
 +          var animate = false;  
 +#endif  
1676  +          try {  +          try {
1677  +            animate = psvc.getBoolPref("browser.preferences.animateFadeIn");  +            animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
1678  +          }  +          }
# Line 1686  new file mode 100644 Line 1681  new file mode 100644
1681  +        ]]>  +        ]]>
1682  +        </getter>  +        </getter>
1683  +      </property>  +      </property>
1684  +        +
1685  +      <method name="animate">  +      <method name="animate">
1686  +        <parameter name="aOldPane"/>  +        <parameter name="aOldPane"/>
1687  +        <parameter name="aNewPane"/>  +        <parameter name="aNewPane"/>
# Line 1694  new file mode 100644 Line 1689  new file mode 100644
1689  +        <![CDATA[  +        <![CDATA[
1690  +          // if we are already resizing, use currentHeight  +          // if we are already resizing, use currentHeight
1691  +          var oldHeight = this._currentHeight ? this._currentHeight : aOldPane.contentHeight;  +          var oldHeight = this._currentHeight ? this._currentHeight : aOldPane.contentHeight;
1692  +            +
1693  +          this._multiplier = aNewPane.contentHeight > oldHeight ? 1 : -1;  +          this._multiplier = aNewPane.contentHeight > oldHeight ? 1 : -1;
1694  +          var sizeDelta = Math.abs(oldHeight - aNewPane.contentHeight);  +          var sizeDelta = Math.abs(oldHeight - aNewPane.contentHeight);
1695  +          this._animateRemainder = sizeDelta % this._animateIncrement;  +          this._animateRemainder = sizeDelta % this._animateIncrement;
# Line 1703  new file mode 100644 Line 1698  new file mode 100644
1698  +        ]]>  +        ]]>
1699  +        </body>  +        </body>
1700  +      </method>  +      </method>
1701  +        +
1702  +      <property name="_sizeIncrement">  +      <property name="_sizeIncrement">
1703  +        <getter>  +        <getter>
1704  +        <![CDATA[  +        <![CDATA[
# Line 1713  new file mode 100644 Line 1708  new file mode 100644
1708  +          if ((this._multiplier > 0 && this._currentHeight >= lastSelectedPane.contentHeight) ||  +          if ((this._multiplier > 0 && this._currentHeight >= lastSelectedPane.contentHeight) ||
1709  +              (this._multiplier < 0 && this._currentHeight <= lastSelectedPane.contentHeight))  +              (this._multiplier < 0 && this._currentHeight <= lastSelectedPane.contentHeight))
1710  +            return 0;  +            return 0;
1711  +            +
1712  +          if ((this._multiplier > 0 && newHeight > lastSelectedPane.contentHeight) ||  +          if ((this._multiplier > 0 && newHeight > lastSelectedPane.contentHeight) ||
1713  +              (this._multiplier < 0 && newHeight < lastSelectedPane.contentHeight))  +              (this._multiplier < 0 && newHeight < lastSelectedPane.contentHeight))
1714  +            increment = this._animateRemainder * this._multiplier;  +            increment = this._animateRemainder * this._multiplier;
# Line 1721  new file mode 100644 Line 1716  new file mode 100644
1716  +        ]]>  +        ]]>
1717  +        </getter>  +        </getter>
1718  +      </property>  +      </property>
1719  +        +
1720  +      <method name="notify">  +      <method name="notify">
1721  +        <parameter name="aTimer"/>  +        <parameter name="aTimer"/>
1722  +        <body>  +        <body>
1723  +        <![CDATA[  +        <![CDATA[
1724  +          if (!document)  +          if (!document)
1725  +            aTimer.cancel();  +            aTimer.cancel();
1726  +            +
1727  +          if (aTimer == this._animateTimer) {  +          if (aTimer == this._animateTimer) {
1728  +            var increment = this._sizeIncrement;  +            var increment = this._sizeIncrement;
1729  +            if (increment != 0) {  +            if (increment != 0) {
# Line 1752  new file mode 100644 Line 1747  new file mode 100644
1747  +        ]]>  +        ]]>
1748  +        </body>  +        </body>
1749  +      </method>  +      </method>
1750  +        +
1751  +      <method name="_setUpAnimationTimer">  +      <method name="_setUpAnimationTimer">
1752  +        <parameter name="aStartHeight"/>  +        <parameter name="aStartHeight"/>
1753  +        <body>  +        <body>
1754  +        <![CDATA[  +        <![CDATA[
1755  +          if (!this._animateTimer)  +          if (!this._animateTimer)
1756  +            this._animateTimer = Components.classes["@mozilla.org/timer;1"]  +            this._animateTimer = Components.classes["@mozilla.org/timer;1"]
1757  +                                           .createInstance(Components.interfaces.nsITimer);  +                                           .createInstance(Components.interfaces.nsITimer);
1758  +          else  +          else
1759  +            this._animateTimer.cancel();  +            this._animateTimer.cancel();
1760  +          this._currentHeight = aStartHeight;  +          this._currentHeight = aStartHeight;
1761  +            +
1762  +          this._animateTimer.initWithCallback(this, this._animateDelay,  +          this._animateTimer.initWithCallback(this, this._animateDelay,
1763  +                                              Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);  +                                              Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
1764  +        ]]>  +        ]]>
1765  +        </body>  +        </body>
1766  +      </method>  +      </method>
1767  +        +
1768  +      <method name="_setUpFadeTimer">  +      <method name="_setUpFadeTimer">
1769  +        <body>  +        <body>
1770  +        <![CDATA[  +        <![CDATA[
1771  +          if (!this._fadeTimer)  +          if (!this._fadeTimer)
1772  +            this._fadeTimer = Components.classes["@mozilla.org/timer;1"]  +            this._fadeTimer = Components.classes["@mozilla.org/timer;1"]
1773  +                                        .createInstance(Components.interfaces.nsITimer);  +                                        .createInstance(Components.interfaces.nsITimer);
1774  +          else  +          else
1775  +            this._fadeTimer.cancel();  +            this._fadeTimer.cancel();
1776  +            +
1777  +          this._fadeTimer.initWithCallback(this, this._fadeDelay,  +          this._fadeTimer.initWithCallback(this, this._fadeDelay,
1778  +                                           Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);  +                                           Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
1779  +        ]]>  +        ]]>
1780  +        </body>  +        </body>
1781  +      </method>  +      </method>
1782  +        +
1783  +      <field name="_animateTimer">null</field>  +      <field name="_animateTimer">null</field>
1784  +      <field name="_fadeTimer">null</field>  +      <field name="_fadeTimer">null</field>
1785  +      <field name="_animateDelay">15</field>  +      <field name="_animateDelay">15</field>
# Line 1800  new file mode 100644 Line 1795  new file mode 100644
1795  +        <body>  +        <body>
1796  +        <![CDATA[  +        <![CDATA[
1797  +          this.appendChild(aPaneElement);  +          this.appendChild(aPaneElement);
1798  +            +
1799  +          // Set up pane button  +          // Set up pane button
1800  +          this._makePaneButton(aPaneElement);  +          this._makePaneButton(aPaneElement);
1801  +        ]]>  +        ]]>
1802  +        </body>  +        </body>
1803  +      </method>  +      </method>
1804  +        +
1805  +      <method name="openSubDialog">  +      <method name="openSubDialog">
1806  +        <parameter name="aURL"/>  +        <parameter name="aURL"/>
1807  +        <parameter name="aFeatures"/>  +        <parameter name="aFeatures"/>
# Line 1815  new file mode 100644 Line 1810  new file mode 100644
1810  +          return openDialog(aURL, "", "modal,centerscreen,resizable=no" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams);  +          return openDialog(aURL, "", "modal,centerscreen,resizable=no" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams);
1811  +        </body>  +        </body>
1812  +      </method>  +      </method>
1813  +        +
1814  +      <method name="openWindow">  +      <method name="openWindow">
1815  +        <parameter name="aWindowType"/>  +        <parameter name="aWindowType"/>
1816  +        <parameter name="aURL"/>  +        <parameter name="aURL"/>
# Line 1844  new file mode 100644 Line 1839  new file mode 100644
1839  +    <handlers>  +    <handlers>
1840  +      <handler event="dialogaccept">  +      <handler event="dialogaccept">
1841  +      <![CDATA[  +      <![CDATA[
1842  +        if (!this._fireEvent("beforeaccept", this)){  +        if (!this._fireEvent("beforeaccept", this)) {
1843  +          return false;  +          return false;
1844  +        }  +        }
1845  +  +
# Line 1852  new file mode 100644 Line 1847  new file mode 100644
1847  +                    .getService(Components.interfaces.nsIScriptSecurityManager);  +                    .getService(Components.interfaces.nsIScriptSecurityManager);
1848  +        if (this.type == "child" && window.opener &&  +        if (this.type == "child" && window.opener &&
1849  +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {  +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
1850  +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]  +          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
1851  +                               .getService(Components.interfaces.nsIPrefBranch);  +                               .getService(Components.interfaces.nsIPrefBranch);
1852  +          var pdocEl = window.opener.document.documentElement;  +          var pdocEl = window.opener.document.documentElement;
1853  +          if (pdocEl.instantApply) {  +          if (pdocEl.instantApply) {
1854  +            var panes = this.preferencePanes;  +            let panes = this.preferencePanes;
1855  +            for (var i = 0; i < panes.length; ++i)  +            for (let i = 0; i < panes.length; ++i)
1856  +              panes[i].writePreferences(true);  +              panes[i].writePreferences(true);
1857  +          }  +          }
1858  +          else {  +          else {
1859  +            // Clone all the preferences elements from the child document and  +            // Clone all the preferences elements from the child document and
1860  +            // insert them into the pane collection of the parent.  +            // insert them into the pane collection of the parent.
1861  +            var pdoc = window.opener.document;  +            var pdoc = window.opener.document;
1862  +            if (pdoc.documentElement.localName == "prefwindow") {  +            if (pdoc.documentElement.localName == "prefwindow") {
1863  +              var currentPane = pdoc.documentElement.currentPane;  +              var currentPane = pdoc.documentElement.currentPane;
1864  +              var id = window.location.href + "#childprefs";  +              var id = window.location.href + "#childprefs";
1865  +              var childPrefs = pdoc.getElementById(id);  +              var childPrefs = pdoc.getElementById(id);
1866  +              if (!childPrefs) {  +              if (!childPrefs) {
1867  +                var childPrefs = pdoc.createElement("preferences");  +                childPrefs = pdoc.createElement("preferences");
1868  +                currentPane.appendChild(childPrefs);  +                currentPane.appendChild(childPrefs);
1869  +                childPrefs.id = id;  +                childPrefs.id = id;
1870  +              }  +              }
1871  +              var panes = this.preferencePanes;  +              let panes = this.preferencePanes;
1872  +              for (var i = 0; i < panes.length; ++i) {  +              for (let i = 0; i < panes.length; ++i) {
1873  +                var preferences = panes[i].preferences;  +                var preferences = panes[i].preferences;
1874  +                for (var j = 0; j < preferences.length; ++j) {  +                for (var j = 0; j < preferences.length; ++j) {
1875  +                  // Try to find a preference element for the same preference.  +                  // Try to find a preference element for the same preference.
# Line 1905  new file mode 100644 Line 1900  new file mode 100644
1900  +          }  +          }
1901  +        }  +        }
1902  +        else {  +        else {
1903  +          var panes = this.preferencePanes;  +          let panes = this.preferencePanes;
1904  +          for (var i = 0; i < panes.length; ++i)  +          for (var i = 0; i < panes.length; ++i)
1905  +            panes[i].writePreferences(false);  +            panes[i].writePreferences(false);
1906  +  +
1907  +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]  +          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
1908  +                               .getService(Components.interfaces.nsIPrefService);  +                               .getService(Components.interfaces.nsIPrefService);
1909  +          psvc.savePrefFile(null);  +          psvc.savePrefFile(null);
1910  +        }  +        }
# Line 1951  new file mode 100644 Line 1946  new file mode 100644
1946  +      </handler>  +      </handler>
1947  +    </handlers>  +    </handlers>
1948  +  </binding>  +  </binding>
1949  +    +
1950  +  <binding id="prefpane">  +  <binding id="prefpane">
1951  +    <resources>  +    <resources>
1952  +      <stylesheet src="chrome://global/skin/preferences.css"/>  +      <stylesheet src="chrome://global/skin/preferences.css"/>
# Line 1986  new file mode 100644 Line 1981  new file mode 100644
1981  +        ]]>  +        ]]>
1982  +        </body>  +        </body>
1983  +      </method>  +      </method>
1984  +        +
1985  +      <property name="src"  +      <property name="src"
1986  +                onget="return this.getAttribute('src');"  +                onget="return this.getAttribute('src');"
1987  +                onset="this.setAttribute('src', val); return val;"/>  +                onset="this.setAttribute('src', val); return val;"/>
1988  +      <property name="selected"  +      <property name="selected"
1989  +                onget="return this.getAttribute('selected') == 'true';"  +                onget="return this.getAttribute('selected') == 'true';"
1990  +                onset="this.setAttribute('selected', val); return val;"/>  +                onset="this.setAttribute('selected', val); return val;"/>
1991  +      <property name="image"  +      <property name="image"
1992  +                onget="return this.getAttribute('image');"  +                onget="return this.getAttribute('image');"
1993  +                onset="this.setAttribute('image', val); return val;"/>  +                onset="this.setAttribute('image', val); return val;"/>
1994  +      <property name="label"  +      <property name="label"
1995  +                onget="return this.getAttribute('label');"  +                onget="return this.getAttribute('label');"
1996  +                onset="this.setAttribute('label', val); return val;"/>  +                onset="this.setAttribute('label', val); return val;"/>
1997  +        +
1998  +      <property name="preferenceElements"  +      <property name="preferenceElements"
1999  +                onget="return this.getElementsByAttribute('preference', '*');"/>  +                onget="return this.getElementsByAttribute('preference', '*');"/>
2000  +      <property name="preferences"  +      <property name="preferences"
# Line 2023  new file mode 100644 Line 2018  new file mode 100644
2018  +      </property>  +      </property>
2019  +  +
2020  +      <field name="_loaded">false</field>  +      <field name="_loaded">false</field>
2021  +      <property name="loaded"  +      <property name="loaded"
2022  +                onget="return !this.src ? true : this._loaded;"  +                onget="return !this.src ? true : this._loaded;"
2023  +                onset="this._loaded = val; return val;"/>  +                onset="this._loaded = val; return val;"/>
2024  +        +
2025  +      <method name="preferenceForElement">  +      <method name="preferenceForElement">
2026  +        <parameter name="aElement"/>  +        <parameter name="aElement"/>
2027  +        <body>  +        <body>
2028  +          return document.getElementById(aElement.getAttribute("preference"));  +          return document.getElementById(aElement.getAttribute("preference"));
2029  +        </body>  +        </body>
2030  +      </method>  +      </method>
2031  +        +
2032  +      <method name="getPreferenceElement">  +      <method name="getPreferenceElement">
2033  +        <parameter name="aStartElement"/>  +        <parameter name="aStartElement"/>
2034  +        <body>  +        <body>
2035  +        <![CDATA[  +        <![CDATA[
2036  +          var temp = aStartElement;  +          var temp = aStartElement;
2037  +          while (temp && temp.nodeType == Node.ELEMENT_NODE &&  +          while (temp && temp.nodeType == Node.ELEMENT_NODE &&
2038  +                 !temp.hasAttribute("preference"))  +                 !temp.hasAttribute("preference"))
2039  +            temp = temp.parentNode;  +            temp = temp.parentNode;
2040  +          return temp.nodeType == Node.ELEMENT_NODE ? temp : aStartElement;  +          return temp.nodeType == Node.ELEMENT_NODE ? temp : aStartElement;
2041  +        ]]>  +        ]]>
2042  +        </body>  +        </body>
2043  +      </method>  +      </method>
2044  +        +
2045  +      <field name="DeferredTask" readonly="true">  +      <property name="DeferredTask" readonly="true">
2046  +        let targetObj = {};  +        <getter><![CDATA[
2047  +        Components.utils.import("resource://gre/modules/DeferredTask.jsm", targetObj);  +          let module = {};
2048  +        targetObj.DeferredTask;  +          Components.utils.import("resource://gre/modules/DeferredTask.jsm", module);
2049  +      </field>  +          Object.defineProperty(this, "DeferredTask", {
2050    +            configurable: true,
2051    +            enumerable: true,
2052    +            writable: true,
2053    +            value: module.DeferredTask
2054    +          });
2055    +          return module.DeferredTask;
2056    +        ]]></getter>
2057    +      </property>
2058  +      <method name="_deferredValueUpdate">  +      <method name="_deferredValueUpdate">
2059  +        <parameter name="aElement"/>  +        <parameter name="aElement"/>
2060  +        <body>  +        <body>
# Line 2102  new file mode 100644 Line 2105  new file mode 100644
2105  +        ]]>  +        ]]>
2106  +        </body>  +        </body>
2107  +      </method>  +      </method>
2108  +        +
2109  +      <property name="contentHeight">  +      <property name="contentHeight">
2110  +        <getter>  +        <getter>
2111  +          var targetHeight = parseInt(window.getComputedStyle(this._content, "").height);  +          var targetHeight = parseInt(window.getComputedStyle(this._content, "").height);
# Line 2117  new file mode 100644 Line 2120  new file mode 100644
2120  +    </implementation>  +    </implementation>
2121  +    <handlers>  +    <handlers>
2122  +      <handler event="command">  +      <handler event="command">
2123  +        // This "command" event handler tracks changes made to preferences by  +        // This "command" event handler tracks changes made to preferences by
2124  +        // the user in this window.  +        // the user in this window.
2125  +        if (event.sourceEvent)  +        if (event.sourceEvent)
2126  +          event = event.sourceEvent;  +          event = event.sourceEvent;
2127  +        this.userChangedValue(event.target);  +        this.userChangedValue(event.target);
2128  +      </handler>  +      </handler>
2129  +      <handler event="select">  +      <handler event="select">
2130  +        // This "select" event handler tracks changes made to colorpicker  +        // This "select" event handler tracks changes made to colorpicker
2131  +        // preferences by the user in this window.  +        // preferences by the user in this window.
2132  +        if (event.target.localName == "colorpicker")  +        if (event.target.localName == "colorpicker")
2133  +          this.userChangedValue(event.target);  +          this.userChangedValue(event.target);
2134  +      </handler>  +      </handler>
2135  +      <handler event="change">  +      <handler event="change">
2136  +        // This "change" event handler tracks changes made to preferences by  +        // This "change" event handler tracks changes made to preferences by
2137  +        // the user in this window.  +        // the user in this window.
2138  +        this.userChangedValue(event.target);  +        this.userChangedValue(event.target);
2139  +      </handler>  +      </handler>
2140  +      <handler event="input">  +      <handler event="input">
2141  +        // This "input" event handler tracks changes made to preferences by  +        // This "input" event handler tracks changes made to preferences by
2142  +        // the user in this window.  +        // the user in this window.
2143  +        this.userChangedValue(event.target);  +        this.userChangedValue(event.target);
2144  +      </handler>  +      </handler>
# Line 2152  new file mode 100644 Line 2155  new file mode 100644
2155  +            dump("*** No preference found for " + elements[i].getAttribute("preference") + "\n");  +            dump("*** No preference found for " + elements[i].getAttribute("preference") + "\n");
2156  +          }  +          }
2157  +        }  +        }
2158  +      ]]>        +      ]]>
2159  +      </handler>  +      </handler>
2160  +    </handlers>  +    </handlers>
2161  +  </binding>  +  </binding>
2162  +            +
2163  +  <binding id="panebutton" role="xul:listitem"  +  <binding id="panebutton" role="xul:listitem"
2164  +           extends="chrome://global/content/bindings/radio.xml#radio">  +           extends="chrome://global/content/bindings/radio.xml#radio">
2165  +    <resources>  +    <resources>
# Line 2185  new file mode 100644 Line 2188  new file mode 100644
2188  +#    PrefWindow II  (???)  +#    PrefWindow II  (???)
2189  +#    PrefWindow I   (June 4, 1999)  +#    PrefWindow I   (June 4, 1999)
2190  +#  +#
2191    diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
2192    --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
2193    +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
2194    @@ -627,17 +627,17 @@ nsUnknownContentTypeDialog.prototype = {
2195           else
2196             typeString = mimeInfo.MIMEType;
2197         }
2198         // When the length is unknown, contentLength would be -1
2199         if (this.mLauncher.contentLength >= 0) {
2200           let [size, unit] = DownloadUtils.
2201                              convertByteUnits(this.mLauncher.contentLength);
2202           type.value = this.dialogElement("strings")
2203    -                       .getFormattedString("orderedFileSizeWithType",
2204    +                       .getFormattedString("orderedFileSizeWithType",
2205                                                [typeString, size, unit]);
2206         }
2207         else {
2208           type.value = typeString;
2209         }
2210       },
2211    
2212       // Returns true if opening the default application makes sense.
2213    @@ -801,17 +801,17 @@ nsUnknownContentTypeDialog.prototype = {
2214           switch (this.dialogElement("openHandler").selectedIndex) {
2215           case 0:
2216             // No app need be specified in this case.
2217             ok = true;
2218             break;
2219           case 1:
2220             // only enable the OK button if we have a default app to use or if
2221             // the user chose an app....
2222    -        ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
2223    +        ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
2224             break;
2225           }
2226         }
2227    
2228         // Enable Ok button if ok to press.
2229         this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
2230       },
2231    
2232    @@ -1068,30 +1068,56 @@ nsUnknownContentTypeDialog.prototype = {
2233               params.handlerApp.executable &&
2234               params.handlerApp.executable.isFile()) {
2235             // Remember the file they chose to run.
2236             this.chosenApp = params.handlerApp;
2237           }
2238         }
2239         else {
2240     #if MOZ_WIDGET_GTK == 3
2241    -      var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
2242    -      var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
2243    -                                 .createInstance(nsIApplicationChooser);
2244    -      appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
2245    -      var contentTypeDialogObj = this;
2246    -      let appChooserCallback = function appChooserCallback_done(aResult) {
2247    -        if (aResult) {
2248    -           contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
2249    +      // handle the KDE case which is implemented in the filepicker
2250    +      // therefore falling back to Gtk2 like behaviour if KDE is running
2251    +      // FIXME this should be better handled in the nsIApplicationChooser interface
2252    +      var env = Components.classes["@mozilla.org/process/environment;1"]
2253    +                          .getService(Components.interfaces.nsIEnvironment);
2254    +      if (env.get('KDE_FULL_SESSION') == "true")
2255    +      {
2256    +        var nsIFilePicker = Components.interfaces.nsIFilePicker;
2257    +        var fp = Components.classes["@mozilla.org/filepicker;1"]
2258    +                           .createInstance(nsIFilePicker);
2259    +        fp.init(this.mDialog,
2260    +                this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
2261    +                nsIFilePicker.modeOpen);
2262    +
2263    +        fp.appendFilters(nsIFilePicker.filterApps);
2264    +
2265    +        if (fp.show() == nsIFilePicker.returnOK && fp.file) {
2266    +          // Remember the file they chose to run.
2267    +          var localHandlerApp =
2268    +            Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
2269    +                       createInstance(Components.interfaces.nsILocalHandlerApp);
2270    +          localHandlerApp.executable = fp.file;
2271    +          this.chosenApp = localHandlerApp;
2272             }
2273    -        contentTypeDialogObj.finishChooseApp();
2274    -      };
2275    -      appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
2276    -      // The finishChooseApp is called from appChooserCallback
2277    -      return;
2278    +      } else {
2279    +        var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
2280    +        var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
2281    +                                   .createInstance(nsIApplicationChooser);
2282    +        appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
2283    +        var contentTypeDialogObj = this;
2284    +        let appChooserCallback = function appChooserCallback_done(aResult) {
2285    +          if (aResult) {
2286    +             contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
2287    +          }
2288    +          contentTypeDialogObj.finishChooseApp();
2289    +        };
2290    +        appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
2291    +        // The finishChooseApp is called from appChooserCallback
2292    +        return;
2293    +      }
2294     #else
2295           var nsIFilePicker = Components.interfaces.nsIFilePicker;
2296           var fp = Components.classes["@mozilla.org/filepicker;1"]
2297                              .createInstance(nsIFilePicker);
2298           fp.init(this.mDialog,
2299                   this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
2300                   nsIFilePicker.modeOpen);
2301    
2302  diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp  diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
2303  --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp  --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
2304  +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp  +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
# Line 2282  diff --git a/toolkit/system/unixproxy/ns Line 2396  diff --git a/toolkit/system/unixproxy/ns
2396  diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build  diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
2397  --- a/toolkit/xre/moz.build  --- a/toolkit/xre/moz.build
2398  +++ b/toolkit/xre/moz.build  +++ b/toolkit/xre/moz.build
2399  @@ -48,17 +48,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui  @@ -40,17 +40,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
2400   elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':           'updaterfileutils_osx.mm',
      EXPORTS += ['nsQAppInstance.h']  
      SOURCES += [  
          '!moc_nsNativeAppSupportQt.cpp',  
          'nsNativeAppSupportQt.cpp',  
          'nsQAppInstance.cpp',  
2401       ]       ]
2402   elif CONFIG['MOZ_ENABLE_GTK']:   elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
2403         UNIFIED_SOURCES += [
2404             'nsNativeAppSupportDefault.cpp',
2405             'UIKitDirProvider.mm',
2406         ]
2407     elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
2408  +    EXPORTS += ['nsKDEUtils.h']  +    EXPORTS += ['nsKDEUtils.h']
2409       UNIFIED_SOURCES += [       UNIFIED_SOURCES += [
2410  +        'nsKDEUtils.cpp',  +        'nsKDEUtils.cpp',
# Line 2306  diff --git a/toolkit/xre/nsKDEUtils.cpp Line 2420  diff --git a/toolkit/xre/nsKDEUtils.cpp
2420  new file mode 100644  new file mode 100644
2421  --- /dev/null  --- /dev/null
2422  +++ b/toolkit/xre/nsKDEUtils.cpp  +++ b/toolkit/xre/nsKDEUtils.cpp
2423  @@ -0,0 +1,339 @@  @@ -0,0 +1,344 @@
2424  +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */  +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2425  +/* This Source Code Form is subject to the terms of the Mozilla Public  +/* This Source Code Form is subject to the terms of the Mozilla Public
2426  + * License, v. 2.0. If a copy of the MPL was not distributed with this  + * License, v. 2.0. If a copy of the MPL was not distributed with this
# Line 2327  new file mode 100644 Line 2441  new file mode 100644
2441  +#include <sys/resource.h>  +#include <sys/resource.h>
2442  +#include <unistd.h>  +#include <unistd.h>
2443  +#include <X11/Xlib.h>  +#include <X11/Xlib.h>
2444    +// copied from X11/X.h as a hack since for an unknown
2445    +// reason it's not picked up from X11/X.h
2446    +#ifndef None
2447    +#define None                 0L /* universal null resource or null atom */
2448    +#endif
2449  +  +
2450  +//#define DEBUG_KDE  +//#define DEBUG_KDE
2451  +#ifdef DEBUG_KDE  +#ifdef DEBUG_KDE
# Line 2702  new file mode 100644 Line 2821  new file mode 100644
2821  diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build  diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
2822  --- a/uriloader/exthandler/moz.build  --- a/uriloader/exthandler/moz.build
2823  +++ b/uriloader/exthandler/moz.build  +++ b/uriloader/exthandler/moz.build
2824  @@ -75,17 +75,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui  @@ -77,17 +77,19 @@ else:
  else:  
      # These files can't be built in unified mode because they redefine LOG.  
2825       SOURCES += [       SOURCES += [
2826           osdir + '/nsOSHelperAppService.cpp',           osdir + '/nsOSHelperAppService.cpp',
2827       ]       ]
2828         if CONFIG['GNU_CXX']:
2829             CXXFLAGS += ['-Wno-error=shadow']
2830    
2831   if CONFIG['MOZ_ENABLE_GTK']:   if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
2832       UNIFIED_SOURCES += [       UNIFIED_SOURCES += [
2833  +        'unix/nsCommonRegistry.cpp',  +        'unix/nsCommonRegistry.cpp',
2834           'unix/nsGNOMERegistry.cpp',           'unix/nsGNOMERegistry.cpp',
# Line 2722  diff --git a/uriloader/exthandler/moz.bu Line 2841  diff --git a/uriloader/exthandler/moz.bu
2841           'android/nsExternalSharingAppService.cpp',           'android/nsExternalSharingAppService.cpp',
2842           'android/nsExternalURLHandlerService.cpp',           'android/nsExternalURLHandlerService.cpp',
2843           'android/nsMIMEInfoAndroid.cpp',           'android/nsMIMEInfoAndroid.cpp',
2844  @@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m  @@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m
2845    
2846   FINAL_LIBRARY = 'xul'   FINAL_LIBRARY = 'xul'
2847    
# Line 2738  diff --git a/uriloader/exthandler/moz.bu Line 2857  diff --git a/uriloader/exthandler/moz.bu
2857       CXXFLAGS += CONFIG['TK_CFLAGS']       CXXFLAGS += CONFIG['TK_CFLAGS']
2858       CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']       CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
2859    
2860   if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):   if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
2861       CXXFLAGS += CONFIG['TK_CFLAGS']       CXXFLAGS += CONFIG['TK_CFLAGS']
2862  diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp  diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
2863  new file mode 100644  new file mode 100644
# Line 2966  new file mode 100644 Line 3085  new file mode 100644
3085  diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp  diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
3086  --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp  --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
3087  +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp  +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
3088  @@ -7,32 +7,35 @@  @@ -1,50 +1,53 @@
3089   #ifdef MOZ_WIDGET_QT   /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3090   #if (MOZ_ENABLE_CONTENTACTION)    *
3091   #include <contentaction/contentaction.h>    * This Source Code Form is subject to the terms of the Mozilla Public
3092   #include "nsContentHandlerApp.h"    * License, v. 2.0. If a copy of the MPL was not distributed with this
3093   #endif    * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  #endif  
3094    
3095   #include "nsMIMEInfoUnix.h"   #include "nsMIMEInfoUnix.h"
3096  -#include "nsGNOMERegistry.h"  -#include "nsGNOMERegistry.h"
# Line 2984  diff --git a/uriloader/exthandler/unix/n Line 3102  diff --git a/uriloader/exthandler/unix/n
3102   #ifdef MOZ_ENABLE_DBUS   #ifdef MOZ_ENABLE_DBUS
3103   #include "nsDBusHandlerApp.h"   #include "nsDBusHandlerApp.h"
3104   #endif   #endif
  #ifdef MOZ_WIDGET_QT  
  #include "nsMIMEInfoQt.h"  
  #endif  
3105  +#if defined(XP_UNIX) && !defined(XP_MACOSX)  +#if defined(XP_UNIX) && !defined(XP_MACOSX)
3106  +#include "nsKDEUtils.h"  +#include "nsKDEUtils.h"
3107  +#endif  +#endif
# Line 2994  diff --git a/uriloader/exthandler/unix/n Line 3109  diff --git a/uriloader/exthandler/unix/n
3109   nsresult   nsresult
3110   nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)   nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
3111   {   {
3112  -  nsresult rv = nsGNOMERegistry::LoadURL(aURI);  -  return nsGNOMERegistry::LoadURL(aURI);
3113  +  nsresult rv = nsCommonRegistry::LoadURL(aURI);  +  return nsCommonRegistry::LoadURL(aURI);
3114     }
  #ifdef MOZ_WIDGET_QT  
    if (NS_FAILED(rv)) {  
      rv = nsMIMEInfoQt::LoadUriInternal(aURI);  
    }  
  #endif  
3115    
3116     return rv;   NS_IMETHODIMP
3117  @@ -45,24 +48,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo   nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
3118     {
3119       // if mDefaultApplication is set, it means the application has been set from
3120     // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to     // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
3121     // give the GNOME answer.     // give the GNOME answer.
3122     if (mDefaultApplication)     if (mDefaultApplication)
# Line 3032  diff --git a/uriloader/exthandler/unix/n Line 3144  diff --git a/uriloader/exthandler/unix/n
3144    
3145     if (*_retval)     if (*_retval)
3146       return NS_OK;       return NS_OK;
3147  @@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns  @@ -79,16 +82,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
3148       ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));       ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
3149     if (action.isValid()) {     if (action.isValid()) {
3150       action.trigger();       action.trigger();
# Line 3158  diff --git a/uriloader/exthandler/unix/n Line 3270  diff --git a/uriloader/exthandler/unix/n
3270  diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build  diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
3271  --- a/widget/gtk/moz.build  --- a/widget/gtk/moz.build
3272  +++ b/widget/gtk/moz.build  +++ b/widget/gtk/moz.build
3273  @@ -86,16 +86,17 @@ else:  @@ -101,16 +101,17 @@ else:
3274   include('/ipc/chromium/chromium-config.mozbuild')   include('/ipc/chromium/chromium-config.mozbuild')
3275    
3276   FINAL_LIBRARY = 'xul'   FINAL_LIBRARY = 'xul'
# Line 3267  diff --git a/widget/gtk/nsFilePicker.cpp Line 3379  diff --git a/widget/gtk/nsFilePicker.cpp
3379       GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));       GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
3380    
3381     GtkFileChooserAction action = GetGtkFileChooserAction(mMode);     GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
3382     const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)  
3383  @@ -595,8 +615,235 @@ nsFilePicker::Done(GtkWidget* file_choos  @@ -603,8 +623,235 @@ nsFilePicker::Done(GtkWidget* file_choos
3384     if (mCallback) {     if (mCallback) {
3385       mCallback->Done(result);       mCallback->Done(result);
3386       mCallback = nullptr;       mCallback = nullptr;
# Line 3531  diff --git a/widget/gtk/nsFilePicker.h b Line 3643  diff --git a/widget/gtk/nsFilePicker.h b
3643  diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp  diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
3644  --- a/xpcom/components/ManifestParser.cpp  --- a/xpcom/components/ManifestParser.cpp
3645  +++ b/xpcom/components/ManifestParser.cpp  +++ b/xpcom/components/ManifestParser.cpp
3646  @@ -35,16 +35,17 @@  @@ -32,16 +32,17 @@
3647     #include "nsTextFormatter.h"
3648     #include "nsVersionComparator.h"
3649     #include "nsXPCOMCIDInternal.h"
3650    
3651   #include "nsIConsoleService.h"   #include "nsIConsoleService.h"
3652   #include "nsIScriptError.h"   #include "nsIScriptError.h"
3653   #include "nsIXULAppInfo.h"   #include "nsIXULAppInfo.h"
3654   #include "nsIXULRuntime.h"   #include "nsIXULRuntime.h"
  #ifdef MOZ_B2G_LOADER  
  #include "mozilla/XPTInterfaceInfoManager.h"  
  #endif  
3655  +#include "nsKDEUtils.h"  +#include "nsKDEUtils.h"
3656    
3657   #ifdef MOZ_B2G_LOADER   using namespace mozilla;
3658   #define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest  
3659   #define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT   struct ManifestDirective
3660   #else   {
3661   #define XPTONLY_MANIFEST nullptr     const char* directive;
3662   #define XPTONLY_XPT nullptr     int argc;
3663   #endif  
3664  @@ -494,16 +495,17 @@ ParseManifest(NSLocationType aType, File  @@ -472,16 +473,17 @@ ParseManifest(NSLocationType aType, File
3665     NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");     NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
3666     NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");     NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
3667     NS_NAMED_LITERAL_STRING(kApplication, "application");     NS_NAMED_LITERAL_STRING(kApplication, "application");
# Line 3567  diff --git a/xpcom/components/ManifestPa Line 3679  diff --git a/xpcom/components/ManifestPa
3679     NS_NAMED_LITERAL_STRING(kMain, "main");     NS_NAMED_LITERAL_STRING(kMain, "main");
3680     NS_NAMED_LITERAL_STRING(kContent, "content");     NS_NAMED_LITERAL_STRING(kContent, "content");
3681    
3682  @@ -554,44 +556,49 @@ ParseManifest(NSLocationType aType, File  @@ -532,44 +534,49 @@ ParseManifest(NSLocationType aType, File
3683           CopyUTF8toUTF16(s, abi);           CopyUTF8toUTF16(s, abi);
3684           abi.Insert(char16_t('_'), 0);           abi.Insert(char16_t('_'), 0);
3685           abi.Insert(osTarget, 0);           abi.Insert(osTarget, 0);
# Line 3582  diff --git a/xpcom/components/ManifestPa Line 3694  diff --git a/xpcom/components/ManifestPa
3694   #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx   #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
3695     OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };     OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
3696     if (GetVersionEx(&info)) {     if (GetVersionEx(&info)) {
3697       nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),       nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
3698                                 info.dwMajorVersion,                                 info.dwMajorVersion,
3699                                 info.dwMinorVersion);                                 info.dwMinorVersion);
3700     }     }
# Line 3591  diff --git a/xpcom/components/ManifestPa Line 3703  diff --git a/xpcom/components/ManifestPa
3703   #elif defined(MOZ_WIDGET_COCOA)   #elif defined(MOZ_WIDGET_COCOA)
3704     SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();     SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
3705     SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();     SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
3706     nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),     nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
3707                               majorVersion,                               majorVersion,
3708                               minorVersion);                               minorVersion);
3709  +  desktop = NS_LITERAL_STRING("macosx");  +  desktop = NS_LITERAL_STRING("macosx");
3710   #elif defined(MOZ_WIDGET_GTK)   #elif defined(MOZ_WIDGET_GTK)
3711     nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),     nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
3712                               gtk_major_version,                               gtk_major_version,
3713                               gtk_minor_version);                               gtk_minor_version);
3714  +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");  +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
# Line 3606  diff --git a/xpcom/components/ManifestPa Line 3718  diff --git a/xpcom/components/ManifestPa
3718       mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",       mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
3719                                                              "RELEASE",                                                              "RELEASE",
3720                                                              osVersion);                                                              osVersion);
3721       isTablet = mozilla::widget::GeckoAppShell::IsTablet();       isTablet = java::GeckoAppShell::IsTablet();
3722     }     }
3723  +  desktop = NS_LITERAL_STRING("android");  +  desktop = NS_LITERAL_STRING("android");
3724   #endif   #endif
# Line 3617  diff --git a/xpcom/components/ManifestPa Line 3729  diff --git a/xpcom/components/ManifestPa
3729       process = kMain;       process = kMain;
3730     }     }
3731    
3732  @@ -694,25 +701,27 @@ ParseManifest(NSLocationType aType, File  @@ -672,25 +679,27 @@ ParseManifest(NSLocationType aType, File
3733       TriState stOsVersion = eUnspecified;       TriState stOsVersion = eUnspecified;
3734       TriState stOs = eUnspecified;       TriState stOs = eUnspecified;
3735       TriState stABI = eUnspecified;       TriState stABI = eUnspecified;
# Line 3645  diff --git a/xpcom/components/ManifestPa Line 3757  diff --git a/xpcom/components/ManifestPa
3757         }         }
3758    
3759   #if defined(MOZ_WIDGET_ANDROID)   #if defined(MOZ_WIDGET_ANDROID)
3760  @@ -762,16 +771,17 @@ ParseManifest(NSLocationType aType, File  @@ -740,16 +749,17 @@ ParseManifest(NSLocationType aType, File
3761       }       }
3762    
3763       if (!ok ||       if (!ok ||
# Line 3666  diff --git a/xpcom/components/ManifestPa Line 3778  diff --git a/xpcom/components/ManifestPa
3778  diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build  diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
3779  --- a/xpcom/components/moz.build  --- a/xpcom/components/moz.build
3780  +++ b/xpcom/components/moz.build  +++ b/xpcom/components/moz.build
3781  @@ -47,12 +47,13 @@ FINAL_LIBRARY = 'xul'  @@ -44,12 +44,13 @@ FINAL_LIBRARY = 'xul'
3782   LOCAL_INCLUDES += [   LOCAL_INCLUDES += [
3783       '!..',       '!..',
3784       '../base',       '../base',
# Line 3678  diff --git a/xpcom/components/moz.build Line 3790  diff --git a/xpcom/components/moz.build
3790  +    '/toolkit/xre'  +    '/toolkit/xre'
3791   ]   ]
3792    
3793   if CONFIG['MOZ_WIDGET_GTK']:   if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
3794       CXXFLAGS += CONFIG['TK_CFLAGS']       CXXFLAGS += CONFIG['TK_CFLAGS']
3795  diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp  diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
3796  --- a/xpcom/io/nsLocalFileUnix.cpp  --- a/xpcom/io/nsLocalFileUnix.cpp
3797  +++ b/xpcom/io/nsLocalFileUnix.cpp  +++ b/xpcom/io/nsLocalFileUnix.cpp
3798  @@ -47,16 +47,17 @@  @@ -46,16 +46,17 @@
3799   #include "prproces.h"   #include "prproces.h"
3800   #include "nsIDirectoryEnumerator.h"   #include "nsIDirectoryEnumerator.h"
3801   #include "nsISimpleEnumerator.h"   #include "nsISimpleEnumerator.h"
# Line 3701  diff --git a/xpcom/io/nsLocalFileUnix.cp Line 3813  diff --git a/xpcom/io/nsLocalFileUnix.cp
3813   #include "prmem.h"   #include "prmem.h"
3814   #include "plbase64.h"   #include "plbase64.h"
3815    
3816  @@ -1963,42 +1964,52 @@ nsLocalFile::SetPersistentDescriptor(con  @@ -1948,42 +1949,52 @@ nsLocalFile::SetPersistentDescriptor(con
3817     return InitWithNativePath(aPersistentDescriptor);     return InitWithNativePath(aPersistentDescriptor);
3818   #endif   #endif
3819   }   }
# Line 3760  diff --git a/xpcom/io/nsLocalFileUnix.cp Line 3872  diff --git a/xpcom/io/nsLocalFileUnix.cp
3872       return rv;       return rv;
3873     }     }
3874     return NS_ERROR_FAILURE;     return NS_ERROR_FAILURE;
3875  @@ -2006,16 +2017,22 @@ nsLocalFile::Reveal()  @@ -1991,16 +2002,22 @@ nsLocalFile::Reveal()
3876     return NS_ERROR_FAILURE;     return NS_ERROR_FAILURE;
3877   #endif   #endif
3878   }   }

Legend:
Removed from v.1097033  
changed lines
  Added in v.1097034

  ViewVC Help
Powered by ViewVC 1.1.30