1 # HG changeset patch |
1 # HG changeset patch |
2 # Parent aba9432d1fd32a118ba24e92c6b6e99ddb0b9bdc |
2 # Parent 2b183c17f6e4693372442af1a8ee0be364f8cba0 |
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 |
44 |
44 |
45 #include "prefapi.h" |
45 #include "prefapi.h" |
46 #include "prefread.h" |
46 #include "prefread.h" |
47 #include "prefapi_private_data.h" |
47 #include "prefapi_private_data.h" |
48 |
48 |
49 @@ -1172,16 +1173,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char |
49 @@ -1165,16 +1166,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char |
50 |
50 |
51 static nsresult pref_LoadPrefsInDirList(const char *listId) |
51 static nsresult pref_LoadPrefsInDirList(const char *listId) |
52 { |
52 { |
53 nsresult rv; |
53 nsresult rv; |
54 nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
54 nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
79 getter_AddRefs(list)); |
79 getter_AddRefs(list)); |
80 if (!list) |
80 if (!list) |
81 return NS_OK; |
81 return NS_OK; |
82 |
82 |
83 bool hasMore; |
83 bool hasMore; |
84 @@ -1197,17 +1216,17 @@ static nsresult pref_LoadPrefsInDirList( |
84 @@ -1190,17 +1209,17 @@ static nsresult pref_LoadPrefsInDirList( |
85 |
85 |
86 nsAutoCString leaf; |
86 nsAutoCString leaf; |
87 path->GetNativeLeafName(leaf); |
87 path->GetNativeLeafName(leaf); |
88 |
88 |
89 // Do we care if a file provided by this process fails to load? |
89 // Do we care if a file provided by this process fails to load? |
98 |
98 |
99 static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name) |
99 static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name) |
100 { |
100 { |
101 nsZipItemPtr<char> manifest(jarReader, name, true); |
101 nsZipItemPtr<char> manifest(jarReader, name, true); |
102 NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); |
102 NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); |
103 @@ -1301,26 +1320,38 @@ static nsresult pref_InitInitialObjects( |
103 @@ -1294,26 +1313,38 @@ static nsresult pref_InitInitialObjects( |
104 /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ |
104 /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ |
105 static const char* specialFiles[] = { |
105 static const char* specialFiles[] = { |
106 #if defined(XP_MACOSX) |
106 #if defined(XP_MACOSX) |
107 "macprefs.js" |
107 "macprefs.js" |
108 #elif defined(XP_WIN) |
108 #elif defined(XP_WIN) |
221 #include <CoreFoundation/CoreFoundation.h> |
221 #include <CoreFoundation/CoreFoundation.h> |
222 #endif |
222 #endif |
223 |
223 |
224 #ifdef MOZ_WIDGET_ANDROID |
224 #ifdef MOZ_WIDGET_ANDROID |
225 #include "AndroidBridge.h" |
225 #include "AndroidBridge.h" |
226 using namespace mozilla::widget::android; |
|
227 #endif |
226 #endif |
228 @@ -2717,16 +2721,25 @@ nsDownload::SetState(DownloadState aStat |
227 |
|
228 @@ -2716,16 +2720,25 @@ nsDownload::SetState(DownloadState aStat |
229 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
229 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
230 |
230 |
231 // Master pref to control this function. |
231 // Master pref to control this function. |
232 bool showTaskbarAlert = true; |
232 bool showTaskbarAlert = true; |
233 if (pref) |
233 if (pref) |
249 |
249 |
250 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
250 int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
251 int64_t goat = PR_Now() - mStartTime; |
251 int64_t goat = PR_Now() - mStartTime; |
252 showTaskbarAlert = goat > alertIntervalUSec; |
252 showTaskbarAlert = goat > alertIntervalUSec; |
253 |
253 |
254 @@ -2757,16 +2770,17 @@ nsDownload::SetState(DownloadState aStat |
254 @@ -2756,16 +2769,17 @@ nsDownload::SetState(DownloadState aStat |
255 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
255 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
256 message, !removeWhenDone, |
256 message, !removeWhenDone, |
257 mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"), |
257 mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"), |
258 mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), |
258 mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), |
259 EmptyString(), EmptyString(), nullptr); |
259 EmptyString(), EmptyString(), nullptr, mPrivate); |
260 } |
260 } |
261 } |
261 } |
262 } |
262 } |
263 + } |
263 + } |
264 |
264 |
3135 ] |
3135 ] |
3136 |
3136 |
3137 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 |
3138 --- a/widget/gtk/nsFilePicker.cpp |
3138 --- a/widget/gtk/nsFilePicker.cpp |
3139 +++ b/widget/gtk/nsFilePicker.cpp |
3139 +++ b/widget/gtk/nsFilePicker.cpp |
3140 @@ -1,32 +1,34 @@ |
3140 @@ -4,32 +4,34 @@ |
3141 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
3142 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3143 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3144 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
3141 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
3145 |
3142 |
3146 #include "mozilla/Types.h" |
3143 #include "mozilla/Types.h" |
|
3144 #include <sys/types.h> |
|
3145 #include <sys/stat.h> |
|
3146 #include <unistd.h> |
3147 |
3147 |
3148 #include <gtk/gtk.h> |
3148 #include <gtk/gtk.h> |
3149 +#include <gdk/gdkx.h> |
3149 +#include <gdk/gdkx.h> |
3150 |
3150 |
3151 #include "nsGtkUtils.h" |
3151 #include "nsGtkUtils.h" |
3170 #define MAX_PREVIEW_SIZE 180 |
3170 #define MAX_PREVIEW_SIZE 180 |
3171 |
3171 |
3172 nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr; |
3172 nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr; |
3173 |
3173 |
3174 void |
3174 void |
3175 @@ -224,17 +226,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
3175 @@ -238,17 +240,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
3176 return nsBaseFilePicker::AppendFilters(aFilterMask); |
3176 return nsBaseFilePicker::AppendFilters(aFilterMask); |
3177 } |
3177 } |
3178 |
3178 |
3179 NS_IMETHODIMP |
3179 NS_IMETHODIMP |
3180 nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) |
3180 nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) |
3191 CopyUTF16toUTF8(aFilter, filter); |
3191 CopyUTF16toUTF8(aFilter, filter); |
3192 CopyUTF16toUTF8(aTitle, name); |
3192 CopyUTF16toUTF8(aTitle, name); |
3193 |
3193 |
3194 mFilters.AppendElement(filter); |
3194 mFilters.AppendElement(filter); |
3195 mFilterNames.AppendElement(name); |
3195 mFilterNames.AppendElement(name); |
3196 @@ -349,16 +353,32 @@ nsFilePicker::Show(int16_t *aReturn) |
3196 @@ -363,16 +367,32 @@ nsFilePicker::Show(int16_t *aReturn) |
3197 |
3197 |
3198 NS_IMETHODIMP |
3198 NS_IMETHODIMP |
3199 nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) |
3199 nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) |
3200 { |
3200 { |
3201 // Can't show two dialogs concurrently with the same filepicker |
3201 // Can't show two dialogs concurrently with the same filepicker |
3224 GtkWindow *parent_widget = |
3224 GtkWindow *parent_widget = |
3225 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
3225 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
3226 |
3226 |
3227 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
3227 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
3228 const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE) |
3228 const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE) |
3229 @@ -537,8 +557,235 @@ nsFilePicker::Done(GtkWidget* file_choos |
3229 @@ -551,8 +571,235 @@ nsFilePicker::Done(GtkWidget* file_choos |
3230 if (mCallback) { |
3230 if (mCallback) { |
3231 mCallback->Done(result); |
3231 mCallback->Done(result); |
3232 mCallback = nullptr; |
3232 mCallback = nullptr; |
3233 } else { |
3233 } else { |
3234 mResult = result; |
3234 mResult = result; |
3559 bool isTablet = false; |
3559 bool isTablet = false; |
3560 if (mozilla::AndroidBridge::Bridge()) { |
3560 if (mozilla::AndroidBridge::Bridge()) { |
3561 mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", |
3561 mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", |
3562 "RELEASE", |
3562 "RELEASE", |
3563 osVersion); |
3563 osVersion); |
3564 isTablet = mozilla::widget::android::GeckoAppShell::IsTablet(); |
3564 isTablet = mozilla::widget::GeckoAppShell::IsTablet(); |
3565 } |
3565 } |
3566 + desktop = NS_LITERAL_STRING("android"); |
3566 + desktop = NS_LITERAL_STRING("android"); |
3567 #endif |
3567 #endif |
3568 |
3568 |
3569 if (XRE_GetProcessType() == GeckoProcessType_Content) { |
3569 if (XRE_GetProcessType() == GeckoProcessType_Content) { |