|
1 # HG changeset patch |
|
2 # Parent aba9432d1fd32a118ba24e92c6b6e99ddb0b9bdc |
1 Description: Add KDE integration to Firefox (toolkit parts) |
3 Description: Add KDE integration to Firefox (toolkit parts) |
2 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
3 Author: Lubos Lunak <lunak@suse.com> |
5 Author: Lubos Lunak <lunak@suse.com> |
4 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 |
6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 |
5 https://bugzilla.novell.com/show_bug.cgi?id=170055 |
7 https://bugzilla.novell.com/show_bug.cgi?id=170055 |
200 |
202 |
201 CXXFLAGS += CONFIG['TK_CFLAGS'] |
203 CXXFLAGS += CONFIG['TK_CFLAGS'] |
202 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp |
204 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp |
203 --- a/toolkit/components/downloads/nsDownloadManager.cpp |
205 --- a/toolkit/components/downloads/nsDownloadManager.cpp |
204 +++ b/toolkit/components/downloads/nsDownloadManager.cpp |
206 +++ b/toolkit/components/downloads/nsDownloadManager.cpp |
205 @@ -44,16 +44,20 @@ |
207 @@ -46,16 +46,20 @@ |
206 #ifdef XP_WIN |
208 #ifdef XP_WIN |
207 #include <shlobj.h> |
209 #include <shlobj.h> |
208 #include "nsWindowsHelpers.h" |
210 #include "nsWindowsHelpers.h" |
209 #ifdef DOWNLOAD_SCANNER |
211 #ifdef DOWNLOAD_SCANNER |
210 #include "nsDownloadScanner.h" |
212 #include "nsDownloadScanner.h" |
221 |
223 |
222 #ifdef MOZ_WIDGET_ANDROID |
224 #ifdef MOZ_WIDGET_ANDROID |
223 #include "AndroidBridge.h" |
225 #include "AndroidBridge.h" |
224 using namespace mozilla::widget::android; |
226 using namespace mozilla::widget::android; |
225 #endif |
227 #endif |
226 @@ -2712,16 +2716,25 @@ nsDownload::SetState(DownloadState aStat |
228 @@ -2717,16 +2721,25 @@ nsDownload::SetState(DownloadState aStat |
227 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
229 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
228 |
230 |
229 // Master pref to control this function. |
231 // Master pref to control this function. |
230 bool showTaskbarAlert = true; |
232 bool showTaskbarAlert = true; |
231 if (pref) |
233 if (pref) |
247 |
249 |
248 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
250 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
249 int64_t goat = PR_Now() - mStartTime; |
251 int64_t goat = PR_Now() - mStartTime; |
250 showTaskbarAlert = goat > alertIntervalUSec; |
252 showTaskbarAlert = goat > alertIntervalUSec; |
251 |
253 |
252 @@ -2752,16 +2765,17 @@ nsDownload::SetState(DownloadState aStat |
254 @@ -2757,16 +2770,17 @@ nsDownload::SetState(DownloadState aStat |
253 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
255 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
254 message, !removeWhenDone, |
256 message, !removeWhenDone, |
255 mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"), |
257 mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"), |
256 mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), |
258 mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), |
257 EmptyString(), EmptyString(), nullptr); |
259 EmptyString(), EmptyString(), nullptr); |
268 if (fileURL && |
270 if (fileURL && |
269 NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) && |
271 NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) && |
270 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn |
272 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn |
271 --- a/toolkit/content/jar.mn |
273 --- a/toolkit/content/jar.mn |
272 +++ b/toolkit/content/jar.mn |
274 +++ b/toolkit/content/jar.mn |
273 @@ -55,29 +55,33 @@ toolkit.jar: |
275 @@ -57,29 +57,33 @@ toolkit.jar: |
274 content/global/viewZoomOverlay.js (viewZoomOverlay.js) |
276 content/global/viewZoomOverlay.js (viewZoomOverlay.js) |
275 *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) |
277 *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) |
276 content/global/bindings/browser.xml (widgets/browser.xml) |
278 content/global/bindings/browser.xml (widgets/browser.xml) |
277 content/global/bindings/button.xml (widgets/button.xml) |
279 content/global/bindings/button.xml (widgets/button.xml) |
278 content/global/bindings/checkbox.xml (widgets/checkbox.xml) |
280 content/global/bindings/checkbox.xml (widgets/checkbox.xml) |
766 +</bindings> |
768 +</bindings> |
767 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml |
769 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml |
768 new file mode 100644 |
770 new file mode 100644 |
769 --- /dev/null |
771 --- /dev/null |
770 +++ b/toolkit/content/widgets/preferences-kde.xml |
772 +++ b/toolkit/content/widgets/preferences-kde.xml |
771 @@ -0,0 +1,1343 @@ |
773 @@ -0,0 +1,1350 @@ |
772 +<?xml version="1.0"?> |
774 +<?xml version="1.0"?> |
773 + |
775 + |
774 +<!DOCTYPE bindings [ |
776 +<!DOCTYPE bindings [ |
775 + <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd"> |
777 + <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd"> |
776 + %preferencesDTD; |
778 + %preferencesDTD; |
901 + this.preferences.rootBranchInternal |
903 + this.preferences.rootBranchInternal |
902 + .addObserver(this.name, this.preferences, false); |
904 + .addObserver(this.name, this.preferences, false); |
903 + // In non-instant apply mode, we must try and use the last saved state |
905 + // In non-instant apply mode, we must try and use the last saved state |
904 + // from any previous opens of a child dialog instead of the value from |
906 + // from any previous opens of a child dialog instead of the value from |
905 + // preferences, to pick up any edits a user may have made. |
907 + // preferences, to pick up any edits a user may have made. |
|
908 + |
|
909 + var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"] |
|
910 + .getService(Components.interfaces.nsIScriptSecurityManager); |
906 + if (this.preferences.type == "child" && |
911 + if (this.preferences.type == "child" && |
907 + !this.instantApply && window.opener) { |
912 + !this.instantApply && window.opener && |
|
913 + secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) { |
908 + var pdoc = window.opener.document; |
914 + var pdoc = window.opener.document; |
909 + |
915 + |
910 + // Try to find a preference element for the same preference. |
916 + // Try to find a preference element for the same preference. |
911 + var preference = null; |
917 + var preference = null; |
912 + var parentPreferences = pdoc.getElementsByTagName("preferences"); |
918 + var parentPreferences = pdoc.getElementsByTagName("preferences"); |
1822 + <![CDATA[ |
1828 + <![CDATA[ |
1823 + if (!this._fireEvent("beforeaccept", this)){ |
1829 + if (!this._fireEvent("beforeaccept", this)){ |
1824 + return false; |
1830 + return false; |
1825 + } |
1831 + } |
1826 + |
1832 + |
1827 + if (this.type == "child" && window.opener) { |
1833 + var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"] |
|
1834 + .getService(Components.interfaces.nsIScriptSecurityManager); |
|
1835 + if (this.type == "child" && window.opener && |
|
1836 + secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) { |
1828 + var psvc = Components.classes["@mozilla.org/preferences-service;1"] |
1837 + var psvc = Components.classes["@mozilla.org/preferences-service;1"] |
1829 + .getService(Components.interfaces.nsIPrefBranch); |
1838 + .getService(Components.interfaces.nsIPrefBranch); |
1830 + var instantApply = psvc.getBoolPref("browser.preferences.instantApply"); |
1839 + var instantApply = psvc.getBoolPref("browser.preferences.instantApply"); |
1831 + if (instantApply) { |
1840 + if (instantApply) { |
1832 + var panes = this.preferencePanes; |
1841 + var panes = this.preferencePanes; |
2648 UNIFIED_SOURCES += [ |
2657 UNIFIED_SOURCES += [ |
2649 'android/nsAndroidHandlerApp.cpp', |
2658 'android/nsAndroidHandlerApp.cpp', |
2650 'android/nsExternalSharingAppService.cpp', |
2659 'android/nsExternalSharingAppService.cpp', |
2651 'android/nsExternalURLHandlerService.cpp', |
2660 'android/nsExternalURLHandlerService.cpp', |
2652 'android/nsMIMEInfoAndroid.cpp', |
2661 'android/nsMIMEInfoAndroid.cpp', |
2653 @@ -121,16 +123,17 @@ include('/ipc/chromium/chromium-config.m |
2662 @@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m |
|
2663 |
2654 FINAL_LIBRARY = 'xul' |
2664 FINAL_LIBRARY = 'xul' |
2655 |
2665 |
2656 LOCAL_INCLUDES += [ |
2666 LOCAL_INCLUDES += [ |
2657 '/content/base/src', |
|
2658 '/dom/base', |
2667 '/dom/base', |
2659 '/dom/ipc', |
2668 '/dom/ipc', |
2660 '/netwerk/base/src', |
2669 '/netwerk/base/src', |
2661 '/netwerk/protocol/http', |
2670 '/netwerk/protocol/http', |
2662 + '/toolkit/xre' |
2671 + '/toolkit/xre' |
2893 + |
2902 + |
2894 +#endif //nsKDERegistry_h__ |
2903 +#endif //nsKDERegistry_h__ |
2895 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2904 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2896 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2905 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2897 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2906 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
2898 @@ -10,30 +10,33 @@ |
2907 @@ -7,33 +7,36 @@ |
2899 #include <QString> |
2908 #ifdef MOZ_WIDGET_QT |
2900 #if (MOZ_ENABLE_CONTENTACTION) |
2909 #if (MOZ_ENABLE_CONTENTACTION) |
2901 #include <contentaction/contentaction.h> |
2910 #include <contentaction/contentaction.h> |
2902 #include "nsContentHandlerApp.h" |
2911 #include "nsContentHandlerApp.h" |
2903 #endif |
2912 #endif |
2904 #endif |
2913 #endif |
2912 #include "nsIGnomeVFSService.h" |
2921 #include "nsIGnomeVFSService.h" |
2913 #include "nsAutoPtr.h" |
2922 #include "nsAutoPtr.h" |
2914 #ifdef MOZ_ENABLE_DBUS |
2923 #ifdef MOZ_ENABLE_DBUS |
2915 #include "nsDBusHandlerApp.h" |
2924 #include "nsDBusHandlerApp.h" |
2916 #endif |
2925 #endif |
|
2926 #ifdef MOZ_WIDGET_QT |
|
2927 #include "nsMIMEInfoQt.h" |
|
2928 #endif |
2917 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
2929 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
2918 +#include "nsKDEUtils.h" |
2930 +#include "nsKDEUtils.h" |
2919 +#endif |
2931 +#endif |
2920 |
2932 |
2921 nsresult |
2933 nsresult |
2924 - nsresult rv = nsGNOMERegistry::LoadURL(aURI); |
2936 - nsresult rv = nsGNOMERegistry::LoadURL(aURI); |
2925 + nsresult rv = nsCommonRegistry::LoadURL(aURI); |
2937 + nsresult rv = nsCommonRegistry::LoadURL(aURI); |
2926 |
2938 |
2927 #ifdef MOZ_WIDGET_QT |
2939 #ifdef MOZ_WIDGET_QT |
2928 if (NS_FAILED(rv)) { |
2940 if (NS_FAILED(rv)) { |
2929 nsAutoCString spec; |
2941 rv = nsMIMEInfoQt::LoadUriInternal(aURI); |
2930 aURI->GetAsciiSpec(spec); |
2942 } |
2931 if (QDesktopServices::openUrl(QUrl(spec.get()))) { |
2943 #endif |
2932 rv = NS_OK; |
2944 |
2933 } |
2945 return rv; |
2934 @@ -50,24 +53,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo |
2946 @@ -46,24 +49,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo |
2935 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
2947 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
2936 // give the GNOME answer. |
2948 // give the GNOME answer. |
2937 if (mDefaultApplication) |
2949 if (mDefaultApplication) |
2938 return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); |
2950 return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); |
2939 |
2951 |
2991 // nsGIOMimeApp->Launch wants a URI string instead of local file |
3003 // nsGIOMimeApp->Launch wants a URI string instead of local file |
2992 nsresult rv; |
3004 nsresult rv; |
2993 nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); |
3005 nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); |
2994 NS_ENSURE_SUCCESS(rv, rv); |
3006 NS_ENSURE_SUCCESS(rv, rv); |
2995 nsCOMPtr<nsIURI> uri; |
3007 nsCOMPtr<nsIURI> uri; |
2996 @@ -129,17 +149,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
3008 @@ -125,17 +145,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
2997 /* Fallback to GnomeVFS */ |
3009 /* Fallback to GnomeVFS */ |
2998 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
3010 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
2999 if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
3011 if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
3000 return app->Launch(nativePath); |
3012 return app->Launch(nativePath); |
3001 } |
3013 } |
3102 |
3114 |
3103 // Now look up our extensions |
3115 // Now look up our extensions |
3104 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build |
3116 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build |
3105 --- a/widget/gtk/moz.build |
3117 --- a/widget/gtk/moz.build |
3106 +++ b/widget/gtk/moz.build |
3118 +++ b/widget/gtk/moz.build |
3107 @@ -81,16 +81,17 @@ include('/ipc/chromium/chromium-config.m |
3119 @@ -79,16 +79,17 @@ else: |
|
3120 include('/ipc/chromium/chromium-config.mozbuild') |
|
3121 |
3108 FINAL_LIBRARY = 'xul' |
3122 FINAL_LIBRARY = 'xul' |
3109 |
3123 |
3110 LOCAL_INCLUDES += [ |
3124 LOCAL_INCLUDES += [ |
3111 '../shared', |
|
3112 '../xpwidgets', |
|
3113 '/layout/generic', |
3125 '/layout/generic', |
3114 '/layout/xul', |
3126 '/layout/xul', |
3115 '/other-licenses/atk-1.0', |
3127 '/other-licenses/atk-1.0', |
3116 + '/toolkit/xre' |
3128 + '/toolkit/xre', |
|
3129 '/widget', |
3117 ] |
3130 ] |
3118 |
3131 |
3119 if CONFIG['MOZ_X11']: |
3132 if CONFIG['MOZ_X11']: |
3120 LOCAL_INCLUDES += [ |
3133 LOCAL_INCLUDES += [ |
3121 '../shared/x11', |
3134 '/widget/x11', |
3122 ] |
3135 ] |
3123 |
3136 |
3124 DEFINES['CAIRO_GFX'] = True |
|
3125 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp |
3137 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp |
3126 --- a/widget/gtk/nsFilePicker.cpp |
3138 --- a/widget/gtk/nsFilePicker.cpp |
3127 +++ b/widget/gtk/nsFilePicker.cpp |
3139 +++ b/widget/gtk/nsFilePicker.cpp |
3128 @@ -1,32 +1,34 @@ |
3140 @@ -1,32 +1,34 @@ |
3129 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
3141 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
3624 if CONFIG['MOZ_WIDGET_GTK']: |
3636 if CONFIG['MOZ_WIDGET_GTK']: |
3625 CXXFLAGS += CONFIG['TK_CFLAGS'] |
3637 CXXFLAGS += CONFIG['TK_CFLAGS'] |
3626 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
3638 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
3627 --- a/xpcom/io/nsLocalFileUnix.cpp |
3639 --- a/xpcom/io/nsLocalFileUnix.cpp |
3628 +++ b/xpcom/io/nsLocalFileUnix.cpp |
3640 +++ b/xpcom/io/nsLocalFileUnix.cpp |
3629 @@ -44,16 +44,17 @@ |
3641 @@ -45,16 +45,17 @@ |
3630 #include "nsIDirectoryEnumerator.h" |
3642 #include "nsIDirectoryEnumerator.h" |
3631 #include "nsISimpleEnumerator.h" |
3643 #include "nsISimpleEnumerator.h" |
3632 #include "private/pprio.h" |
3644 #include "private/pprio.h" |
3633 #include "prlink.h" |
3645 #include "prlink.h" |
3634 |
3646 |