mozilla-kde.patch
branchfirefox64
changeset 1082 821cfbe8efcc
parent 1074 4b99400f6d17
child 1085 87f893cf45b9
equal deleted inserted replaced
1081:9fec29d2ead2 1082:821cfbe8efcc
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  06a62125ffbb15e88dacb486169d8e6a9595bd78
     2 # Parent  d685597ba96ea004052e40ec0c80f422ea0e365c
     3 Description: Add KDE integration to Firefox (toolkit parts)
     3 Description: Add KDE integration to Firefox (toolkit parts)
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     5 Author: Lubos Lunak <lunak@suse.com>
     5 Author: Lubos Lunak <lunak@suse.com>
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     8 
     8 
     9 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
     9 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
    10 --- a/modules/libpref/Preferences.cpp
    10 --- a/modules/libpref/Preferences.cpp
    11 +++ b/modules/libpref/Preferences.cpp
    11 +++ b/modules/libpref/Preferences.cpp
    12 @@ -80,16 +80,17 @@
    12 @@ -81,16 +81,17 @@
    13  #include "nsXPCOMCID.h"
    13  #include "nsXPCOMCID.h"
    14  #include "nsXPCOM.h"
    14  #include "nsXPCOM.h"
    15  #include "nsXULAppAPI.h"
    15  #include "nsXULAppAPI.h"
    16  #include "nsZipArchive.h"
    16  #include "nsZipArchive.h"
    17  #include "plbase64.h"
    17  #include "plbase64.h"
    25  #endif
    25  #endif
    26  
    26  
    27  #ifdef XP_WIN
    27  #ifdef XP_WIN
    28  #include "windows.h"
    28  #include "windows.h"
    29  #endif
    29  #endif
    30 @@ -4932,25 +4933,37 @@ Preferences::InitInitialObjects(bool aIs
    30 @@ -4908,25 +4909,37 @@ Preferences::InitInitialObjects(bool aIs
    31    // application pref files for backwards compatibility.
    31    // application pref files for backwards compatibility.
    32    static const char* specialFiles[] = {
    32    static const char* specialFiles[] = {
    33  #if defined(XP_MACOSX)
    33  #if defined(XP_MACOSX)
    34      "macprefs.js"
    34      "macprefs.js"
    35  #elif defined(XP_WIN)
    35  #elif defined(XP_WIN)
    63      NS_WARNING("Error parsing application default preferences.");
    63      NS_WARNING("Error parsing application default preferences.");
    64    }
    64    }
    65  
    65  
    66    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    66    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    67    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
    67    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
    68 @@ -4999,17 +5012,17 @@ Preferences::InitInitialObjects(bool aIs
    68 @@ -4975,17 +4988,17 @@ Preferences::InitInitialObjects(bool aIs
    69        }
    69        }
    70  
    70  
    71        nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
    71        nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
    72        if (!path) {
    72        if (!path) {
    73          continue;
    73          continue;
   169  with Files('**'):
   169  with Files('**'):
   170      BUG_COMPONENT = ('Toolkit', 'Downloads API')
   170      BUG_COMPONENT = ('Toolkit', 'Downloads API')
   171 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   171 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   172 --- a/toolkit/content/jar.mn
   172 --- a/toolkit/content/jar.mn
   173 +++ b/toolkit/content/jar.mn
   173 +++ b/toolkit/content/jar.mn
   174 @@ -70,16 +70,18 @@ toolkit.jar:
   174 @@ -68,16 +68,18 @@ toolkit.jar:
       
   175     content/global/bindings/calendar.js         (widgets/calendar.js)
   175     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
   176     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
   176     content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
       
   177     content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
   177     content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
   178     content/global/bindings/datepicker.js       (widgets/datepicker.js)
   178     content/global/bindings/datepicker.js       (widgets/datepicker.js)
   179     content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
   179     content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
   180     content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
   180     content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
   181     content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
   181     content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
   182  *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
   182  *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
   183 +*  content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)
   183 +*  content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)
   184 +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
   184 +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
   185  *  content/global/bindings/findbar.xml         (widgets/findbar.xml)
       
   186     content/global/bindings/general.xml         (widgets/general.xml)
   185     content/global/bindings/general.xml         (widgets/general.xml)
   187     content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
   186     content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
   188     content/global/bindings/menu.xml            (widgets/menu.xml)
   187     content/global/bindings/menu.xml            (widgets/menu.xml)
   189     content/global/bindings/menulist.xml        (widgets/menulist.xml)
   188     content/global/bindings/menulist.xml        (widgets/menulist.xml)
   190     content/global/bindings/notification.xml    (widgets/notification.xml)
   189     content/global/bindings/notification.xml    (widgets/notification.xml)
   191     content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
   190     content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
   192     content/global/bindings/popup.xml           (widgets/popup.xml)
   191     content/global/bindings/popup.xml           (widgets/popup.xml)
       
   192     content/global/bindings/radio.xml           (widgets/radio.xml)
   193 diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
   193 diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
   194 new file mode 100644
   194 new file mode 100644
   195 --- /dev/null
   195 --- /dev/null
   196 +++ b/toolkit/content/widgets/dialog-kde.xml
   196 +++ b/toolkit/content/widgets/dialog-kde.xml
   197 @@ -0,0 +1,475 @@
   197 @@ -0,0 +1,475 @@
   671 +
   671 +
   672 +</bindings>
   672 +</bindings>
   673 diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
   673 diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
   674 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
   674 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
   675 +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
   675 +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
   676 @@ -1030,30 +1030,60 @@ nsUnknownContentTypeDialog.prototype = {
   676 @@ -1031,30 +1031,60 @@ nsUnknownContentTypeDialog.prototype = {
   677  
   677  
   678        if (params.handlerApp &&
   678        if (params.handlerApp &&
   679            params.handlerApp.executable &&
   679            params.handlerApp.executable &&
   680            params.handlerApp.executable.isFile()) {
   680            params.handlerApp.executable.isFile()) {
   681          // Remember the file they chose to run.
   681          // Remember the file they chose to run.
   843 +}
   843 +}
   844 +
   844 +
   845 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
   845 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
   846 --- a/toolkit/xre/moz.build
   846 --- a/toolkit/xre/moz.build
   847 +++ b/toolkit/xre/moz.build
   847 +++ b/toolkit/xre/moz.build
   848 @@ -67,17 +67,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
   848 @@ -68,17 +68,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
   849          '../components/printingui',
   849          '../components/printingui',
   850      ]
   850      ]
   851  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
   851  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
   852      UNIFIED_SOURCES += [
   852      UNIFIED_SOURCES += [
   853          'nsNativeAppSupportDefault.cpp',
   853          'nsNativeAppSupportDefault.cpp',
  1686  #include "nsReadableUtils.h"
  1686  #include "nsReadableUtils.h"
  1687  #include "nsUnicharUtils.h"
  1687  #include "nsUnicharUtils.h"
  1688  #include "nsIURL.h"
  1688  #include "nsIURL.h"
  1689  #include "nsIFileStreams.h"
  1689  #include "nsIFileStreams.h"
  1690  #include "nsILineInputStream.h"
  1690  #include "nsILineInputStream.h"
  1691 @@ -1125,17 +1125,17 @@ nsOSHelperAppService::GetHandlerAndDescr
  1691 @@ -1122,17 +1122,17 @@ nsOSHelperAppService::GetHandlerAndDescr
  1692  
  1692  
  1693  nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists)
  1693  nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists)
  1694  {
  1694  {
  1695    nsresult rv = NS_OK;
  1695    nsresult rv = NS_OK;
  1696  
  1696  
  1705    } else {
  1705    } else {
  1706      *aHandlerExists = false;
  1706      *aHandlerExists = false;
  1707      nsCOMPtr<nsIHandlerService> handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv);
  1707      nsCOMPtr<nsIHandlerService> handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv);
  1708      if (NS_SUCCEEDED(rv) && handlerSvc) {
  1708      if (NS_SUCCEEDED(rv) && handlerSvc) {
  1709        rv = handlerSvc->ExistsForProtocol(nsCString(aProtocolScheme), aHandlerExists);
  1709        rv = handlerSvc->ExistsForProtocol(nsCString(aProtocolScheme), aHandlerExists);
  1710 @@ -1143,17 +1143,17 @@ nsresult nsOSHelperAppService::OSProtoco
  1710 @@ -1140,17 +1140,17 @@ nsresult nsOSHelperAppService::OSProtoco
  1711    }
  1711    }
  1712  
  1712  
  1713    return rv;
  1713    return rv;
  1714  }
  1714  }
  1715  
  1715  
  1724  #endif
  1724  #endif
  1725  }
  1725  }
  1726  
  1726  
  1727  nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
  1727  nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
  1728  {
  1728  {
  1729 @@ -1240,17 +1240,17 @@ nsOSHelperAppService::GetFromExtension(c
  1729 @@ -1237,17 +1237,17 @@ nsOSHelperAppService::GetFromExtension(c
  1730                                           mime_types_description,
  1730                                           mime_types_description,
  1731                                           true);
  1731                                           true);
  1732  
  1732  
  1733    if (NS_FAILED(rv) || majorType.IsEmpty()) {
  1733    if (NS_FAILED(rv) || majorType.IsEmpty()) {
  1734  
  1734  
  1743      }
  1743      }
  1744  #endif
  1744  #endif
  1745  
  1745  
  1746      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  1746      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  1747                                    majorType,
  1747                                    majorType,
  1748 @@ -1361,17 +1361,17 @@ nsOSHelperAppService::GetFromType(const 
  1748 @@ -1358,17 +1358,17 @@ nsOSHelperAppService::GetFromType(const 
  1749    nsAutoString extensions, mime_types_description;
  1749    nsAutoString extensions, mime_types_description;
  1750    LookUpExtensionsAndDescription(majorType,
  1750    LookUpExtensionsAndDescription(majorType,
  1751                                   minorType,
  1751                                   minorType,
  1752                                   extensions,
  1752                                   extensions,
  1753                                   mime_types_description);
  1753                                   mime_types_description);
  1882    GtkWindow *parent_widget =
  1882    GtkWindow *parent_widget =
  1883      GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
  1883      GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
  1884  
  1884  
  1885    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
  1885    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
  1886  
  1886  
  1887 @@ -608,8 +635,233 @@ nsFilePicker::Done(GtkWidget* file_choos
  1887 @@ -600,16 +627,241 @@ nsFilePicker::Done(void* file_chooser, g
  1888    if (mCallback) {
       
  1889      mCallback->Done(result);
  1888      mCallback->Done(result);
  1890      mCallback = nullptr;
  1889      mCallback = nullptr;
  1891    } else {
  1890    } else {
  1892      mResult = result;
  1891      mResult = result;
  1893    }
  1892    }
  1894    NS_RELEASE_THIS();
  1893    NS_RELEASE_THIS();
  1895  }
  1894  }
  1896 +
  1895  
  1897 +nsCString nsFilePicker::kdeMakeFilter( int index )
  1896 +nsCString nsFilePicker::kdeMakeFilter( int index )
  1898 +    {
  1897 +    {
  1899 +    nsCString buf = mFilters[ index ];
  1898 +    nsCString buf = mFilters[ index ];
  1900 +    for( PRUint32 i = 0;
  1899 +    for( PRUint32 i = 0;
  1901 +         i < buf.Length();
  1900 +         i < buf.Length();
  2116 +        *aReturn = nsIFilePicker::returnCancel;
  2115 +        *aReturn = nsIFilePicker::returnCancel;
  2117 +        }
  2116 +        }
  2118 +    return NS_OK;
  2117 +    return NS_OK;
  2119 +    }
  2118 +    }
  2120 +
  2119 +
       
  2120 +
       
  2121  // All below functions available as of GTK 3.20+
       
  2122  
       
  2123  void *
       
  2124  nsFilePicker::GtkFileChooserNew(
       
  2125          const gchar *title, GtkWindow *parent,
       
  2126          GtkFileChooserAction action,
       
  2127          const gchar *accept_label)
       
  2128  {
  2121 diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
  2129 diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
  2122 --- a/widget/gtk/nsFilePicker.h
  2130 --- a/widget/gtk/nsFilePicker.h
  2123 +++ b/widget/gtk/nsFilePicker.h
  2131 +++ b/widget/gtk/nsFilePicker.h
  2124 @@ -69,14 +69,20 @@ protected:
  2132 @@ -69,16 +69,22 @@ protected:
  2125    nsString  mDefaultExtension;
  2133    nsString  mDefaultExtension;
  2126  
  2134  
  2127    nsTArray<nsCString> mFilters;
  2135    nsTArray<nsCString> mFilters;
  2128    nsTArray<nsCString> mFilterNames;
  2136    nsTArray<nsCString> mFilterNames;
  2129  
  2137  
  2134 +  bool getKdeRunning();
  2142 +  bool getKdeRunning();
  2135 +  NS_IMETHODIMP kdeFileDialog(PRInt16 *aReturn);
  2143 +  NS_IMETHODIMP kdeFileDialog(PRInt16 *aReturn);
  2136 +  NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
  2144 +  NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
  2137 +  nsCString kdeMakeFilter( int index );
  2145 +  nsCString kdeMakeFilter( int index );
  2138 +
  2146 +
  2139  #ifdef MOZ_WIDGET_GTK
  2147    void *GtkFileChooserNew(
  2140    GtkFileChooserWidget *mFileChooserDelegate;
  2148            const gchar *title, GtkWindow *parent,
  2141  #endif
  2149            GtkFileChooserAction action,
  2142  };
  2150            const gchar *accept_label);
  2143  
  2151    void GtkFileChooserShow(void *file_chooser);
  2144  #endif
  2152    void GtkFileChooserDestroy(void *file_chooser);
       
  2153    void GtkFileChooserSetModal(void *file_chooser, GtkWindow* parent_widget,
       
  2154            gboolean modal);
  2145 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  2155 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  2146 --- a/xpcom/components/ManifestParser.cpp
  2156 --- a/xpcom/components/ManifestParser.cpp
  2147 +++ b/xpcom/components/ManifestParser.cpp
  2157 +++ b/xpcom/components/ManifestParser.cpp
  2148 @@ -33,16 +33,17 @@
  2158 @@ -33,16 +33,17 @@
  2149  #include "nsTextFormatter.h"
  2159  #include "nsTextFormatter.h"
  2161  struct ManifestDirective
  2171  struct ManifestDirective
  2162  {
  2172  {
  2163    const char* directive;
  2173    const char* directive;
  2164    int argc;
  2174    int argc;
  2165  
  2175  
  2166 @@ -419,16 +420,17 @@ ParseManifest(NSLocationType aType, File
  2176 @@ -421,16 +422,17 @@ ParseManifest(NSLocationType aType, File
  2167    NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
  2177    NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
  2168    NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
  2178    NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
  2169    NS_NAMED_LITERAL_STRING(kApplication, "application");
  2179    NS_NAMED_LITERAL_STRING(kApplication, "application");
  2170    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  2180    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  2171    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  2181    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  2179  #endif
  2189  #endif
  2180  
  2190  
  2181    NS_NAMED_LITERAL_STRING(kMain, "main");
  2191    NS_NAMED_LITERAL_STRING(kMain, "main");
  2182    NS_NAMED_LITERAL_STRING(kContent, "content");
  2192    NS_NAMED_LITERAL_STRING(kContent, "content");
  2183  
  2193  
  2184 @@ -474,44 +476,49 @@ ParseManifest(NSLocationType aType, File
  2194 @@ -476,44 +478,49 @@ ParseManifest(NSLocationType aType, File
  2185          CopyUTF8toUTF16(s, abi);
  2195          CopyUTF8toUTF16(s, abi);
  2186          abi.Insert(char16_t('_'), 0);
  2196          abi.Insert(char16_t('_'), 0);
  2187          abi.Insert(osTarget, 0);
  2197          abi.Insert(osTarget, 0);
  2188        }
  2198        }
  2189      }
  2199      }
  2229      process = kContent;
  2239      process = kContent;
  2230    } else {
  2240    } else {
  2231      process = kMain;
  2241      process = kMain;
  2232    }
  2242    }
  2233  
  2243  
  2234 @@ -598,25 +605,27 @@ ParseManifest(NSLocationType aType, File
  2244 @@ -600,25 +607,27 @@ ParseManifest(NSLocationType aType, File
  2235      TriState stOsVersion = eUnspecified;
  2245      TriState stOsVersion = eUnspecified;
  2236      TriState stOs = eUnspecified;
  2246      TriState stOs = eUnspecified;
  2237      TriState stABI = eUnspecified;
  2247      TriState stABI = eUnspecified;
  2238      TriState stProcess = eUnspecified;
  2248      TriState stProcess = eUnspecified;
  2239  #if defined(MOZ_WIDGET_ANDROID)
  2249  #if defined(MOZ_WIDGET_ANDROID)
  2257            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  2267            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  2258          continue;
  2268          continue;
  2259        }
  2269        }
  2260  
  2270  
  2261  #if defined(MOZ_WIDGET_ANDROID)
  2271  #if defined(MOZ_WIDGET_ANDROID)
  2262 @@ -661,16 +670,17 @@ ParseManifest(NSLocationType aType, File
  2272 @@ -663,16 +672,17 @@ ParseManifest(NSLocationType aType, File
  2263      }
  2273      }
  2264  
  2274  
  2265      if (!ok ||
  2275      if (!ok ||
  2266          stApp == eBad ||
  2276          stApp == eBad ||
  2267          stAppVersion == eBad ||
  2277          stAppVersion == eBad ||