mozilla-kde.patch
branchfirefox53
changeset 965 17fe7b84cafe
parent 961 4665fe34fbce
child 979 f82a374a310d
equal deleted inserted replaced
964:218a4e337cfe 965:17fe7b84cafe
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  2b1505c8ca6fc80da9cf517b029a93c452cb9876
     2 # Parent  564e9441f71b5bc368c33697428f756f5914eb04
     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
  3323    CopyUTF16toUTF8(aFilter, filter);
  3323    CopyUTF16toUTF8(aFilter, filter);
  3324    CopyUTF16toUTF8(aTitle, name);
  3324    CopyUTF16toUTF8(aTitle, name);
  3325  
  3325  
  3326    mFilters.AppendElement(filter);
  3326    mFilters.AppendElement(filter);
  3327    mFilterNames.AppendElement(name);
  3327    mFilterNames.AppendElement(name);
  3328 @@ -371,16 +375,32 @@ nsFilePicker::Show(int16_t *aReturn)
  3328 @@ -371,16 +375,34 @@ nsFilePicker::Show(int16_t *aReturn)
  3329  
  3329  
  3330  NS_IMETHODIMP
  3330  NS_IMETHODIMP
  3331  nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
  3331  nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
  3332  {
  3332  {
  3333    // Can't show two dialogs concurrently with the same filepicker
  3333    // Can't show two dialogs concurrently with the same filepicker
  3337 +  // KDE file picker is not handled via callback
  3337 +  // KDE file picker is not handled via callback
  3338 +  if( nsKDEUtils::kdeSupport()) {
  3338 +  if( nsKDEUtils::kdeSupport()) {
  3339 +    int16_t result;
  3339 +    int16_t result;
  3340 +    mCallback = aCallback;
  3340 +    mCallback = aCallback;
  3341 +    mRunning = true;
  3341 +    mRunning = true;
       
  3342 +    NS_ADDREF_THIS();
  3342 +    kdeFileDialog(&result);
  3343 +    kdeFileDialog(&result);
  3343 +    if (mCallback) {
  3344 +    if (mCallback) {
  3344 +      mCallback->Done(result);
  3345 +      mCallback->Done(result);
  3345 +      mCallback = nullptr;
  3346 +      mCallback = nullptr;
  3346 +    } else {
  3347 +    } else {
  3347 +      mResult = result;
  3348 +      mResult = result;
  3348 +    }
  3349 +    }
  3349 +    mRunning = false;
  3350 +    mRunning = false;
       
  3351 +    NS_RELEASE_THIS();
  3350 +    return NS_OK;
  3352 +    return NS_OK;
  3351 +  }
  3353 +  }
  3352 +
  3354 +
  3353    nsXPIDLCString title;
  3355    nsXPIDLCString title;
  3354    title.Adopt(ToNewUTF8String(mTitle));
  3356    title.Adopt(ToNewUTF8String(mTitle));
  3356    GtkWindow *parent_widget =
  3358    GtkWindow *parent_widget =
  3357      GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
  3359      GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
  3358  
  3360  
  3359    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
  3361    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
  3360  
  3362  
  3361 @@ -603,8 +623,235 @@ nsFilePicker::Done(GtkWidget* file_choos
  3363 @@ -603,8 +625,235 @@ nsFilePicker::Done(GtkWidget* file_choos
  3362    if (mCallback) {
  3364    if (mCallback) {
  3363      mCallback->Done(result);
  3365      mCallback->Done(result);
  3364      mCallback = nullptr;
  3366      mCallback = nullptr;
  3365    } else {
  3367    } else {
  3366      mResult = result;
  3368      mResult = result;