Mercurial > octave
annotate libgui/languages/build_ts/octave-qt/qfiledialog_symbian.cpp @ 31537:5ceb4bfcdb0f stable
add tools and files for updating the gui's language files for translation
* libgui/languages/build_ts/README.md: readme for updating language files
* libgui/languages/build_ts/octave-qsci: QScintilla source files for
languages without translation provided by QScintilla
* libgui/languages/build_ts/octave-qt: Qt source files for languages
without translation provided by Qt
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Thu, 24 Nov 2022 06:48:25 +0100 |
parents | |
children |
rev | line source |
---|---|
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1 /**************************************************************************** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3 ** Copyright (C) 2015 The Qt Company Ltd. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
4 ** Contact: http://www.qt.io/licensing/ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
5 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
6 ** This file is part of the QtGui module of the Qt Toolkit. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
7 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
8 ** $QT_BEGIN_LICENSE:LGPL$ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
9 ** Commercial License Usage |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
10 ** Licensees holding valid commercial Qt licenses may use this file in |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
11 ** accordance with the commercial license agreement provided with the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
12 ** Software or, alternatively, in accordance with the terms contained in |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
13 ** a written agreement between you and The Qt Company. For licensing terms |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
14 ** and conditions see http://www.qt.io/terms-conditions. For further |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
15 ** information use the contact form at http://www.qt.io/contact-us. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
16 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
17 ** GNU Lesser General Public License Usage |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
18 ** Alternatively, this file may be used under the terms of the GNU Lesser |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
19 ** General Public License version 2.1 or version 3 as published by the Free |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
22 ** following information to ensure the GNU Lesser General Public License |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
25 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
26 ** As a special exception, The Qt Company gives you certain additional |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
27 ** rights. These rights are described in The Qt Company LGPL Exception |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
29 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
30 ** GNU General Public License Usage |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
31 ** Alternatively, this file may be used under the terms of the GNU |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
32 ** General Public License version 3.0 as published by the Free Software |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
33 ** Foundation and appearing in the file LICENSE.GPL included in the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
34 ** packaging of this file. Please review the following information to |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
35 ** ensure the GNU General Public License version 3.0 requirements will be |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
36 ** met: http://www.gnu.org/copyleft/gpl.html. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
37 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
38 ** $QT_END_LICENSE$ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
39 ** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
40 ****************************************************************************/ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
41 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
42 #include "qfiledialog.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
43 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
44 #ifndef QT_NO_FILEDIALOG |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
45 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
46 #include <private/qfiledialog_p.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
47 #if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
48 #include <driveinfo.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
49 #include <AknCommonDialogsDynMem.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
50 #include <CAknMemorySelectionDialogMultiDrive.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
51 #include <MAknFileFilter.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
52 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
53 #include "private/qcore_symbian_p.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
54 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
55 QT_BEGIN_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
56 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
57 extern QStringList qt_make_filter_list(const QString &filter); // defined in qfiledialog.cpp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
58 extern QStringList qt_clean_filter_list(const QString &filter); // defined in qfiledialog.cpp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
59 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
60 enum DialogMode { DialogOpen, DialogSave, DialogFolder }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
61 #if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
62 class CExtensionFilter : public CBase, public MAknFileFilter |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
63 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
64 public: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
65 void setFilter(const QString filter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
66 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
67 QStringList unparsedFiltersList = qt_make_filter_list(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
68 QStringList filterList; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
69 filterRxList.clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
70 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
71 foreach (QString unparsedFilter, unparsedFiltersList) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
72 filterList << qt_clean_filter_list(unparsedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
73 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
74 foreach (QString currentFilter, filterList) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
75 QRegExp filterRx(currentFilter, Qt::CaseInsensitive, QRegExp::Wildcard); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
76 filterRxList << filterRx; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
77 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
78 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
79 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
80 TBool Accept(const TDesC &/*aDriveAndPath*/, const TEntry &aEntry) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
81 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
82 //If no filter for files, all can be accepted |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
83 if (filterRxList.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
84 return ETrue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
85 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
86 if (aEntry.IsDir()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
87 return ETrue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
88 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
89 foreach (QRegExp rx, filterRxList) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
90 QString fileName = qt_TDesC2QString(aEntry.iName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
91 if (rx.exactMatch(fileName)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
92 return ETrue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
93 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
94 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
95 return EFalse; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
96 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
97 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
98 private: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
99 QList<QRegExp> filterRxList; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
100 }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
101 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
102 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
103 static QString launchSymbianDialog(const QString dialogCaption, const QString startDirectory, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
104 const QString filter, DialogMode dialogMode) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
105 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
106 QString selection; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
107 #if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
108 TFileName startFolder; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
109 if (!startDirectory.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
110 QString dir = QDir::toNativeSeparators(QFileDialogPrivate::workingDirectory(startDirectory)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
111 startFolder = qt_QString2TPtrC(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
112 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
113 TInt types = AknCommonDialogsDynMem::EMemoryTypeMMCExternal| |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
114 AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
115 AknCommonDialogsDynMem::EMemoryTypePhone; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
116 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
117 TPtrC titlePtr(qt_QString2TPtrC(dialogCaption)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
118 TFileName target; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
119 bool select = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
120 int tryCount = 2; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
121 while (tryCount--) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
122 TInt err(KErrNone); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
123 TRAP(err, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
124 if (dialogMode == DialogOpen) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
125 CExtensionFilter* extensionFilter = new (ELeave) CExtensionFilter; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
126 CleanupStack::PushL(extensionFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
127 extensionFilter->setFilter(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
128 select = AknCommonDialogsDynMem::RunSelectDlgLD(types, target, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
129 startFolder, 0, 0, titlePtr, extensionFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
130 CleanupStack::PopAndDestroy(extensionFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
131 } else if (dialogMode == DialogSave) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
132 QString defaultFileName = QFileDialogPrivate::initialSelection(startDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
133 target = qt_QString2TPtrC(defaultFileName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
134 select = AknCommonDialogsDynMem::RunSaveDlgLD(types, target, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
135 startFolder, 0, 0, titlePtr); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
136 } else if (dialogMode == DialogFolder) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
137 select = AknCommonDialogsDynMem::RunFolderSelectDlgLD(types, target, startFolder, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
138 0, 0, titlePtr, NULL, NULL); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
139 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
140 ); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
141 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
142 if (err == KErrNone) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
143 tryCount = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
144 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
145 // Symbian native file dialog doesn't allow accessing files outside C:/Data |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
146 // It will always leave in that case, so default into QDir::homePath() in error cases. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
147 QString dir = QDir::toNativeSeparators(QDir::homePath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
148 startFolder = qt_QString2TPtrC(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
149 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
150 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
151 if (select) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
152 QFileInfo fi(qt_TDesC2QString(target)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
153 selection = fi.absoluteFilePath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
154 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
155 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
156 return selection; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
157 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
158 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
159 QString qtSymbianGetOpenFileName(const QString &caption, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
160 const QString &dir, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
161 const QString &filter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
162 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
163 return launchSymbianDialog(caption, dir, filter, DialogOpen); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
164 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
165 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
166 QStringList qtSymbianGetOpenFileNames(const QString &caption, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
167 const QString &dir, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
168 const QString &filter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
169 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
170 QString fileName; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
171 fileName.append(launchSymbianDialog(caption, dir, filter, DialogOpen)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
172 QStringList fileList; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
173 fileList << fileName; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
174 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
175 return fileList; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
176 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
177 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
178 QString qtSymbianGetSaveFileName(const QString &caption, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
179 const QString &dir) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
180 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
181 return launchSymbianDialog(caption, dir, QString(), DialogSave); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
182 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
183 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
184 QString qtSymbianGetExistingDirectory(const QString &caption, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
185 const QString &dir) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
186 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
187 QString folderCaption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
188 if (!caption.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
189 folderCaption.append(caption); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
190 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
191 // Title for folder selection dialog is mandatory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
192 folderCaption.append(QFileDialog::tr("Find Directory")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
193 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
194 return launchSymbianDialog(folderCaption, dir, QString(), DialogFolder); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
195 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
196 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
197 QT_END_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
198 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
199 #endif |