48 create mode 100644 uriloader/exthandler/unix/nsKDERegistry.h |
48 create mode 100644 uriloader/exthandler/unix/nsKDERegistry.h |
49 |
49 |
50 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp |
50 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp |
51 --- a/modules/libpref/Preferences.cpp |
51 --- a/modules/libpref/Preferences.cpp |
52 +++ b/modules/libpref/Preferences.cpp |
52 +++ b/modules/libpref/Preferences.cpp |
53 @@ -91,16 +91,17 @@ |
53 @@ -90,16 +90,17 @@ |
54 #include "PLDHashTable.h" |
54 #include "PLDHashTable.h" |
55 #include "prdtoa.h" |
55 #include "prdtoa.h" |
56 #include "prlink.h" |
56 #include "prlink.h" |
57 #include "xpcpublic.h" |
57 #include "xpcpublic.h" |
58 #include "js/RootingAPI.h" |
58 #include "js/RootingAPI.h" |
1233 # include "mozilla/Logging.h" |
1233 # include "mozilla/Logging.h" |
1234 # include "nsTArray.h" |
1234 # include "nsTArray.h" |
1235 # include "Units.h" |
1235 # include "Units.h" |
1236 extern mozilla::LazyLogModule gWidgetLog; |
1236 extern mozilla::LazyLogModule gWidgetLog; |
1237 # define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args) |
1237 # define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args) |
1238 @@ -305,17 +308,18 @@ nsFilePicker::AppendFilters(int32_t aFil |
1238 @@ -302,17 +305,18 @@ nsFilePicker::AppendFilters(int32_t aFil |
1239 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1239 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1240 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1240 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1241 } |
1241 } |
1242 |
1242 |
1243 NS_IMETHODIMP |
1243 NS_IMETHODIMP |
1253 CopyUTF16toUTF8(aFilter, filter); |
1253 CopyUTF16toUTF8(aFilter, filter); |
1254 CopyUTF16toUTF8(aTitle, name); |
1254 CopyUTF16toUTF8(aTitle, name); |
1255 |
1255 |
1256 mFilters.AppendElement(filter); |
1256 mFilters.AppendElement(filter); |
1257 mFilterNames.AppendElement(name); |
1257 mFilterNames.AppendElement(name); |
1258 @@ -415,16 +419,41 @@ nsresult nsFilePicker::Show(nsIFilePicke |
1258 @@ -412,16 +416,39 @@ nsresult nsFilePicker::Show(nsIFilePicke |
1259 return NS_OK; |
1259 return NS_OK; |
1260 } |
1260 } |
1261 |
1261 |
1262 NS_IMETHODIMP |
1262 NS_IMETHODIMP |
1263 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1263 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1264 // Can't show two dialogs concurrently with the same filepicker |
1264 // Can't show two dialogs concurrently with the same filepicker |
1265 if (mRunning) return NS_ERROR_NOT_AVAILABLE; |
1265 if (mFileChooser) return NS_ERROR_NOT_AVAILABLE; |
1266 |
1266 |
1267 + // KDE file picker is not handled via callback |
1267 + // KDE file picker is not handled via callback |
1268 + if (nsKDEUtils::kdeSupport()) { |
1268 + if (nsKDEUtils::kdeSupport()) { |
1269 + mCallback = aCallback; |
1269 + mCallback = aCallback; |
1270 + mRunning = true; |
|
1271 + NS_ADDREF_THIS(); |
1270 + NS_ADDREF_THIS(); |
1272 + g_idle_add( |
1271 + g_idle_add( |
1273 + [](gpointer data) -> gboolean { |
1272 + [](gpointer data) -> gboolean { |
1274 + nsFilePicker* queuedPicker = (nsFilePicker*)data; |
1273 + nsFilePicker* queuedPicker = (nsFilePicker*)data; |
1275 + nsIFilePicker::ResultCode result; |
1274 + nsIFilePicker::ResultCode result; |
1278 + queuedPicker->mCallback->Done(result); |
1277 + queuedPicker->mCallback->Done(result); |
1279 + queuedPicker->mCallback = nullptr; |
1278 + queuedPicker->mCallback = nullptr; |
1280 + } else { |
1279 + } else { |
1281 + queuedPicker->mResult = result; |
1280 + queuedPicker->mResult = result; |
1282 + } |
1281 + } |
1283 + queuedPicker->mRunning = false; |
|
1284 + NS_RELEASE(queuedPicker); |
1282 + NS_RELEASE(queuedPicker); |
1285 + return G_SOURCE_REMOVE; |
1283 + return G_SOURCE_REMOVE; |
1286 + }, |
1284 + }, |
1287 + this); |
1285 + this); |
1288 + |
1286 + |
1295 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1293 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1296 |
1294 |
1297 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1295 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1298 |
1296 |
1299 const gchar* accept_button; |
1297 const gchar* accept_button; |
1300 @@ -696,16 +725,215 @@ void nsFilePicker::Done(void* file_choos |
1298 @@ -703,16 +730,215 @@ void nsFilePicker::Done(void* file_choos |
1301 mCallback->Done(result); |
1299 mCallback->Done(result); |
1302 mCallback = nullptr; |
1300 mCallback = nullptr; |
1303 } else { |
1301 } else { |
1304 mResult = result; |
1302 mResult = result; |
1305 } |
1303 } |