42 |
42 |
43 #include "prefapi.h" |
43 #include "prefapi.h" |
44 #include "prefread.h" |
44 #include "prefread.h" |
45 #include "prefapi_private_data.h" |
45 #include "prefapi_private_data.h" |
46 |
46 |
47 @@ -1119,16 +1120,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char |
47 @@ -1134,16 +1135,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char |
48 |
48 |
49 static nsresult pref_LoadPrefsInDirList(const char *listId) |
49 static nsresult pref_LoadPrefsInDirList(const char *listId) |
50 { |
50 { |
51 nsresult rv; |
51 nsresult rv; |
52 nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
52 nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
96 |
96 |
97 static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name) |
97 static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name) |
98 { |
98 { |
99 nsZipItemPtr<char> manifest(jarReader, name, true); |
99 nsZipItemPtr<char> manifest(jarReader, name, true); |
100 NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); |
100 NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); |
101 @@ -1248,26 +1267,38 @@ static nsresult pref_InitInitialObjects( |
101 @@ -1263,26 +1282,38 @@ static nsresult pref_InitInitialObjects( |
102 /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ |
102 /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ |
103 static const char* specialFiles[] = { |
103 static const char* specialFiles[] = { |
104 #if defined(XP_MACOSX) |
104 #if defined(XP_MACOSX) |
105 "macprefs.js" |
105 "macprefs.js" |
106 #elif defined(XP_WIN) |
106 #elif defined(XP_WIN) |
194 - |
194 - |
195 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
195 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
196 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp |
196 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp |
197 --- a/toolkit/components/downloads/nsDownloadManager.cpp |
197 --- a/toolkit/components/downloads/nsDownloadManager.cpp |
198 +++ b/toolkit/components/downloads/nsDownloadManager.cpp |
198 +++ b/toolkit/components/downloads/nsDownloadManager.cpp |
199 @@ -42,16 +42,20 @@ |
199 @@ -43,16 +43,20 @@ |
200 #ifdef XP_WIN |
200 #ifdef XP_WIN |
201 #include <shlobj.h> |
201 #include <shlobj.h> |
202 #include "nsWindowsHelpers.h" |
202 #include "nsWindowsHelpers.h" |
203 #ifdef DOWNLOAD_SCANNER |
203 #ifdef DOWNLOAD_SCANNER |
204 #include "nsDownloadScanner.h" |
204 #include "nsDownloadScanner.h" |
215 |
215 |
216 #ifdef MOZ_WIDGET_ANDROID |
216 #ifdef MOZ_WIDGET_ANDROID |
217 #include "AndroidBridge.h" |
217 #include "AndroidBridge.h" |
218 using namespace mozilla::widget::android; |
218 using namespace mozilla::widget::android; |
219 #endif |
219 #endif |
220 @@ -2695,16 +2699,25 @@ nsDownload::SetState(DownloadState aStat |
220 @@ -2722,16 +2726,25 @@ nsDownload::SetState(DownloadState aStat |
221 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
221 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
222 |
222 |
223 // Master pref to control this function. |
223 // Master pref to control this function. |
224 bool showTaskbarAlert = true; |
224 bool showTaskbarAlert = true; |
225 if (pref) |
225 if (pref) |
241 |
241 |
242 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
242 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
243 int64_t goat = PR_Now() - mStartTime; |
243 int64_t goat = PR_Now() - mStartTime; |
244 showTaskbarAlert = goat > alertIntervalUSec; |
244 showTaskbarAlert = goat > alertIntervalUSec; |
245 |
245 |
246 @@ -2732,19 +2745,20 @@ nsDownload::SetState(DownloadState aStat |
246 @@ -2759,19 +2772,20 @@ nsDownload::SetState(DownloadState aStat |
247 // because if it is, they'll click open the download manager and |
247 // because if it is, they'll click open the download manager and |
248 // the items they downloaded will have been removed. |
248 // the items they downloaded will have been removed. |
249 alerts->ShowAlertNotification( |
249 alerts->ShowAlertNotification( |
250 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
250 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
251 message, !removeWhenDone, |
251 message, !removeWhenDone, |
266 if (fileURL && |
266 if (fileURL && |
267 NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) && |
267 NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) && |
268 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn |
268 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn |
269 --- a/toolkit/content/jar.mn |
269 --- a/toolkit/content/jar.mn |
270 +++ b/toolkit/content/jar.mn |
270 +++ b/toolkit/content/jar.mn |
271 @@ -56,29 +56,33 @@ toolkit.jar: |
271 @@ -58,29 +58,33 @@ toolkit.jar: |
272 content/global/viewZoomOverlay.js (viewZoomOverlay.js) |
272 content/global/viewZoomOverlay.js (viewZoomOverlay.js) |
273 *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) |
273 *+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) |
274 content/global/bindings/browser.xml (widgets/browser.xml) |
274 content/global/bindings/browser.xml (widgets/browser.xml) |
275 content/global/bindings/button.xml (widgets/button.xml) |
275 content/global/bindings/button.xml (widgets/button.xml) |
276 content/global/bindings/checkbox.xml (widgets/checkbox.xml) |
276 content/global/bindings/checkbox.xml (widgets/checkbox.xml) |
288 *+ content/global/bindings/listbox.xml (widgets/listbox.xml) |
288 *+ content/global/bindings/listbox.xml (widgets/listbox.xml) |
289 content/global/bindings/menu.xml (widgets/menu.xml) |
289 content/global/bindings/menu.xml (widgets/menu.xml) |
290 content/global/bindings/menulist.xml (widgets/menulist.xml) |
290 content/global/bindings/menulist.xml (widgets/menulist.xml) |
291 content/global/bindings/notification.xml (widgets/notification.xml) |
291 content/global/bindings/notification.xml (widgets/notification.xml) |
292 content/global/bindings/numberbox.xml (widgets/numberbox.xml) |
292 content/global/bindings/numberbox.xml (widgets/numberbox.xml) |
293 content/global/bindings/popup.xml (widgets/popup.xml) |
293 * content/global/bindings/popup.xml (widgets/popup.xml) |
294 *+ content/global/bindings/preferences.xml (widgets/preferences.xml) |
294 *+ content/global/bindings/preferences.xml (widgets/preferences.xml) |
295 +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml) |
295 +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml) |
296 +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde |
296 +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde |
297 content/global/bindings/progressmeter.xml (widgets/progressmeter.xml) |
297 content/global/bindings/progressmeter.xml (widgets/progressmeter.xml) |
298 content/global/bindings/radio.xml (widgets/radio.xml) |
298 content/global/bindings/radio.xml (widgets/radio.xml) |
758 +</bindings> |
758 +</bindings> |
759 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml |
759 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml |
760 new file mode 100644 |
760 new file mode 100644 |
761 --- /dev/null |
761 --- /dev/null |
762 +++ b/toolkit/content/widgets/preferences-kde.xml |
762 +++ b/toolkit/content/widgets/preferences-kde.xml |
763 @@ -0,0 +1,1334 @@ |
763 @@ -0,0 +1,1333 @@ |
764 +<?xml version="1.0"?> |
764 +<?xml version="1.0"?> |
765 + |
765 + |
766 +<!DOCTYPE bindings [ |
766 +<!DOCTYPE bindings [ |
767 + <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd"> |
767 + <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd"> |
768 + %preferencesDTD; |
768 + %preferencesDTD; |
1333 + <xul:hbox flex="1" class="paneDeckContainer"> |
1333 + <xul:hbox flex="1" class="paneDeckContainer"> |
1334 + <xul:deck anonid="paneDeck" flex="1"> |
1334 + <xul:deck anonid="paneDeck" flex="1"> |
1335 + <children includes="prefpane"/> |
1335 + <children includes="prefpane"/> |
1336 + </xul:deck> |
1336 + </xul:deck> |
1337 + </xul:hbox> |
1337 + </xul:hbox> |
1338 + <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" |
1338 + <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" pack="end"> |
1339 +#ifdef XP_UNIX_GNOME |
1339 +#ifdef XP_UNIX_GNOME |
1340 + > |
|
1341 + <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/> |
1340 + <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/> |
1342 + <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/> |
1341 + <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/> |
1343 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1342 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1344 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1343 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1345 + <xul:spacer anonid="spacer" flex="1"/> |
1344 + <xul:spacer anonid="spacer" flex="1"/> |
1346 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1345 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1347 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1346 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1348 +#elif XP_UNIX |
1347 +#elif XP_UNIX |
1349 + pack="end"> |
1348 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1350 + <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/> |
1349 + <xul:spacer anonid="spacer" flex="1"/> |
1351 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1350 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1352 + <xul:spacer anonid="spacer" flex="1"/> |
1351 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1353 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1352 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1354 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1353 + <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/> |
1355 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1354 + <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/> |
1356 + <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/> |
|
1357 +#else |
1355 +#else |
1358 + pack="end"> |
|
1359 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1356 + <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/> |
1360 + <xul:spacer anonid="spacer" flex="1"/> |
1357 + <xul:spacer anonid="spacer" flex="1"/> |
1361 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1358 + <xul:button dlgtype="accept" class="dialog-button" icon="accept"/> |
1362 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1359 + <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/> |
1363 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1360 + <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/> |
1382 + acceptButton.hidden = true; |
1379 + acceptButton.hidden = true; |
1383 + var cancelButton = docElt.getButton("cancel"); |
1380 + var cancelButton = docElt.getButton("cancel"); |
1384 +#ifdef XP_MACOSX |
1381 +#ifdef XP_MACOSX |
1385 + // no buttons on Mac except Help |
1382 + // no buttons on Mac except Help |
1386 + cancelButton.hidden = true; |
1383 + cancelButton.hidden = true; |
|
1384 + // Move Help button to the end |
|
1385 + document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true; |
1387 + // Also, don't fire onDialogAccept on enter |
1386 + // Also, don't fire onDialogAccept on enter |
1388 + acceptButton.disabled = true; |
1387 + acceptButton.disabled = true; |
1389 +#else |
1388 +#else |
1390 + // morph the Cancel button into the Close button |
1389 + // morph the Cancel button into the Close button |
1391 + cancelButton.setAttribute ("icon", "close"); |
1390 + cancelButton.setAttribute ("icon", "close"); |
2127 nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult); |
2126 nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult); |
2128 nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult); |
2127 nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult); |
2129 + nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult); |
2128 + nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult); |
2130 }; |
2129 }; |
2131 |
2130 |
2132 NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings) |
2131 NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) |
2133 |
2132 |
2134 NS_IMETHODIMP |
2133 NS_IMETHODIMP |
2135 nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly) |
2134 nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly) |
2136 { |
2135 { |
2137 // dbus prevents us from being threadsafe, but this routine should not block anyhow |
2136 // dbus prevents us from being threadsafe, but this routine should not block anyhow |
2898 nsAutoCString spec; |
2897 nsAutoCString spec; |
2899 aURI->GetAsciiSpec(spec); |
2898 aURI->GetAsciiSpec(spec); |
2900 if (QDesktopServices::openUrl(QUrl(spec.get()))) { |
2899 if (QDesktopServices::openUrl(QUrl(spec.get()))) { |
2901 rv = NS_OK; |
2900 rv = NS_OK; |
2902 } |
2901 } |
2903 @@ -48,22 +51,22 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo |
2902 @@ -50,24 +53,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo |
2904 { |
|
2905 // if mDefaultApplication is set, it means the application has been set from |
|
2906 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
2903 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
2907 // give the GNOME answer. |
2904 // give the GNOME answer. |
2908 if (mDefaultApplication) |
2905 if (mDefaultApplication) |
2909 return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); |
2906 return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); |
2910 |
2907 |
2911 *_retval = false; |
2908 *_retval = false; |
2912 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); |
2909 |
2913 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType); |
2910 if (mClass == eProtocolInfo) { |
2914 if (!mimeInfo) { |
2911 - *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get()); |
2915 nsAutoCString ext; |
2912 + *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get()); |
2916 nsresult rv = GetPrimaryExtension(ext); |
2913 } else { |
2917 if (NS_SUCCEEDED(rv)) { |
2914 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); |
2918 - mimeInfo = nsGNOMERegistry::GetFromExtension(ext); |
2915 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType); |
2919 + mimeInfo = nsCommonRegistry::GetFromExtension(ext); |
2916 if (!mimeInfo) { |
|
2917 nsAutoCString ext; |
|
2918 nsresult rv = GetPrimaryExtension(ext); |
|
2919 if (NS_SUCCEEDED(rv)) { |
|
2920 - mimeInfo = nsGNOMERegistry::GetFromExtension(ext); |
|
2921 + mimeInfo = nsCommonRegistry::GetFromExtension(ext); |
|
2922 } |
2920 } |
2923 } |
|
2924 if (mimeInfo) |
|
2925 *_retval = true; |
2921 } |
2926 } |
2922 if (mimeInfo) |
|
2923 *_retval = true; |
|
2924 |
2927 |
2925 if (*_retval) |
2928 if (*_retval) |
2926 return NS_OK; |
2929 return NS_OK; |
2927 |
2930 @@ -102,16 +105,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
2928 @@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
|
2929 ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); |
2931 ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); |
2930 if (action.isValid()) { |
2932 if (action.isValid()) { |
2931 action.trigger(); |
2933 action.trigger(); |
2932 return NS_OK; |
2934 return NS_OK; |
2933 } |
2935 } |
2957 // nsGIOMimeApp->Launch wants a URI string instead of local file |
2959 // nsGIOMimeApp->Launch wants a URI string instead of local file |
2958 nsresult rv; |
2960 nsresult rv; |
2959 nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); |
2961 nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); |
2960 NS_ENSURE_SUCCESS(rv, rv); |
2962 NS_ENSURE_SUCCESS(rv, rv); |
2961 nsCOMPtr<nsIURI> uri; |
2963 nsCOMPtr<nsIURI> uri; |
2962 @@ -124,17 +144,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
2964 @@ -129,17 +149,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
2963 /* Fallback to GnomeVFS */ |
2965 /* Fallback to GnomeVFS */ |
2964 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
2966 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
2965 if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
2967 if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
2966 return app->Launch(nativePath); |
2968 return app->Launch(nativePath); |
2967 } |
2969 } |
2998 #include "nsReadableUtils.h" |
3000 #include "nsReadableUtils.h" |
2999 #include "nsUnicharUtils.h" |
3001 #include "nsUnicharUtils.h" |
3000 #include "nsXPIDLString.h" |
3002 #include "nsXPIDLString.h" |
3001 #include "nsIURL.h" |
3003 #include "nsIURL.h" |
3002 #include "nsIFileStreams.h" |
3004 #include "nsIFileStreams.h" |
3003 @@ -1157,26 +1157,26 @@ nsresult nsOSHelperAppService::OSProtoco |
3005 @@ -1146,26 +1146,26 @@ nsresult nsOSHelperAppService::OSProtoco |
3004 ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':'); |
3006 ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':'); |
3005 |
3007 |
3006 if (action.isValid()) |
3008 if (action.isValid()) |
3007 *aHandlerExists = true; |
3009 *aHandlerExists = true; |
3008 #endif |
3010 #endif |
3027 #endif |
3029 #endif |
3028 } |
3030 } |
3029 |
3031 |
3030 nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile) |
3032 nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile) |
3031 { |
3033 { |
3032 @@ -1263,17 +1263,17 @@ nsOSHelperAppService::GetFromExtension(c |
3034 @@ -1252,17 +1252,17 @@ nsOSHelperAppService::GetFromExtension(c |
3033 mime_types_description, |
3035 mime_types_description, |
3034 true); |
3036 true); |
3035 |
3037 |
3036 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
3038 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
3037 |
3039 |
3038 #ifdef MOZ_WIDGET_GTK |
3040 #ifdef MOZ_WIDGET_GTK |
3039 LOG(("Looking in GNOME registry\n")); |
3041 LOG(("Looking in GNOME registry\n")); |
3040 nsRefPtr<nsMIMEInfoBase> gnomeInfo = |
3042 nsRefPtr<nsMIMEInfoBase> gnomeInfo = |
3041 - nsGNOMERegistry::GetFromExtension(aFileExt); |
3043 - nsGNOMERegistry::GetFromExtension(aFileExt); |
3042 + nsCommonRegistry::GetFromExtension(aFileExt); |
3044 + nsCommonRegistry::GetFromExtension(aFileExt); |
3046 } |
3048 } |
3047 #endif |
3049 #endif |
3048 |
3050 |
3049 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), |
3051 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), |
3050 majorType, |
3052 majorType, |
3051 @@ -1386,17 +1386,17 @@ nsOSHelperAppService::GetFromType(const |
3053 @@ -1372,17 +1372,17 @@ nsOSHelperAppService::GetFromType(const |
3052 #ifdef MOZ_WIDGET_GTK |
3054 #ifdef MOZ_WIDGET_GTK |
3053 nsRefPtr<nsMIMEInfoBase> gnomeInfo; |
3055 nsRefPtr<nsMIMEInfoBase> gnomeInfo; |
3054 if (handler.IsEmpty()) { |
3056 if (handler.IsEmpty()) { |
3055 // No useful data yet. Check the GNOME registry. Unfortunately, newer |
3057 // No useful data yet. Check the GNOME registry. Unfortunately, newer |
3056 // GNOME versions no longer have type-to-extension mappings, so we might |
3058 // GNOME versions no longer have type-to-extension mappings, so we might |
3057 // get back a MIMEInfo without any extensions set. In that case we'll have |
3059 // get back a MIMEInfo without any extensions set. In that case we'll have |
3058 // to look in our mime.types files for the extensions. |
3060 // to look in our mime.types files for the extensions. |
3059 LOG(("Looking in GNOME registry\n")); |
3061 LOG(("Looking in GNOME registry\n")); |
3060 - gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); |
3062 - gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); |
3061 + gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); |
3063 + gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); |
3062 if (gnomeInfo && gnomeInfo->HasExtensions()) { |
3064 if (gnomeInfo && gnomeInfo->HasExtensions()) { |
3063 LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n")); |
3065 LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n")); |
3141 CopyUTF16toUTF8(aFilter, filter); |
3143 CopyUTF16toUTF8(aFilter, filter); |
3142 CopyUTF16toUTF8(aTitle, name); |
3144 CopyUTF16toUTF8(aTitle, name); |
3143 |
3145 |
3144 mFilters.AppendElement(filter); |
3146 mFilters.AppendElement(filter); |
3145 mFilterNames.AppendElement(name); |
3147 mFilterNames.AppendElement(name); |
3146 @@ -350,16 +354,32 @@ nsFilePicker::Show(int16_t *aReturn) |
3148 @@ -351,16 +355,32 @@ nsFilePicker::Show(int16_t *aReturn) |
3147 |
3149 |
3148 NS_IMETHODIMP |
3150 NS_IMETHODIMP |
3149 nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) |
3151 nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) |
3150 { |
3152 { |
3151 // Can't show two dialogs concurrently with the same filepicker |
3153 // Can't show two dialogs concurrently with the same filepicker |
3174 GtkWindow *parent_widget = |
3176 GtkWindow *parent_widget = |
3175 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
3177 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
3176 |
3178 |
3177 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
3179 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
3178 const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE) |
3180 const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE) |
3179 @@ -538,8 +558,235 @@ nsFilePicker::Done(GtkWidget* file_choos |
3181 @@ -539,8 +559,235 @@ nsFilePicker::Done(GtkWidget* file_choos |
3180 if (mCallback) { |
3182 if (mCallback) { |
3181 mCallback->Done(result); |
3183 mCallback->Done(result); |
3182 mCallback = nullptr; |
3184 mCallback = nullptr; |
3183 } else { |
3185 } else { |
3184 mResult = result; |
3186 mResult = result; |
3598 #include <Carbon/Carbon.h> |
3600 #include <Carbon/Carbon.h> |
3599 #include "CocoaFileUtils.h" |
3601 #include "CocoaFileUtils.h" |
3600 #include "prmem.h" |
3602 #include "prmem.h" |
3601 #include "plbase64.h" |
3603 #include "plbase64.h" |
3602 |
3604 |
3603 @@ -1813,46 +1814,52 @@ nsLocalFile::SetPersistentDescriptor(con |
3605 @@ -1816,46 +1817,52 @@ nsLocalFile::SetPersistentDescriptor(con |
3604 return InitWithNativePath(aPersistentDescriptor); |
3606 return InitWithNativePath(aPersistentDescriptor); |
3605 #endif |
3607 #endif |
3606 } |
3608 } |
3607 |
3609 |
3608 NS_IMETHODIMP |
3610 NS_IMETHODIMP |