mozilla-kde.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Thu, 05 Sep 2019 08:27:52 +0200
branchfirefox69
changeset 1105 611baabe5b83
parent 1099 8a3c73e74e65
child 1106 6c6375987b6c
permissions -rw-r--r--
new merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
828
59013b3a51f5 update to 36.0b3
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 807
diff changeset
     1
# HG changeset patch
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     2
# User msirringhaus@suse.de
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     3
# Date 1559294891 -7200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     4
#      Fri May 31 11:28:11 2019 +0200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     5
# Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
     6
# Parent  93495ad6fa0fe292eadcbfef14e0e27273528497
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     7
Description: Add KDE integration to Firefox (toolkit parts)
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     8
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     9
Author: Lubos Lunak <lunak@suse.com>
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    10
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    11
     https://bugzilla.novell.com/show_bug.cgi?id=170055
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    12
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    13
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    14
--- a/modules/libpref/Preferences.cpp
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    15
+++ b/modules/libpref/Preferences.cpp
1082
821cfbe8efcc Firefox 64.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1074
diff changeset
    16
@@ -81,16 +81,17 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 #include "nsXPCOMCID.h"
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    18
 #include "nsXPCOM.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    19
 #include "nsXULAppAPI.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    20
 #include "nsZipArchive.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    21
 #include "plbase64.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    22
 #include "PLDHashTable.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    23
 #include "plstr.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    24
 #include "prlink.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
 
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    27
 #ifdef MOZ_MEMORY
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    28
 #  include "mozmemory.h"
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    29
 #endif
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    30
 
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    31
 #ifdef XP_WIN
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    32
 #  include "windows.h"
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    33
 #endif
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
    34
@@ -4507,25 +4508,37 @@ static nsresult pref_ReadDefaultPrefs(co
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    35
   // application pref files for backwards compatibility.
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    36
   static const char* specialFiles[] = {
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    37
 #if defined(XP_MACOSX)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    38
     "macprefs.js"
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    39
 #elif defined(XP_WIN)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    40
     "winpref.js"
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    41
 #elif defined(XP_UNIX)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    42
     "unix.js"
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    43
+    , "" // placeholder for KDE  (empty is otherwise harmless)
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    44
 #  if defined(_AIX)
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    45
     ,
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    46
     "aix.js"
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    47
 #  endif
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    48
 #elif defined(XP_BEOS)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    49
     "beos.js"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
 #endif
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    51
   };
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
 
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    53
+  if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
    54
+    for(int i = 0;
716
cef565f1c325 update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 703
diff changeset
    55
+        i < MOZ_ARRAY_LENGTH(specialFiles);
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    56
+        ++i ) {
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    57
+      if( *specialFiles[ i ] == '\0' ) {
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    58
+        specialFiles[ i ] = "kde.js";
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    59
+        break;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
+      }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    61
+    }
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    62
+  }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    63
+
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    64
   rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    65
                            ArrayLength(specialFiles));
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    66
   if (NS_FAILED(rv)) {
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    67
     NS_WARNING("Error parsing application default preferences.");
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    68
   }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    69
 
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    70
   // Load jar:$app/omni.jar!/defaults/preferences/*.js
438
7d934b2f5014 rebased and removed upstreamed and obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 419
diff changeset
    71
   // or jar:$gre/omni.jar!/defaults/preferences/*.js.
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
    72
@@ -4573,17 +4586,17 @@ static nsresult pref_ReadDefaultPrefs(co
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    73
       }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    74
 
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    75
       nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    76
       if (!path) {
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    77
         continue;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    78
       }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    79
 
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    80
       // Do we care if a file provided by this process fails to load?
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    81
-      pref_LoadPrefsInDir(path, nullptr, 0);
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    82
+      pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    83
     }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    84
   }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    85
 
1055
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    86
   if (XRE_IsParentProcess()) {
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    87
     SetupTelemetryPref();
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    88
   }
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    89
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    90
   NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, nullptr,
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    91
diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    92
--- a/modules/libpref/moz.build
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    93
+++ b/modules/libpref/moz.build
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    94
@@ -31,16 +31,20 @@ EXPORTS.mozilla += [
1055
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    95
     'StaticPrefs.h',
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    96
 ]
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    97
 
985
038d048a3940 Firefox 55.0b13
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 982
diff changeset
    98
 UNIFIED_SOURCES += [
038d048a3940 Firefox 55.0b13
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 982
diff changeset
    99
     'Preferences.cpp',
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   100
     'SharedPrefMap.cpp',
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   101
 ]
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   102
 
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   103
+LOCAL_INCLUDES += [
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   104
+    '/toolkit/xre'
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   105
+]
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   106
+
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   107
 XPCOM_MANIFESTS += [
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   108
     'components.conf',
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   109
 ]
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   110
 
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   111
 include('/ipc/chromium/chromium-config.mozbuild')
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   112
 
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   113
 FINAL_LIBRARY = 'xul'
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   114
 
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   115
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   116
--- a/python/mozbuild/mozpack/chrome/flags.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   117
+++ b/python/mozbuild/mozpack/chrome/flags.py
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   118
@@ -223,16 +223,17 @@ class Flags(OrderedDict):
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   119
         'contentaccessible': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   120
         'os': StringFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   121
         'osversion': VersionFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   122
         'abi': StringFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   123
         'platform': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   124
         'xpcnativewrappers': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   125
         'tablet': Flag,
807
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   126
         'process': StringFlag,
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   127
+        'desktop': StringFlag,
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   128
     }
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   129
     RE = re.compile(r'([!<>=]+)')
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   130
 
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   131
     def __init__(self, *flags):
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   132
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   133
         Initialize a set of flags given in string form.
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   134
            flags = Flags('contentaccessible=yes', 'appversion>=3.5')
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   135
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   136
diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   137
--- a/python/mozbuild/mozpack/chrome/manifest.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   138
+++ b/python/mozbuild/mozpack/chrome/manifest.py
1067
735b140fb042 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1055
diff changeset
   139
@@ -39,16 +39,17 @@ class ManifestEntry(object):
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   140
         'platformversion',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   141
         'os',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   142
         'osversion',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   143
         'abi',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   144
         'xpcnativewrappers',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   145
         'tablet',
807
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   146
         'process',
1005
6d716caa6abe 57.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 999
diff changeset
   147
         'contentaccessible',
6d716caa6abe 57.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 999
diff changeset
   148
+	'desktop',
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   149
     ]
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   150
 
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   151
     def __init__(self, base, *flags):
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   152
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   153
         Initialize a manifest entry with the given base path and flags.
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   154
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   155
         self.base = base
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   156
         self.flags = Flags(*flags)
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   157
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   158
--- a/toolkit/components/downloads/moz.build
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   159
+++ b/toolkit/components/downloads/moz.build
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   160
@@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   161
 
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   162
 if CONFIG['MOZ_PLACES']:
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   163
     EXTRA_JS_MODULES += [
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   164
         'DownloadHistory.jsm',
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   165
     ]
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   166
 
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   167
 FINAL_LIBRARY = 'xul'
251
4c9ebbedd59c adopt patches to new base
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 244
diff changeset
   168
 
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   169
+LOCAL_INCLUDES += [
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   170
+    '/toolkit/xre'
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   171
+]
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   172
+
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   173
 with Files('**'):
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   174
     BUG_COMPONENT = ('Toolkit', 'Downloads API')
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   175
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   176
--- a/toolkit/content/jar.mn
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   177
+++ b/toolkit/content/jar.mn
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   178
@@ -63,16 +63,18 @@ toolkit.jar:
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   179
    content/global/widgets.css
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   180
    content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   181
    content/global/bindings/button.xml          (widgets/button.xml)
1082
821cfbe8efcc Firefox 64.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1074
diff changeset
   182
    content/global/bindings/calendar.js         (widgets/calendar.js)
961
4665fe34fbce revert manually previously wrong rebases
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 960
diff changeset
   183
    content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
4665fe34fbce revert manually previously wrong rebases
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 960
diff changeset
   184
    content/global/bindings/datepicker.js       (widgets/datepicker.js)
942
66115255ad6f prepare FF51 (currently 51.0b5)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 935
diff changeset
   185
    content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   186
 *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   187
+*  content/global/bindings/dialog-kde.xml      (widgets/dialog-kde.xml)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   188
+% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
515
0f6539389500 Aurora 16 uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 467
diff changeset
   189
    content/global/bindings/general.xml         (widgets/general.xml)
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   190
    content/global/bindings/popup.xml           (widgets/popup.xml)
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   191
    content/global/bindings/richlistbox.xml     (widgets/richlistbox.xml)
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   192
    content/global/bindings/scrollbox.xml       (widgets/scrollbox.xml)
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   193
    content/global/bindings/spinner.js          (widgets/spinner.js)
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   194
    content/global/bindings/tabbox.xml          (widgets/tabbox.xml)
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   195
 *  content/global/bindings/textbox.xml         (widgets/textbox.xml)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   196
    content/global/bindings/timekeeper.js       (widgets/timekeeper.js)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   197
diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   198
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   199
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   200
+++ b/toolkit/content/widgets/dialog-kde.xml
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   201
@@ -0,0 +1,499 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   202
+<?xml version="1.0"?>
515
0f6539389500 Aurora 16 uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 467
diff changeset
   203
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
0f6539389500 Aurora 16 uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 467
diff changeset
   204
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
0f6539389500 Aurora 16 uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 467
diff changeset
   205
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
0f6539389500 Aurora 16 uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 467
diff changeset
   206
+
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   207
+<!DOCTYPE bindings [
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   208
+  <!ENTITY % globalKeysDTD SYSTEM "chrome://global/locale/globalKeys.dtd">
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   209
+  %globalKeysDTD;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   210
+]>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   211
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   212
+<bindings id="dialogBindings"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   213
+          xmlns="http://www.mozilla.org/xbl"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   214
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   215
+          xmlns:xbl="http://www.mozilla.org/xbl">
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   216
+
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   217
+  <binding id="dialog">
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   218
+    <content>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   219
+      <xul:vbox class="box-inherit dialog-content-box" flex="1">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   220
+        <children/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   221
+      </xul:vbox>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   222
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   223
+      <xul:hbox class="dialog-button-box" anonid="buttons"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   224
+                xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"
918
0f93e8da34b6 boo#984403 - OK and cancel button reversed in FF47
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 916
diff changeset
   225
+#ifdef XP_UNIX_GNOME
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   226
+                >
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   227
+        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   228
+        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   229
+        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   230
+        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   231
+        <xul:spacer anonid="spacer" flex="1"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   232
+        <xul:button dlgtype="cancel" class="dialog-button"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   233
+        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   234
+#elif XP_UNIX
748
72ba5129e5fd full rebase to Aurora 32
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 738
diff changeset
   235
+                >
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   236
+        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   237
+        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   238
+        <xul:spacer anonid="spacer" flex="1"/>
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   239
+        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   240
+        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   241
+        <xul:button dlgtype="cancel" class="dialog-button"/>
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   242
+        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   243
+#else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   244
+                pack="end">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   245
+        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   246
+        <xul:spacer anonid="spacer" flex="1" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   247
+        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   248
+        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   249
+        <xul:button dlgtype="cancel" class="dialog-button"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   250
+        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   251
+        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   252
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   253
+      </xul:hbox>
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   254
+
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   255
+    <xul:keyset>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   256
+      <xul:key phase="capturing" oncommand="document.documentElement.openHelp(event)"
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   257
+#ifdef XP_MACOSX
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   258
+           key="&openHelpMac.commandkey;" modifiers="accel"/>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   259
+#else
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   260
+           keycode="&openHelp.commandkey;"/>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   261
+#endif
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   262
+    </xul:keyset>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   263
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   264
+    </content>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   265
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   266
+    <implementation>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   267
+      <field name="_mStrBundle">null</field>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   268
+      <field name="_closeHandler">(function(event) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   269
+        if (!document.documentElement.cancelDialog())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   270
+          event.preventDefault();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   271
+      })</field>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   272
+
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   273
+      <!-- Gets populated by elements that are passed to document.l10n.setAttributes
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   274
+           to localize the dialog buttons. Needed to properly size the dialog after
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   275
+           the asynchronous translation. -->
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   276
+      <field name="_l10nButtons">[]</field>
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   277
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   278
+      <property name="buttons"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   279
+                onget="return this.getAttribute('buttons');"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   280
+                onset="this._configureButtons(val); return val;"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   281
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   282
+      <property name="defaultButton">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   283
+        <getter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   284
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   285
+          if (this.hasAttribute("defaultButton"))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   286
+            return this.getAttribute("defaultButton");
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   287
+          return "accept"; // default to the accept button
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   288
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   289
+        </getter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   290
+        <setter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   291
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   292
+          this._setDefaultButton(val);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   293
+          return val;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   294
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   295
+        </setter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   296
+      </property>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   297
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   298
+      <method name="acceptDialog">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   299
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   300
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   301
+          return this._doButtonCommand("accept");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   302
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   303
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   304
+      </method>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   305
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   306
+      <method name="cancelDialog">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   307
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   308
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   309
+          return this._doButtonCommand("cancel");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   310
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   311
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   312
+      </method>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   313
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   314
+      <method name="getButton">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   315
+        <parameter name="aDlgType"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   316
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   317
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   318
+          return this._buttons[aDlgType];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   319
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   320
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   321
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   322
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   323
+      <method name="moveToAlertPosition">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   324
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   325
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   326
+          // hack. we need this so the window has something like its final size
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   327
+          if (window.outerWidth == 1) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   328
+            dump("Trying to position a sizeless window; caller should have called sizeToContent() or sizeTo(). See bug 75649.\n");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   329
+            sizeToContent();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   330
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   331
+
868
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   332
+          if (opener) {
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   333
+            var xOffset = (opener.outerWidth - window.outerWidth) / 2;
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   334
+            var yOffset = opener.outerHeight / 5;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   335
+
868
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   336
+            var newX = opener.screenX + xOffset;
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   337
+            var newY = opener.screenY + yOffset;
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   338
+          } else {
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   339
+            newX = (screen.availWidth - window.outerWidth) / 2;
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   340
+            newY = (screen.availHeight - window.outerHeight) / 2;
284da266ec46 40beta rebase
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 850
diff changeset
   341
+          }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   342
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   343
+          // ensure the window is fully onscreen (if smaller than the screen)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   344
+          if (newX < screen.availLeft)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   345
+            newX = screen.availLeft + 20;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   346
+          if ((newX + window.outerWidth) > (screen.availLeft + screen.availWidth))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   347
+            newX = (screen.availLeft + screen.availWidth) - window.outerWidth - 20;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   348
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   349
+          if (newY < screen.availTop)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   350
+            newY = screen.availTop + 20;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   351
+          if ((newY + window.outerHeight) > (screen.availTop + screen.availHeight))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   352
+            newY = (screen.availTop + screen.availHeight) - window.outerHeight - 60;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   353
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   354
+          window.moveTo( newX, newY );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   355
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   356
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   357
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   358
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   359
+      <method name="centerWindowOnScreen">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   360
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   361
+        <![CDATA[
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   362
+          var xOffset = screen.availWidth / 2 - window.outerWidth / 2;
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   363
+          var yOffset = screen.availHeight / 2 - window.outerHeight / 2;
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   364
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   365
+          xOffset = xOffset > 0 ? xOffset : 0;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   366
+          yOffset = yOffset > 0 ? yOffset : 0;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   367
+          window.moveTo(xOffset, yOffset);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   368
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   369
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   370
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   371
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   372
+      <constructor>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   373
+      <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   374
+        this._configureButtons(this.buttons);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   375
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   376
+        // listen for when window is closed via native close buttons
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   377
+        window.addEventListener("close", this);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   378
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   379
+        // for things that we need to initialize after onload fires
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   380
+        window.addEventListener("load", this);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   381
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   382
+        window.moveToAlertPosition = this.moveToAlertPosition;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   383
+        window.centerWindowOnScreen = this.centerWindowOnScreen;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   384
+      ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   385
+      </constructor>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   386
+
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   387
+      <method name="handleEvent">
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   388
+        <parameter name="aEvent"/>
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   389
+        <body><![CDATA[
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   390
+          switch (aEvent.type) {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   391
+            case "close": {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   392
+              this._closeHandler(aEvent);
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   393
+              break;
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   394
+            }
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   395
+            case "load": {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   396
+              this.postLoadInit(aEvent);
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   397
+              break;
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   398
+            }
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   399
+          }
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   400
+        ]]></body>
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   401
+      </method>
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   402
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   403
+      <method name="postLoadInit">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   404
+        <parameter name="aEvent"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   405
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   406
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   407
+          function focusInit() {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   408
+            const dialog = document.documentElement;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   409
+            const defaultButton = dialog.getButton(dialog.defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   410
+            // give focus to the first focusable element in the dialog
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   411
+            if (!document.commandDispatcher.focusedElement) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   412
+              document.commandDispatcher.advanceFocusIntoSubtree(dialog);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   413
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   414
+              var focusedElt = document.commandDispatcher.focusedElement;
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   415
+              if (focusedElt) {
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   416
+                var initialFocusedElt = focusedElt;
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   417
+                while (focusedElt.localName == "tab" ||
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   418
+                       focusedElt.getAttribute("noinitialfocus") == "true") {
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   419
+                  document.commandDispatcher.advanceFocusIntoSubtree(focusedElt);
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   420
+                  focusedElt = document.commandDispatcher.focusedElement;
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   421
+                  if (focusedElt == initialFocusedElt) {
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   422
+                    if (focusedElt.getAttribute("noinitialfocus") == "true") {
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   423
+                      focusedElt.blur();
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   424
+                    }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   425
+                    break;
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   426
+                  }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   427
+                }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   428
+
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   429
+                if (initialFocusedElt.localName == "tab") {
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   430
+                  if (focusedElt.hasAttribute("dlgtype")) {
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   431
+                    // We don't want to focus on anonymous OK, Cancel, etc. buttons,
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   432
+                    // so return focus to the tab itself
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   433
+                    initialFocusedElt.focus();
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   434
+                  }
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   435
+                } else if (!/Mac/.test(navigator.platform) &&
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   436
+                           focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   437
+                  defaultButton.focus();
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
   438
+                }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   439
+              }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   440
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   441
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   442
+            try {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   443
+              if (defaultButton)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   444
+                window.notifyDefaultButtonLoaded(defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   445
+            } catch (e) { }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   446
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   447
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   448
+          // Give focus after onload completes, see bug 103197.
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   449
+          setTimeout(focusInit, 0);
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   450
+
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   451
+          if (this._l10nButtons.length) {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   452
+            document.l10n.translateElements(this._l10nButtons).then(() => {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   453
+              window.sizeToContent();
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   454
+            });
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   455
+          }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   456
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   457
+        </body>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   458
+      </method>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   459
+
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   460
+      <method name="openHelp">
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   461
+        <parameter name="event"/>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   462
+        <body>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   463
+        <![CDATA[
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   464
+          var helpButton = document.documentElement.getButton("help");
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   465
+          if (helpButton.disabled || helpButton.hidden)
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   466
+            return;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   467
+          this._fireButtonEvent("help");
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   468
+          event.stopPropagation();
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   469
+          event.preventDefault();
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   470
+        ]]>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   471
+        </body>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   472
+      </method>
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   473
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   474
+      <property name="mStrBundle">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   475
+        <getter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   476
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   477
+          if (!this._mStrBundle) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   478
+            // need to create string bundle manually instead of using <xul:stringbundle/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   479
+            // see bug 63370 for details
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   480
+            this._mStrBundle = Cc["@mozilla.org/intl/stringbundle;1"]
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   481
+                                 .getService(Ci.nsIStringBundleService)
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   482
+                                 .createBundle("chrome://global/locale/dialog.properties");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   483
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   484
+          return this._mStrBundle;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   485
+        ]]></getter>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   486
+      </property>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   487
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   488
+      <method name="_configureButtons">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   489
+        <parameter name="aButtons"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   490
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   491
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   492
+          // by default, get all the anonymous button elements
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   493
+          var buttons = {};
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   494
+          this._buttons = buttons;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   495
+          buttons.accept = document.getAnonymousElementByAttribute(this, "dlgtype", "accept");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   496
+          buttons.cancel = document.getAnonymousElementByAttribute(this, "dlgtype", "cancel");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   497
+          buttons.extra1 = document.getAnonymousElementByAttribute(this, "dlgtype", "extra1");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   498
+          buttons.extra2 = document.getAnonymousElementByAttribute(this, "dlgtype", "extra2");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   499
+          buttons.help = document.getAnonymousElementByAttribute(this, "dlgtype", "help");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   500
+          buttons.disclosure = document.getAnonymousElementByAttribute(this, "dlgtype", "disclosure");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   501
+
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   502
+          for (let button in buttons) {
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   503
+            customElements.upgrade(buttons[button]);
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   504
+          }
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   505
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   506
+          // look for any overriding explicit button elements
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   507
+          var exBtns = this.getElementsByAttribute("dlgtype", "*");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   508
+          var dlgtype;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   509
+          var i;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   510
+          for (i = 0; i < exBtns.length; ++i) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   511
+            dlgtype = exBtns[i].getAttribute("dlgtype");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   512
+            buttons[dlgtype].hidden = true; // hide the anonymous button
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   513
+            buttons[dlgtype] = exBtns[i];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   514
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   515
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   516
+          // add the label and oncommand handler to each button
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   517
+          for (dlgtype in buttons) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   518
+            var button = buttons[dlgtype];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   519
+            button.addEventListener("command", this._handleButtonCommand, true);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   520
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   521
+            // don't override custom labels with pre-defined labels on explicit buttons
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   522
+            if (!button.hasAttribute("label")) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   523
+              // dialog attributes override the default labels in dialog.properties
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   524
+              if (this.hasAttribute("buttonlabel" + dlgtype)) {
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   525
+                button.setAttribute("label", this.getAttribute("buttonlabel" + dlgtype));
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   526
+                if (this.hasAttribute("buttonaccesskey" + dlgtype))
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   527
+                  button.setAttribute("accesskey", this.getAttribute("buttonaccesskey" + dlgtype));
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   528
+              } else if (this.hasAttribute("buttonid" + dlgtype)) {
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   529
+                document.l10n.setAttributes(button, this.getAttribute("buttonid" + dlgtype));
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   530
+                this._l10nButtons.push(button);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   531
+              } else if (dlgtype != "extra1" && dlgtype != "extra2") {
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   532
+                button.setAttribute("label", this.mStrBundle.GetStringFromName("button-" + dlgtype));
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   533
+                var accessKey = this.mStrBundle.GetStringFromName("accesskey-" + dlgtype);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   534
+                if (accessKey)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   535
+                  button.setAttribute("accesskey", accessKey);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   536
+              }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   537
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   538
+            // allow specifying alternate icons in the dialog header
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   539
+            if (!button.hasAttribute("icon")) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   540
+              // if there's an icon specified, use that
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   541
+              if (this.hasAttribute("buttonicon" + dlgtype))
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   542
+                button.setAttribute("icon", this.getAttribute("buttonicon" + dlgtype));
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   543
+              // otherwise set defaults
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   544
+              else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   545
+                switch (dlgtype) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   546
+                  case "accept":
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   547
+                    button.setAttribute("icon", "accept");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   548
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   549
+                  case "cancel":
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   550
+                    button.setAttribute("icon", "cancel");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   551
+                    break;
194
b77b8588484c sync dialog-kde.xml
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 191
diff changeset
   552
+                  case "disclosure":
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   553
+                    button.setAttribute("icon", "properties");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   554
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   555
+                  case "help":
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   556
+                    button.setAttribute("icon", "help");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   557
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   558
+                  default:
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   559
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   560
+                }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   561
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   562
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   563
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   564
+          // ensure that hitting enter triggers the default button command
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   565
+          this.defaultButton = this.defaultButton;
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   566
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   567
+          // if there is a special button configuration, use it
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   568
+          if (aButtons) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   569
+            // expect a comma delimited list of dlgtype values
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   570
+            var list = aButtons.split(",");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   571
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   572
+            // mark shown dlgtypes as true
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   573
+            var shown = { accept: false, cancel: false, help: false,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   574
+                          disclosure: false, extra1: false, extra2: false };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   575
+            for (i = 0; i < list.length; ++i)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   576
+              shown[list[i].replace(/ /g, "")] = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   577
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   578
+            // hide/show the buttons we want
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   579
+            for (dlgtype in buttons)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   580
+              buttons[dlgtype].hidden = !shown[dlgtype];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   581
+
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   582
+            // show the spacer on Windows only when the extra2 button is present
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   583
+            if (/Win/.test(navigator.platform)) {
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   584
+              var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   585
+              spacer.removeAttribute("hidden");
1006
5ba9b67de554 full rebase incl. fixing KDE variants of UI definitions
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1005
diff changeset
   586
+              spacer.setAttribute("flex", shown.extra2 ? "1" : "0");
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 904
diff changeset
   587
+            }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   588
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   589
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   590
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   591
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   592
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   593
+      <method name="_setDefaultButton">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   594
+        <parameter name="aNewDefault"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   595
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   596
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   597
+          // remove the default attribute from the previous default button, if any
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   598
+          var oldDefaultButton = this.getButton(this.defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   599
+          if (oldDefaultButton)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   600
+            oldDefaultButton.removeAttribute("default");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   601
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   602
+          var newDefaultButton = this.getButton(aNewDefault);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   603
+          if (newDefaultButton) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   604
+            this.setAttribute("defaultButton", aNewDefault);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   605
+            newDefaultButton.setAttribute("default", "true");
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   606
+          } else {
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   607
+            this.setAttribute("defaultButton", "none");
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   608
+            if (aNewDefault != "none")
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   609
+              dump("invalid new default button: " + aNewDefault + ", assuming: none\n");
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   610
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   611
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   612
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   613
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   614
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   615
+      <method name="_handleButtonCommand">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   616
+        <parameter name="aEvent"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   617
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   618
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   619
+          return document.documentElement._doButtonCommand(
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   620
+                                        aEvent.target.getAttribute("dlgtype"));
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   621
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   622
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   623
+      </method>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   624
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   625
+      <method name="_doButtonCommand">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   626
+        <parameter name="aDlgType"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   627
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   628
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   629
+          var button = this.getButton(aDlgType);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   630
+          if (!button.disabled) {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   631
+            var noCancel = this._fireButtonEvent(aDlgType);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   632
+            if (noCancel) {
766
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   633
+              if (aDlgType == "accept" || aDlgType == "cancel") {
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   634
+                var closingEvent = new CustomEvent("dialogclosing", {
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   635
+                  bubbles: true,
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   636
+                  detail: { button: aDlgType },
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   637
+                });
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   638
+                this.dispatchEvent(closingEvent);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   639
+                window.close();
766
e0b23b7851e9 rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 760
diff changeset
   640
+              }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   641
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   642
+            return noCancel;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   643
+          }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   644
+          return true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   645
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   646
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   647
+      </method>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   648
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   649
+      <method name="_fireButtonEvent">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   650
+        <parameter name="aDlgType"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   651
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   652
+        <![CDATA[
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   653
+          var event = document.createEvent("Events");
955
55662cbdb950 update KDE variants for UI
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 952
diff changeset
   654
+          event.initEvent("dialog" + aDlgType, true, true);
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   655
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   656
+          // handle dom event handlers
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   657
+          return this.dispatchEvent(event);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   658
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   659
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   660
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   661
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   662
+      <method name="_hitEnter">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   663
+        <parameter name="evt"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   664
+        <body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   665
+        <![CDATA[
400
6a1811ef3174 update for 11.0b4
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 399
diff changeset
   666
+          if (evt.defaultPrevented)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   667
+            return;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   668
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   669
+          var btn = this.getButton(this.defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   670
+          if (btn)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   671
+            this._doButtonCommand(this.defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   672
+        ]]>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   673
+        </body>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   674
+      </method>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   675
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   676
+    </implementation>
916
2f9f2e040647 Firefox 47.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 909
diff changeset
   677
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   678
+    <handlers>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   679
+      <handler event="keypress" keycode="VK_RETURN"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   680
+               group="system" action="this._hitEnter(event);"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   681
+      <handler event="keypress" keycode="VK_ESCAPE" group="system">
400
6a1811ef3174 update for 11.0b4
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 399
diff changeset
   682
+        if (!event.defaultPrevented)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   683
+          this.cancelDialog();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   684
+      </handler>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   685
+#ifdef XP_MACOSX
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   686
+      <handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   687
+#else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   688
+      <handler event="focus" phase="capturing">
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   689
+        var btn = this.getButton(this.defaultButton);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   690
+        if (btn)
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   691
+          btn.setAttribute("default", event.originalTarget == btn ||
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   692
+                           !(event.originalTarget.localName == "button" ||
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   693
+                             event.originalTarget.localName == "toolbarbutton"));
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   694
+      </handler>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   695
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   696
+    </handlers>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   697
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   698
+  </binding>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   699
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   700
+</bindings>
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   701
diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   702
--- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   703
+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   704
@@ -1204,36 +1204,66 @@ nsUnknownContentTypeDialog.prototype = {
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   705
         params.handlerApp &&
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   706
         params.handlerApp.executable &&
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   707
         params.handlerApp.executable.isFile()
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   708
       ) {
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   709
         // Remember the file they chose to run.
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   710
         this.chosenApp = params.handlerApp;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   711
       }
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   712
     } else if ("@mozilla.org/applicationchooser;1" in Cc) {
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   713
-      var nsIApplicationChooser = Ci.nsIApplicationChooser;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   714
-      var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   715
-        nsIApplicationChooser
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   716
-      );
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   717
-      appChooser.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   718
-        this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   719
-        this.dialogElement("strings").getString("chooseAppFilePickerTitle")
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   720
-      );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   721
-      var contentTypeDialogObj = this;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   722
-      let appChooserCallback = function appChooserCallback_done(aResult) {
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   723
-        if (aResult) {
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   724
-          contentTypeDialogObj.chosenApp = aResult.QueryInterface(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   725
-            Ci.nsILocalHandlerApp
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   726
-          );
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   727
-        }
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   728
-        contentTypeDialogObj.finishChooseApp();
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   729
-      };
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   730
-      appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   731
-      // The finishChooseApp is called from appChooserCallback
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   732
-      return;
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   733
+      // handle the KDE case which is implemented in the filepicker
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   734
+      // therefore falling back to Gtk2 like behaviour if KDE is running
994
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   735
+      // FIXME this should be better handled in the nsIApplicationChooser
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   736
+      // interface
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   737
+      var env = Components.classes["@mozilla.org/process/environment;1"]
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   738
+                          .getService(Components.interfaces.nsIEnvironment);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   739
+      if (env.get('KDE_FULL_SESSION') == "true")
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   740
+      {
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   741
+        var nsIFilePicker = Ci.nsIFilePicker;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   742
+        var fp = Cc["@mozilla.org/filepicker;1"]
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   743
+                    .createInstance(nsIFilePicker);
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   744
+        fp.init(this.mDialog,
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   745
+                this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   746
+                nsIFilePicker.modeOpen);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   747
+
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   748
+        fp.appendFilters(nsIFilePicker.filterApps);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   749
+
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   750
+        fp.open(aResult => {
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   751
+          if (aResult == nsIFilePicker.returnOK && fp.file) {
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   752
+            // Remember the file they chose to run.
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   753
+            var localHandlerApp =
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   754
+              Cc["@mozilla.org/uriloader/local-handler-app;1"].
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   755
+                         createInstance(Ci.nsILocalHandlerApp);
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   756
+            localHandlerApp.executable = fp.file;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   757
+            this.chosenApp = localHandlerApp;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   758
+          }
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   759
+          this.finishChooseApp();
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   760
+        });
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   761
+      } else {
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   762
+        var nsIApplicationChooser = Ci.nsIApplicationChooser;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   763
+        var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   764
+          nsIApplicationChooser
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   765
+        );
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   766
+        appChooser.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   767
+          this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   768
+          this.dialogElement("strings").getString("chooseAppFilePickerTitle")
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   769
+        );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   770
+        var contentTypeDialogObj = this;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   771
+        let appChooserCallback = function appChooserCallback_done(aResult) {
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   772
+          if (aResult) {
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   773
+            contentTypeDialogObj.chosenApp = aResult.QueryInterface(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   774
+              Ci.nsILocalHandlerApp
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   775
+            );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   776
+          }
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   777
+          contentTypeDialogObj.finishChooseApp();
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   778
+        };
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   779
+        appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   780
+        // The finishChooseApp is called from appChooserCallback
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   781
+        return;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   782
+      }
994
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   783
     } else {
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   784
       var nsIFilePicker = Ci.nsIFilePicker;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   785
       var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   786
       fp.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   787
         this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   788
         this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   789
         nsIFilePicker.modeOpen
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   790
       );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   791
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   792
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   793
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   794
@@ -14,16 +14,17 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   795
 #include "nsPrintfCString.h"
885
ee3c462047d5 42 beta cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 881
diff changeset
   796
 #include "nsNetCID.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   797
 #include "nsNetUtil.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   798
 #include "nsISupportsPrimitives.h"
399
20f8b5f0aea6 port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 398
diff changeset
   799
 #include "nsIGSettingsService.h"
419
f6b055dd94bc commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 409
diff changeset
   800
 #include "nsInterfaceHashtable.h"
541
830e50bbfc79 working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 538
diff changeset
   801
 #include "mozilla/Attributes.h"
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   802
 #include "nsIURI.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   803
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   804
 
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   805
 using namespace mozilla;
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   806
 
850
a2bdff616a0e prepare 38beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 837
diff changeset
   807
 class nsUnixSystemProxySettings final : public nsISystemProxySettings {
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   808
  public:
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   809
   NS_DECL_ISUPPORTS
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   810
   NS_DECL_NSISYSTEMPROXYSETTINGS
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   811
 
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   812
@@ -37,16 +38,18 @@ class nsUnixSystemProxySettings final : 
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   813
   nsCOMPtr<nsIGSettingsCollection> mProxySettings;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   814
   nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection>
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   815
       mSchemeProxySettings;
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   816
   nsresult GetProxyFromGSettings(const nsACString& aScheme,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   817
                                  const nsACString& aHost, int32_t aPort,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   818
                                  nsACString& aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   819
   nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   820
                                        nsACString& aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   821
+  nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   822
+                           PRInt32 aPort, nsACString& aResult);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   823
 };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   824
 
738
f118b88b7d7f Aurora 31 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 718
diff changeset
   825
 NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   826
 
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   827
 NS_IMETHODIMP
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   828
 nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   829
   // dbus prevents us from being threadsafe, but this routine should not block
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   830
   // anyhow
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   831
@@ -382,21 +385,50 @@ nsresult nsUnixSystemProxySettings::GetP
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   832
   return NS_OK;
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   833
 }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   834
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   835
 nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   836
                                                    const nsACString& aScheme,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   837
                                                    const nsACString& aHost,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   838
                                                    const int32_t aPort,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   839
                                                    nsACString& aResult) {
596
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 589
diff changeset
   840
+  if (nsKDEUtils::kdeSupport())
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   841
+    return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   842
+
419
f6b055dd94bc commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 409
diff changeset
   843
   if (mProxySettings) {
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   844
     nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   845
     if (NS_SUCCEEDED(rv)) return rv;
399
20f8b5f0aea6 port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 398
diff changeset
   846
   }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   847
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   848
   return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   849
 }
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   850
 
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   851
+nsresult
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   852
+nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   853
+                                           const nsACString& aHost,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   854
+                                           PRInt32 aPort,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   855
+                                           nsACString& aResult)
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   856
+{
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   857
+  nsAutoCString url;
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   858
+  url = aScheme;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   859
+  url += "://";
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   860
+  url += aHost;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   861
+  if( aPort >= 0 )
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   862
+  {
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   863
+    url += ":";
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   864
+    url += nsPrintfCString("%d", aPort);
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   865
+  }
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   866
+  nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   867
+  command.AppendElement( NS_LITERAL_CSTRING( "GETPROXY" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   868
+  command.AppendElement( url );
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   869
+  nsTArray<nsCString> result;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   870
+  if( !nsKDEUtils::command( command, &result ) || result.Length() != 1 )
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   871
+    return NS_ERROR_FAILURE;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   872
+  aResult = result[0];
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   873
+  return NS_OK;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   874
+}
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   875
+
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   876
+
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   877
 NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) {
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   878
   auto result = MakeRefPtr<nsUnixSystemProxySettings>();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   879
   result->Init();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   880
   return result.forget().downcast<nsISupports>();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   881
 }
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   882
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   883
--- a/toolkit/xre/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   884
+++ b/toolkit/xre/moz.build
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   885
@@ -83,17 +83,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   886
         '../components/printingui',
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   887
     ]
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   888
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   889
     UNIFIED_SOURCES += [
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   890
         'nsNativeAppSupportDefault.cpp',
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   891
         'UIKitDirProvider.mm',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   892
     ]
923
3cc9f17ca9bb prepare FF48
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 918
diff changeset
   893
 elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   894
+    EXPORTS += ['nsKDEUtils.h']
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   895
     UNIFIED_SOURCES += [
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   896
+        'nsKDEUtils.cpp',
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   897
         'nsNativeAppSupportUnix.cpp',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   898
     ]
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   899
 else:
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   900
     UNIFIED_SOURCES += [
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   901
         'nsNativeAppSupportDefault.cpp',
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   902
     ]
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   903
 
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   904
 if CONFIG['MOZ_HAS_REMOTE']:
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   905
diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   906
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   907
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   908
+++ b/toolkit/xre/nsKDEUtils.cpp
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   909
@@ -0,0 +1,344 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   910
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   911
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   912
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   913
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   914
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   915
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   916
+#include "nsIWidget.h"
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   917
+#include "nsISupportsPrimitives.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   918
+#include "nsIMutableArray.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   919
+#include "nsComponentManagerUtils.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   920
+#include "nsArrayUtils.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   921
+
10
1920f0ff04a3 Make mozilla-kde.patch compile with 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 9
diff changeset
   922
+#include <gtk/gtk.h>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   923
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   924
+#include <limits.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   925
+#include <stdio.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   926
+#include <sys/wait.h>
517
fa93154734b8 Fix mozilla-kde.patch to include sys/resource.h for getrlimit etc (glibc 2.16)
Andreas Jaeger <aj@suse.de>
parents: 515
diff changeset
   927
+#include <sys/resource.h>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   928
+#include <unistd.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   929
+#include <X11/Xlib.h>
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   930
+// copied from X11/X.h as a hack since for an unknown
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   931
+// reason it's not picked up from X11/X.h
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   932
+#ifndef None
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   933
+#define None                 0L /* universal null resource or null atom */
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   934
+#endif
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   935
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   936
+//#define DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   937
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   938
+#define KMOZILLAHELPER "kmozillahelper"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   939
+#else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   940
+// not need for lib64, it's a binary
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   941
+#define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   942
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   943
+
538
be682f8c9361 revert API version change for kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 537
diff changeset
   944
+#define KMOZILLAHELPER_VERSION 6
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   945
+#define MAKE_STR2( n ) #n
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   946
+#define MAKE_STR( n ) MAKE_STR2( n )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   947
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   948
+static bool getKdeSession()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   949
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   950
+    Display* dpy = XOpenDisplay( NULL );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   951
+    if( dpy == NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   952
+        return false;
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   953
+    Atom kde_full_session = XInternAtom( dpy, "KDE_FULL_SESSION", true );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   954
+    bool kde = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   955
+    if( kde_full_session != None )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   956
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   957
+        int cnt;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   958
+        if( Atom* props = XListProperties( dpy, DefaultRootWindow( dpy ), &cnt ))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   959
+            {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   960
+            for( int i = 0;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   961
+                 i < cnt;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   962
+                 ++i )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   963
+                {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   964
+                if( props[ i ] == kde_full_session )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   965
+                    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   966
+                    kde = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   967
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   968
+                    fprintf( stderr, "KDE SESSION %d\n", kde );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   969
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   970
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   971
+                    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   972
+                }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   973
+            XFree( props );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   974
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   975
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   976
+    XCloseDisplay( dpy );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   977
+    return kde;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   978
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   979
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   980
+static bool getKdeSupport()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   981
+    {
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   982
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   983
+    command.AppendElement( NS_LITERAL_CSTRING( "CHECK" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   984
+    command.AppendElement( NS_LITERAL_CSTRING( MAKE_STR( KMOZILLAHELPER_VERSION )));
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   985
+    bool kde = nsKDEUtils::command( command );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   986
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   987
+    fprintf( stderr, "KDE RUNNING %d\n", kde );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   988
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   989
+    return kde;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   990
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   991
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   992
+nsKDEUtils::nsKDEUtils()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   993
+    : commandFile( NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   994
+    , replyFile( NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   995
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   996
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   997
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   998
+nsKDEUtils::~nsKDEUtils()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   999
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1000
+//    closeHelper(); not actually useful, exiting will close the fd too
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1001
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1002
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1003
+nsKDEUtils* nsKDEUtils::self()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1004
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1005
+    static nsKDEUtils s;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1006
+    return &s;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1007
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1008
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1009
+static bool helperRunning = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1010
+static bool helperFailed = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1011
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1012
+bool nsKDEUtils::kdeSession()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1013
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1014
+    static bool session = getKdeSession();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1015
+    return session;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1016
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1017
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1018
+bool nsKDEUtils::kdeSupport()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1019
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1020
+    static bool support = kdeSession() && getKdeSupport();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1021
+    return support && helperRunning;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1022
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1023
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1024
+struct nsKDECommandData
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1025
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1026
+    FILE* file;
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1027
+    nsTArray<nsCString>* output;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1028
+    GMainLoop* loop;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1029
+    bool success;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1030
+    };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1031
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1032
+static gboolean kdeReadFunc( GIOChannel*, GIOCondition, gpointer data )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1033
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1034
+    nsKDECommandData* p = static_cast< nsKDECommandData* >( data );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1035
+    char buf[ 8192 ]; // TODO big enough
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1036
+    bool command_done = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1037
+    bool command_failed = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1038
+    while( !command_done && !command_failed && fgets( buf, 8192, p->file ) != NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1039
+        { // TODO what if the kernel splits a line into two chunks?
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1040
+//#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1041
+//        fprintf( stderr, "READ: %s %d\n", buf, feof( p->file ));
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1042
+//#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1043
+        if( char* eol = strchr( buf, '\n' ))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1044
+            *eol = '\0';
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1045
+        command_done = ( strcmp( buf, "\\1" ) == 0 );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1046
+        command_failed = ( strcmp( buf, "\\0" ) == 0 );
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1047
+        nsAutoCString line( buf );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1048
+        line.ReplaceSubstring( "\\n", "\n" );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1049
+        line.ReplaceSubstring( "\\" "\\", "\\" ); //  \\ -> \ , i.e. unescape
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1050
+        if( p->output && !( command_done || command_failed ))
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1051
+            p->output->AppendElement( nsCString( buf )); // TODO utf8?
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1052
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1053
+    bool quit = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1054
+    if( feof( p->file ) || command_failed )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1055
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1056
+        quit = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1057
+        p->success = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1058
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1059
+    if( command_done )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1060
+        { // reading one reply finished
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1061
+        quit = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1062
+        p->success = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1063
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1064
+    if( quit )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1065
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1066
+        if( p->loop )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1067
+            g_main_loop_quit( p->loop );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1068
+        return FALSE;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1069
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1070
+    return TRUE;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1071
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1072
+
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1073
+bool nsKDEUtils::command( const nsTArray<nsCString>& command, nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1074
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1075
+    return self()->internalCommand( command, NULL, false, output );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1076
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1077
+
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1078
+bool nsKDEUtils::command( nsIArray* command, nsIArray** output)
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1079
+    {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1080
+    nsTArray<nsCString> in;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1081
+    PRUint32 length;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1082
+    command->GetLength( &length );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1083
+    for ( PRUint32 i = 0; i < length; i++ )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1084
+        {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1085
+        nsCOMPtr<nsISupportsCString> str = do_QueryElementAt( command, i );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1086
+        if( str )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1087
+            {
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1088
+            nsAutoCString s;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1089
+            str->GetData( s );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1090
+            in.AppendElement( s );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1091
+            }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1092
+        }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1093
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1094
+    nsTArray<nsCString> out;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1095
+    bool ret = self()->internalCommand( in, NULL, false, &out );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1096
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1097
+    if ( !output ) return ret;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1098
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1099
+    nsCOMPtr<nsIMutableArray> result = do_CreateInstance( NS_ARRAY_CONTRACTID );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1100
+    if ( !result ) return false;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1101
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1102
+    for ( PRUint32 i = 0; i < out.Length(); i++ )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1103
+        {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1104
+        nsCOMPtr<nsISupportsCString> rstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1105
+        if ( !rstr ) return false;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1106
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1107
+        rstr->SetData( out[i] );
1021
1307721d2345 fixed patches for FF58
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1020
diff changeset
  1108
+        result->AppendElement( rstr );
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1109
+        }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1110
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1111
+    NS_ADDREF( *output = result);
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1112
+    return ret;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1113
+    }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1114
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1115
+
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
  1116
+bool nsKDEUtils::commandBlockUi( const nsTArray<nsCString>& command, GtkWindow* parent, nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1117
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1118
+    return self()->internalCommand( command, parent, true, output );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1119
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1120
+
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
  1121
+bool nsKDEUtils::internalCommand( const nsTArray<nsCString>& command, GtkWindow* parent, bool blockUi,
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1122
+    nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1123
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1124
+    if( !startHelper())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1125
+        return false;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
  1126
+    feedCommand( command );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1127
+    // do not store the data in 'this' but in extra structure, just in case there
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1128
+    // is reentrancy (can there be? the event loop is re-entered)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1129
+    nsKDECommandData data;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1130
+    data.file = replyFile;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1131
+    data.output = output;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1132
+    data.success = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1133
+    if( blockUi )