Mercurial > octave
annotate libgui/languages/build_ts/octave-qt/qfiledialog.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 | 2e135e3cb1aa |
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 <qvariant.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 #include <private/qwidgetitemdata_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
|
44 #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
|
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 #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
|
47 #include "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
|
48 #include <qfontmetrics.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 <qaction.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 <qheaderview.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 <qshortcut.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 #include <qgridlayout.h> |
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 <qmenu.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 #include <qmessagebox.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
55 #include <qinputdialog.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
56 #include <stdlib.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
57 #include <qsettings.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
58 #include <qdebug.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
59 #include <qapplication.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
60 #include <qstylepainter.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
61 #include <private/qfileiconprovider_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
|
62 #if !defined(Q_WS_WINCE) && !defined(Q_OS_SYMBIAN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
63 #include "ui_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
|
64 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
65 #define Q_EMBEDDED_SMALLSCREEN |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
66 #include "ui_qfiledialog_embedded.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
67 #if defined(Q_OS_WINCE) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
68 extern bool qt_priv_ptr_valid; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
69 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
70 #if defined(Q_OS_UNIX) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
71 #include <pwd.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
72 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
73 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
74 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
75 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
|
76 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
77 Q_GLOBAL_STATIC(QString, lastVisitedDir) |
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 \internal |
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 Exported hooks that can be used to customize the static functions. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
83 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
84 typedef QString (*_qt_filedialog_existing_directory_hook)(QWidget *parent, const QString &caption, const QString &dir, QFileDialog::Options options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
85 Q_GUI_EXPORT _qt_filedialog_existing_directory_hook qt_filedialog_existing_directory_hook = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
86 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
87 typedef QString (*_qt_filedialog_open_filename_hook)(QWidget * parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
88 Q_GUI_EXPORT _qt_filedialog_open_filename_hook qt_filedialog_open_filename_hook = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
89 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
90 typedef QStringList (*_qt_filedialog_open_filenames_hook)(QWidget * parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
91 Q_GUI_EXPORT _qt_filedialog_open_filenames_hook qt_filedialog_open_filenames_hook = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
92 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
93 typedef QString (*_qt_filedialog_save_filename_hook)(QWidget * parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
94 Q_GUI_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_hook = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
95 |
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 \class QFileDialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
98 \brief The QFileDialog class provides a dialog that allow users to select files or directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
99 \ingroup standard-dialogs |
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 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
102 The QFileDialog class enables a user to traverse the file system in |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
103 order to select one or many files or a directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
104 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
105 The easiest way to create a QFileDialog is to use the static |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
106 functions. On Windows, Mac OS X, KDE and GNOME, these static functions will |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
107 call the native file dialog when possible. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
108 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
109 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 0 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
110 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
111 In the above example, a modal QFileDialog is created using a static |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
112 function. The dialog initially displays the contents of the "/home/jana" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
113 directory, and displays files matching the patterns given 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
|
114 string "Image Files (*.png *.jpg *.bmp)". The parent of the file dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
115 is set to \e this, and the window title is set to "Open Image". |
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 If you want to use multiple filters, separate each one with |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
118 \e two semicolons. For example: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
119 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
120 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 1 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
121 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
122 You can create your own QFileDialog without using the static |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
123 functions. By calling setFileMode(), you can specify what the user must |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
124 select in the dialog: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
125 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
126 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 2 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
127 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
128 In the above example, the mode of the file dialog is set to |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
129 AnyFile, meaning that the user can select any file, or even specify a |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
130 file that doesn't exist. This mode is useful for creating a |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
131 "Save As" file dialog. Use ExistingFile if the user must select an |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
132 existing file, or \l Directory if only a directory may be selected. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
133 See the \l QFileDialog::FileMode enum for the complete list of modes. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
134 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
135 The fileMode property contains the mode of operation for the dialog; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
136 this indicates what types of objects the user is expected to select. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
137 Use setNameFilter() to set the dialog's file filter. For example: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
138 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
139 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 3 |
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 In the above example, the filter is set to \c{"Images (*.png *.xpm *.jpg)"}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
142 this means that only files with the extension \c png, \c xpm, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
143 or \c jpg will be shown in the QFileDialog. You can apply |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
144 several filters by using setNameFilters(). Use selectNameFilter() to select |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
145 one of the filters you've given as the file dialog's default filter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
146 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
147 The file dialog has two view modes: \l{QFileDialog::}{List} and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
148 \l{QFileDialog::}{Detail}. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
149 \l{QFileDialog::}{List} presents the contents of the current directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
150 as a list of file and directory names. \l{QFileDialog::}{Detail} also |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
151 displays a list of file and directory names, but provides additional |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
152 information alongside each name, such as the file size and modification |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
153 date. Set the mode with setViewMode(): |
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 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
156 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
157 The last important function you will need to use when creating your |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
158 own file dialog is selectedFiles(). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
159 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
160 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
161 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
162 In the above example, a modal file dialog is created and shown. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
163 the user clicked OK, the file they selected is put in \c fileName. |
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 The dialog's working directory can be set with setDirectory(). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
166 Each file in the current directory can be selected using |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
167 the selectFile() function. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
168 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
169 The \l{dialogs/standarddialogs}{Standard Dialogs} example shows |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
170 how to use QFileDialog as well as other built-in Qt dialogs. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
171 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
172 \sa QDir, QFileInfo, QFile, QPrintDialog, QColorDialog, QFontDialog, {Standard Dialogs Example}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
173 {Application Example} |
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 |
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 \enum QFileDialog::AcceptMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
178 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
179 \value AcceptOpen |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
180 \value AcceptSave |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
181 */ |
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 \enum QFileDialog::ViewMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
185 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
186 This enum describes the view mode of the file dialog; i.e. what |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
187 information about each file will be displayed. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
188 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
189 \value Detail Displays an icon, a name, and details for each item in |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
190 the directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
191 \value List Displays only an icon and a name for each item 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
|
192 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 \sa setViewMode() |
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 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
198 \enum QFileDialog::FileMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
199 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
200 This enum is used to indicate what the user may select in the file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
201 dialog; i.e. what the dialog will return if the user clicks OK. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
202 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
203 \value AnyFile The name of a file, whether it exists or not. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
204 \value ExistingFile The name of a single existing file. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
205 \value Directory The name of a directory. Both files and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
206 directories are displayed. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
207 \value ExistingFiles The names of zero or more existing files. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
208 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
209 This value is obsolete since Qt 4.5: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
210 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
211 \value DirectoryOnly Use \c Directory and setOption(ShowDirsOnly, true) instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
212 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
213 \sa setFileMode() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
214 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
215 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
216 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
217 \enum QFileDialog::Option |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
218 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
219 \value ShowDirsOnly Only show directories in the file dialog. By |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
220 default both files and directories are shown. (Valid only 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
|
221 \l Directory file mode.) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
222 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
223 \value DontResolveSymlinks Don't resolve symlinks in the file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
224 dialog. By default symlinks are resolved. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
225 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
226 \value DontConfirmOverwrite Don't ask for confirmation if an |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
227 existing file is selected. By default confirmation is requested. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
228 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
229 \value DontUseNativeDialog Don't use the native file dialog. By |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
230 default, the native file dialog is used unless you use a subclass |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
231 of QFileDialog that contains the Q_OBJECT macro. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
232 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
233 \value ReadOnly Indicates that the model is readonly. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
234 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
235 \value HideNameFilterDetails Indicates if the file name filter details are |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
236 hidden or not. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
237 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
238 \value DontUseSheet In previous versions of Qt, the static |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
239 functions would create a sheet by default if the static function |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
240 was given a parent. This is no longer supported and does nothing in Qt 4.5, The |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
241 static functions will always be an application modal dialog. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
242 you want to use sheets, use QFileDialog::open() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
243 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
244 \value DontUseCustomDirectoryIcons Always use the default directory icon. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
245 Some platforms allow the user to set a different icon. Custom icon lookup |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
246 cause a big performance impact over network or removable drives. Setting this |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
247 will affect the behavior of the icon provider. This enum value was added in Qt 4.8.6. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
248 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
249 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
250 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
251 \enum QFileDialog::DialogLabel |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
252 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
253 \value LookIn |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
254 \value FileName |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
255 \value FileType |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
256 \value Accept |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
257 \value Reject |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
258 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
259 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
260 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
261 \fn void QFileDialog::filesSelected(const QStringList &selected) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
262 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
263 When the selection changes and the dialog is accepted, this signal is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
264 emitted with the (possibly empty) list of \a selected files. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
265 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
266 \sa currentChanged(), QDialog::Accepted |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
267 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
268 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
269 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
270 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
271 \fn void QFileDialog::fileSelected(const QString &file) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
272 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
273 When the selection changes and the dialog is accepted, this signal is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
274 emitted with the (possibly empty) selected \a file. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
275 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
276 \sa currentChanged(), QDialog::Accepted |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
277 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
278 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
279 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
280 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
281 \fn void QFileDialog::currentChanged(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
282 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
283 When the current file changes, this signal is emitted 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
|
284 new file name as the \a path parameter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
285 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
286 \sa filesSelected() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
287 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
288 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
289 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
290 \fn void QFileDialog::directoryEntered(const QString &directory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
291 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
292 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
293 This signal is emitted when the user enters a \a directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
294 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
295 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
296 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
297 \fn void QFileDialog::filterSelected(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
|
298 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
299 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
300 This signal is emitted when the user selects a \a filter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
301 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
302 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
303 #if defined(Q_WS_WIN) || defined(Q_WS_MAC) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
304 bool Q_GUI_EXPORT qt_use_native_dialogs = true; // for the benefit of testing tools, until we have a proper API |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
305 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
306 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
307 QT_BEGIN_INCLUDE_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
308 #ifdef Q_WS_WIN |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
309 #include <qwindowsstyle.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
310 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
311 #include <qshortcut.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
312 #ifdef Q_WS_MAC |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
313 #include <qmacstyle_mac.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
314 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
315 QT_END_INCLUDE_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
316 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
317 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
318 \fn QFileDialog::QFileDialog(QWidget *parent, Qt::WindowFlags flags) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
319 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
320 Constructs a file dialog with the given \a parent and widget \a flags. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
321 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
322 QFileDialog::QFileDialog(QWidget *parent, Qt::WindowFlags f) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
323 : QDialog(*new QFileDialogPrivate, parent, f) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
324 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
325 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
326 d->init(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
327 d->lineEdit()->selectAll(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
328 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
329 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
330 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
331 Constructs a file dialog with the given \a parent and \a caption that |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
332 initially displays the contents of the specified \a directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
333 The contents of the directory are filtered before being shown 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
|
334 dialog, using a semicolon-separated list of filters specified by |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
335 \a filter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
336 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
337 QFileDialog::QFileDialog(QWidget *parent, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
338 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
|
339 const QString &directory, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
340 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
|
341 : QDialog(*new QFileDialogPrivate, parent, 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
342 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
343 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
344 d->init(directory, filter, caption); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
345 d->lineEdit()->selectAll(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
346 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
347 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
348 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
349 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
350 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
351 QFileDialog::QFileDialog(const QFileDialogArgs &args) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
352 : QDialog(*new QFileDialogPrivate, args.parent, 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
353 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
354 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
355 d->init(args.directory, args.filter, args.caption); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
356 setFileMode(args.mode); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
357 setOptions(args.options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
358 selectFile(args.selection); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
359 d->lineEdit()->selectAll(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
360 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
361 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
362 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
363 Destroys the file dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
364 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
365 QFileDialog::~QFileDialog() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
366 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
367 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
368 #ifndef QT_NO_SETTINGS |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
369 QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
370 settings.beginGroup(QLatin1String("Qt")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
371 settings.setValue(QLatin1String("filedialog"), saveState()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
372 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
373 d->deleteNativeDialog_sys(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
374 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
375 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
376 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
377 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
378 Sets the \a urls that are located in the sidebar. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
379 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
380 For instance: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
381 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
382 \snippet doc/src/snippets/filedialogurls.cpp 0 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
383 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
384 The file dialog will then look like this: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
385 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
386 \image filedialogurls.png |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
387 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
388 \sa sidebarUrls() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
389 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
390 void QFileDialog::setSidebarUrls(const QList<QUrl> &urls) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
391 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
392 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
393 d->qFileDialogUi->sidebar->setUrls(urls); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
394 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
395 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
396 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
397 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
398 Returns a list of urls that are currently in the sidebar |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
399 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
400 QList<QUrl> QFileDialog::sidebarUrls() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
401 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
402 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
403 return d->qFileDialogUi->sidebar->urls(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
404 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
405 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
406 static const qint32 QFileDialogMagic = 0xbe; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
407 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
408 const char *qt_file_dialog_filter_reg_exp = |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
409 "^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
410 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
411 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
412 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
413 Saves the state of the dialog's layout, history and current directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
414 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
415 Typically this is used in conjunction with QSettings to remember the size |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
416 for a future session. A version number is stored as part of the data. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
417 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
418 QByteArray QFileDialog::saveState() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
419 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
420 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
421 int version = 3; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
422 QByteArray data; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
423 QDataStream stream(&data, QIODevice::WriteOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
424 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
425 stream << qint32(QFileDialogMagic); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
426 stream << qint32(version); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
427 stream << d->qFileDialogUi->splitter->saveState(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
428 stream << d->qFileDialogUi->sidebar->urls(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
429 stream << history(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
430 stream << *lastVisitedDir(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
431 stream << d->qFileDialogUi->treeView->header()->saveState(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
432 stream << qint32(viewMode()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
433 return data; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
434 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
435 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
436 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
437 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
438 Restores the dialogs's layout, history and current directory to the \a state specified. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
439 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
440 Typically this is used in conjunction with QSettings to restore the size |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
441 from a past session. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
442 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
443 Returns false if there are errors |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
444 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
445 bool QFileDialog::restoreState(const QByteArray &state) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
446 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
447 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
448 int version = 3; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
449 QByteArray sd = state; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
450 QDataStream stream(&sd, QIODevice::ReadOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
451 if (stream.atEnd()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
452 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
453 QByteArray splitterState; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
454 QByteArray headerData; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
455 QList<QUrl> bookmarks; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
456 QStringList history; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
457 QString currentDirectory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
458 qint32 marker; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
459 qint32 v; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
460 qint32 viewMode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
461 stream >> marker; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
462 stream >> v; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
463 if (marker != QFileDialogMagic || v != version) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
464 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
465 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
466 stream >> splitterState |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
467 >> bookmarks |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
468 >> history |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
469 >> currentDirectory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
470 >> headerData |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
471 >> viewMode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
472 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
473 if (!d->qFileDialogUi->splitter->restoreState(splitterState)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
474 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
475 QList<int> list = d->qFileDialogUi->splitter->sizes(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
476 if (list.count() >= 2 && list.at(0) == 0 && list.at(1) == 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
477 for (int i = 0; i < list.count(); ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
478 list[i] = d->qFileDialogUi->splitter->widget(i)->sizeHint().width(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
479 d->qFileDialogUi->splitter->setSizes(list); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
480 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
481 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
482 d->qFileDialogUi->sidebar->setUrls(bookmarks); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
483 while (history.count() > 5) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
484 history.pop_front(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
485 setHistory(history); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
486 setDirectory(lastVisitedDir()->isEmpty() ? currentDirectory : *lastVisitedDir()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
487 QHeaderView *headerView = d->qFileDialogUi->treeView->header(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
488 if (!headerView->restoreState(headerData)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
489 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
490 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
491 QList<QAction*> actions = headerView->actions(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
492 QAbstractItemModel *abstractModel = d->model; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
493 #ifndef QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
494 if (d->proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
495 abstractModel = d->proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
496 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
497 int total = qMin(abstractModel->columnCount(QModelIndex()), actions.count() + 1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
498 for (int i = 1; i < total; ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
499 actions.at(i - 1)->setChecked(!headerView->isSectionHidden(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
500 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
501 setViewMode(ViewMode(viewMode)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
502 return true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
503 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
504 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
505 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
506 \reimp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
507 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
508 void QFileDialog::changeEvent(QEvent *e) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
509 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
510 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
511 if (e->type() == QEvent::LanguageChange) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
512 d->retranslateWindowTitle(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
513 d->retranslateStrings(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
514 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
515 QDialog::changeEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
516 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
517 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
518 QFileDialogPrivate::QFileDialogPrivate() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
519 : |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
520 #ifndef QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
521 proxyModel(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
522 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
523 model(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
524 fileMode(QFileDialog::AnyFile), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
525 acceptMode(QFileDialog::AcceptOpen), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
526 currentHistoryLocation(-1), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
527 renameAction(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
528 deleteAction(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
529 showHiddenAction(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
530 useDefaultCaption(true), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
531 defaultFileTypes(true), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
532 fileNameLabelExplicitlySat(false), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
533 nativeDialogInUse(false), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
534 #ifdef Q_WS_MAC |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
535 mDelegate(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
536 #ifndef QT_MAC_USE_COCOA |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
537 mDialog(0), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
538 mDialogStarted(false), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
539 mDialogClosed(true), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
540 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
541 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
542 qFileDialogUi(0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
543 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
544 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
545 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
546 QFileDialogPrivate::~QFileDialogPrivate() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
547 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
548 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
549 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
550 void QFileDialogPrivate::retranslateWindowTitle() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
551 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
552 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
553 if (!useDefaultCaption || setWindowTitle != q->windowTitle()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
554 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
555 if (acceptMode == QFileDialog::AcceptOpen) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
556 if (fileMode == QFileDialog::DirectoryOnly || fileMode == QFileDialog::Directory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
557 q->setWindowTitle(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
|
558 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
559 q->setWindowTitle(QFileDialog::tr("Open")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
560 } else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
561 q->setWindowTitle(QFileDialog::tr("Save As")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
562 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
563 setWindowTitle = q->windowTitle(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
564 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
565 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
566 void QFileDialogPrivate::setLastVisitedDirectory(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
|
567 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
568 *lastVisitedDir() = dir; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
569 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
570 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
571 void QFileDialogPrivate::retranslateStrings() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
572 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
573 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
574 /* WIDGETS */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
575 if (defaultFileTypes) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
576 q->setNameFilter(QFileDialog::tr("All Files (*)")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
577 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
578 QList<QAction*> actions = qFileDialogUi->treeView->header()->actions(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
579 QAbstractItemModel *abstractModel = model; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
580 #ifndef QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
581 if (proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
582 abstractModel = proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
583 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
584 int total = qMin(abstractModel->columnCount(QModelIndex()), actions.count() + 1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
585 for (int i = 1; i < total; ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
586 actions.at(i - 1)->setText(QFileDialog::tr("Show ") + abstractModel->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
587 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
588 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
589 /* MENU ACTIONS */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
590 renameAction->setText(QFileDialog::tr("&Rename")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
591 deleteAction->setText(QFileDialog::tr("&Delete")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
592 showHiddenAction->setText(QFileDialog::tr("Show &hidden files")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
593 newFolderAction->setText(QFileDialog::tr("&New Folder")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
594 qFileDialogUi->retranslateUi(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
595 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
596 if (!fileNameLabelExplicitlySat){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
597 if (fileMode == QFileDialog::DirectoryOnly || fileMode == QFileDialog::Directory) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
598 q->setLabelText(QFileDialog::FileName, QFileDialog::tr("Directory:")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
599 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
600 q->setLabelText(QFileDialog::FileName, QFileDialog::tr("File &name:")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
601 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
602 fileNameLabelExplicitlySat = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
603 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
604 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
605 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
606 void QFileDialogPrivate::emitFilesSelected(const QStringList &files) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
607 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
608 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
609 emit q->filesSelected(files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
610 if (files.count() == 1) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
611 emit q->fileSelected(files.first()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
612 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
613 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
614 bool QFileDialogPrivate::canBeNativeDialog() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
615 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
616 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
617 if (nativeDialogInUse) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
618 return true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
619 if (q->testAttribute(Qt::WA_DontShowOnScreen)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
620 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
621 if (opts & QFileDialog::DontUseNativeDialog) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
622 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
623 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
624 QLatin1String staticName(QFileDialog::staticMetaObject.className()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
625 QLatin1String dynamicName(q->metaObject()->className()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
626 return (staticName == dynamicName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
627 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
628 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
629 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
630 \since 4.5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
631 Sets the given \a option to be enabled if \a on is true; otherwise, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
632 clears the given \a option. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
633 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
634 \sa options, testOption() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
635 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
636 void QFileDialog::setOption(Option option, bool on) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
637 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
638 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
639 if (!(d->opts & option) != !on) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
640 setOptions(d->opts ^ option); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
641 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
642 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
643 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
644 \since 4.5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
645 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
646 Returns true if the given \a option is enabled; otherwise, returns |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
647 false. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
648 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
649 \sa options, setOption() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
650 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
651 bool QFileDialog::testOption(Option option) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
652 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
653 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
654 return (d->opts & option) != 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
655 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
656 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
657 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
658 \property QFileDialog::options |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
659 \brief the various options that affect the look and feel of the dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
660 \since 4.5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
661 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
662 By default, all options are disabled. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
663 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
664 Options should be set before showing the dialog. Setting them while the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
665 dialog is visible is not guaranteed to have an immediate effect on the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
666 dialog (depending on the option and on the platform). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
667 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
668 \sa setOption(), testOption() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
669 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
670 void QFileDialog::setOptions(Options options) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
671 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
672 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
673 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
674 Options changed = (options ^ d->opts); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
675 if (!changed) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
676 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
677 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
678 d->opts = options; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
679 if (changed & DontResolveSymlinks) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
680 d->model->setResolveSymlinks(!(options & DontResolveSymlinks)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
681 if (changed & ReadOnly) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
682 bool ro = (options & ReadOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
683 d->model->setReadOnly(ro); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
684 d->qFileDialogUi->newFolderButton->setEnabled(!ro); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
685 d->renameAction->setEnabled(!ro); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
686 d->deleteAction->setEnabled(!ro); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
687 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
688 if (changed & HideNameFilterDetails) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
689 setNameFilters(d->nameFilters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
690 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
691 if (changed & ShowDirsOnly) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
692 setFilter((options & ShowDirsOnly) ? filter() & ~QDir::Files : filter() | QDir::Files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
693 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
694 if (changed & DontUseCustomDirectoryIcons) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
695 iconProvider()->d_ptr->setUseCustomDirectoryIcons(!(options & DontUseCustomDirectoryIcons)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
696 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
697 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
698 QFileDialog::Options QFileDialog::options() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
699 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
700 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
701 return d->opts; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
702 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
703 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
704 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
705 \overload |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
706 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
707 \since 4.5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
708 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
709 This function connects one of its signals to the slot specified by \a receiver |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
710 and \a member. The specific signal depends is filesSelected() if fileMode is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
711 ExistingFiles and fileSelected() if fileMode is anything else. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
712 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
713 The signal will be disconnected from the slot when the dialog is closed. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
714 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
715 void QFileDialog::open(QObject *receiver, const char *member) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
716 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
717 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
718 const char *signal = (fileMode() == ExistingFiles) ? SIGNAL(filesSelected(QStringList)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
719 : SIGNAL(fileSelected(QString)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
720 connect(this, signal, receiver, member); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
721 d->signalToDisconnectOnClose = signal; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
722 d->receiverToDisconnectOnClose = receiver; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
723 d->memberToDisconnectOnClose = member; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
724 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
725 QDialog::open(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
726 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
727 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
728 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
729 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
730 \reimp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
731 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
732 void QFileDialog::setVisible(bool visible) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
733 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
734 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
735 if (visible){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
736 if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
737 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
738 } else if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
739 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
740 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
741 if (d->canBeNativeDialog()){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
742 if (d->setVisible_sys(visible)){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
743 d->nativeDialogInUse = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
744 // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
745 // updates the state correctly, but skips showing the non-native version: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
746 setAttribute(Qt::WA_DontShowOnScreen); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
747 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
748 //So the completer don't try to complete and therefore to show a popup |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
749 d->completer->setModel(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
750 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
751 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
752 d->nativeDialogInUse = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
753 setAttribute(Qt::WA_DontShowOnScreen, false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
754 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
755 if (d->proxyModel != 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
756 d->completer->setModel(d->proxyModel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
757 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
758 d->completer->setModel(d->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
759 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
760 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
761 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
762 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
763 if (!d->nativeDialogInUse) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
764 d->qFileDialogUi->fileNameEdit->setFocus(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
765 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
766 QDialog::setVisible(visible); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
767 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
768 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
769 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
770 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
771 set the directory to url |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
772 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
773 void QFileDialogPrivate::_q_goToUrl(const QUrl &url) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
774 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
775 //The shortcut in the side bar may have a parent that is not fetched yet (e.g. an hidden file) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
776 //so we force the fetching |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
777 QFileSystemModelPrivate::QFileSystemNode *node = model->d_func()->node(url.toLocalFile(), true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
778 QModelIndex idx = model->d_func()->index(node); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
779 _q_enterDirectory(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
780 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
781 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
782 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
783 \fn void QFileDialog::setDirectory(const QDir &directory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
784 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
785 \overload |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
786 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
787 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
788 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
789 Sets the file dialog's current \a directory. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
790 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
791 void QFileDialog::setDirectory(const QString &directory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
792 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
793 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
794 QString newDirectory = directory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
795 QFileInfo info(directory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
796 //we remove .. and . from the given path if exist |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
797 if (!directory.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
798 newDirectory = QDir::cleanPath(directory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
799 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
800 if (!directory.isEmpty() && newDirectory.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
801 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
802 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
803 d->setLastVisitedDirectory(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
804 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
805 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
806 d->setDirectory_sys(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
807 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
808 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
809 if (d->rootPath() == newDirectory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
810 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
811 QModelIndex root = d->model->setRootPath(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
812 d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
813 if (root != d->rootIndex()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
814 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
815 if (directory.endsWith(QLatin1Char('/'))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
816 d->completer->setCompletionPrefix(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
817 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
818 d->completer->setCompletionPrefix(newDirectory + QLatin1Char('/')); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
819 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
820 d->setRootIndex(root); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
821 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
822 d->qFileDialogUi->listView->selectionModel()->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
823 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
824 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
825 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
826 Returns the directory currently being displayed in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
827 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
828 QDir QFileDialog::directory() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
829 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
830 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
831 return QDir(d->nativeDialogInUse ? d->directory_sys() : d->rootPath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
832 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
833 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
834 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
835 Selects the given \a filename in the file dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
836 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
837 \sa selectedFiles() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
838 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
839 void QFileDialog::selectFile(const 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
|
840 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
841 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
842 if (filename.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
843 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
844 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
845 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
846 d->selectFile_sys(filename); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
847 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
848 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
849 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
850 if (!QDir::isRelativePath(filename)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
851 QFileInfo info(filename); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
852 QString filenamePath = info.absoluteDir().path(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
853 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
854 if (d->model->rootPath() != filenamePath) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
855 setDirectory(filenamePath); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
856 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
857 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
858 QModelIndex index = d->model->index(filename); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
859 QString file; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
860 if (!index.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
861 // save as dialog where we want to input a default value |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
862 QString text = filename; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
863 if (QFileInfo(filename).isAbsolute()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
864 QString current = d->rootPath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
865 text.remove(current); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
866 if (text.at(0) == QDir::separator() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
867 #ifdef Q_OS_WIN |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
868 //On Windows both cases can happen |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
869 || text.at(0) == QLatin1Char('/') |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
870 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
871 ) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
872 text = text.remove(0,1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
873 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
874 file = text; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
875 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
876 file = index.data().toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
877 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
878 d->qFileDialogUi->listView->selectionModel()->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
879 if (!isVisible() || !d->lineEdit()->hasFocus()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
880 d->lineEdit()->setText(file); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
881 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
882 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
883 #ifdef Q_OS_UNIX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
884 Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
885 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
886 if (expanded != 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
887 *expanded = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
888 if (!path.startsWith(QLatin1Char('~'))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
889 return path; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
890 QString ret = path; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
891 #if !defined(Q_OS_INTEGRITY) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
892 QStringList tokens = ret.split(QDir::separator()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
893 if (tokens.first() == QLatin1String("~")) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
894 ret.replace(0, 1, 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
|
895 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
896 QString userName = tokens.first(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
897 userName.remove(0, 1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
898 #if defined(Q_OS_VXWORKS) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
899 const QString homePath = 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
|
900 #elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
901 passwd pw; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
902 passwd *tmpPw; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
903 char buf[200]; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
904 const int bufSize = sizeof(buf); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
905 int err = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
906 #if defined(Q_OS_SOLARIS) && (_POSIX_C_SOURCE - 0 < 199506L) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
907 tmpPw = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
908 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
909 err = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize, &tmpPw); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
910 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
911 if (err || !tmpPw) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
912 return ret; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
913 const QString homePath = QString::fromLocal8Bit(pw.pw_dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
914 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
915 passwd *pw = getpwnam(userName.toLocal8Bit().constData()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
916 if (!pw) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
917 return ret; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
918 const QString homePath = QString::fromLocal8Bit(pw->pw_dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
919 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
920 ret.replace(0, tokens.first().length(), homePath); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
921 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
922 if (expanded != 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
923 *expanded = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
924 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
925 return ret; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
926 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
927 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
928 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
929 /** |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
930 Returns the text in the line edit which can be one or more file names |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
931 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
932 QStringList QFileDialogPrivate::typedFiles() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
933 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
934 #ifdef Q_OS_UNIX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
935 Q_Q(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
936 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
937 QStringList files; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
938 QString editText = lineEdit()->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
939 if (!editText.contains(QLatin1Char('"'))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
940 #ifdef Q_OS_UNIX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
941 const QString prefix = q->directory().absolutePath() + QDir::separator(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
942 if (QFile::exists(prefix + editText)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
943 files << editText; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
944 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
945 files << qt_tildeExpansion(editText); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
946 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
947 files << editText; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
948 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
949 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
950 // " is used to separate files like so: "file1" "file2" "file3" ... |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
951 // ### need escape character for filenames with quotes (") |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
952 QStringList tokens = editText.split(QLatin1Char('\"')); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
953 for (int i=0; i<tokens.size(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
954 if ((i % 2) == 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
955 continue; // Every even token is a separator |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
956 #ifdef Q_OS_UNIX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
957 const QString token = tokens.at(i); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
958 const QString prefix = q->directory().absolutePath() + QDir::separator(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
959 if (QFile::exists(prefix + token)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
960 files << token; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
961 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
962 files << qt_tildeExpansion(token); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
963 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
964 files << toInternal(tokens.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
965 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
966 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
967 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
968 return addDefaultSuffixToFiles(files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
969 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
970 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
971 QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList filesToFix) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
972 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
973 QStringList files; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
974 for (int i=0; i<filesToFix.size(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
975 QString name = toInternal(filesToFix.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
976 QFileInfo info(name); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
977 // if the filename has no suffix, add the default suffix |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
978 if (!defaultSuffix.isEmpty() && !info.isDir() && name.lastIndexOf(QLatin1Char('.')) == -1) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
979 name += QLatin1Char('.') + defaultSuffix; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
980 if (info.isAbsolute()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
981 files.append(name); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
982 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
983 // at this point the path should only have Qt path separators. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
984 // This check is needed since we might be at the root directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
985 // and on Windows it already ends with slash. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
986 QString path = rootPath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
987 if (!path.endsWith(QLatin1Char('/'))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
988 path += QLatin1Char('/'); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
989 path += name; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
990 files.append(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
991 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
992 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
993 return files; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
994 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
995 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
996 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
997 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
998 Returns a list of strings containing the absolute paths of the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
999 selected files in the dialog. If no files are selected, or |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1000 the mode is not ExistingFiles or ExistingFile, selectedFiles() contains the current path in the viewport. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1001 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1002 \sa selectedNameFilter(), selectFile() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1003 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1004 QStringList QFileDialog::selectedFiles() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1005 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1006 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1007 if (d->nativeDialogInUse) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1008 return d->addDefaultSuffixToFiles(d->selectedFiles_sys()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1009 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1010 QModelIndexList indexes = d->qFileDialogUi->listView->selectionModel()->selectedRows(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1011 QStringList files; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1012 for (int i = 0; i < indexes.count(); ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1013 files.append(indexes.at(i).data(QFileSystemModel::FilePathRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1014 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1015 if (files.isEmpty() && !d->lineEdit()->text().isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1016 files = d->typedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1017 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1018 if (files.isEmpty() && !(d->fileMode == ExistingFile || d->fileMode == ExistingFiles)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1019 files.append(d->rootIndex().data(QFileSystemModel::FilePathRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1020 return files; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1021 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1022 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1023 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1024 Makes a list of filters from ;;-separated text. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1025 Used by the mac and windows implementations |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1026 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1027 QStringList qt_make_filter_list(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
|
1028 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1029 QString f(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1030 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1031 if (f.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1032 return QStringList(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1033 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1034 QString sep(QLatin1String(";;")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1035 int i = f.indexOf(sep, 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1036 if (i == -1) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1037 if (f.indexOf(QLatin1Char('\n'), 0) != -1) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1038 sep = QLatin1Char('\n'); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1039 i = f.indexOf(sep, 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1040 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1041 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1042 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1043 return f.split(sep); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1044 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1045 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1046 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1047 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1048 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1049 Sets the filter used in the file dialog to the given \a filter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1050 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1051 If \a filter contains a pair of parentheses containing one or more |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1052 of \bold{anything*something}, separated by spaces, then only the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1053 text contained in the parentheses is used as the filter. This means |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1054 that these calls are all equivalent: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1055 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1056 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 6 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1057 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1058 \sa setNameFilters() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1059 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1060 void QFileDialog::setNameFilter(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
|
1061 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1062 setNameFilters(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
|
1063 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1064 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1065 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1066 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1067 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1068 Use setNameFilter() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1069 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1070 void QFileDialog::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
|
1071 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1072 setNameFilter(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1073 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1074 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1075 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1076 \property QFileDialog::nameFilterDetailsVisible |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1077 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1078 \brief This property holds whether the filter details is shown or not. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1079 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1080 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1081 When this property is true (the default), the filter details are shown |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1082 in the combo box. When the property is set to false, these are hidden. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1083 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1084 Use setOption(HideNameFilterDetails, !\e enabled) or |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1085 !testOption(HideNameFilterDetails). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1086 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1087 void QFileDialog::setNameFilterDetailsVisible(bool enabled) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1088 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1089 setOption(HideNameFilterDetails, !enabled); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1090 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1091 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1092 bool QFileDialog::isNameFilterDetailsVisible() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1093 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1094 return !testOption(HideNameFilterDetails); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1095 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1096 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1097 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1098 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1099 Strip the filters by removing the details, e.g. (*.*). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1100 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1101 QStringList qt_strip_filters(const QStringList &filters) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1102 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1103 QStringList strippedFilters; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1104 QRegExp r(QString::fromLatin1(qt_file_dialog_filter_reg_exp)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1105 for (int i = 0; i < filters.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1106 QString filterName; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1107 int index = r.indexIn(filters[i]); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1108 if (index >= 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1109 filterName = r.cap(1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1110 strippedFilters.append(filterName.simplified()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1111 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1112 return strippedFilters; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1113 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1114 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1115 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1116 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1117 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1118 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1119 Sets the \a filters used in the file dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1120 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1121 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 7 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1122 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1123 void QFileDialog::setNameFilters(const QStringList &filters) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1124 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1125 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1126 d->defaultFileTypes = (filters == QStringList(QFileDialog::tr("All Files (*)"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1127 QStringList cleanedFilters; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1128 for (int i = 0; i < filters.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1129 cleanedFilters << filters[i].simplified(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1130 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1131 d->nameFilters = cleanedFilters; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1132 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1133 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1134 d->setNameFilters_sys(cleanedFilters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1135 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1136 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1137 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1138 d->qFileDialogUi->fileTypeCombo->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1139 if (cleanedFilters.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1140 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1141 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1142 if (testOption(HideNameFilterDetails)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1143 d->qFileDialogUi->fileTypeCombo->addItems(qt_strip_filters(cleanedFilters)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1144 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1145 d->qFileDialogUi->fileTypeCombo->addItems(cleanedFilters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1146 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1147 d->_q_useNameFilter(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1148 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1149 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1150 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1151 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1152 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1153 Use setNameFilters() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1154 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1155 void QFileDialog::setFilters(const QStringList &filters) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1156 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1157 setNameFilters(filters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1158 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1159 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1160 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1161 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1162 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1163 Returns the file type filters that are in operation on this file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1164 dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1165 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1166 QStringList QFileDialog::nameFilters() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1167 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1168 return d_func()->nameFilters; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1169 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1170 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1171 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1172 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1173 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1174 Use nameFilters() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1175 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1176 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1177 QStringList QFileDialog::filters() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1178 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1179 return nameFilters(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1180 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1181 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1182 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1183 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1184 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1185 Sets the current file type \a filter. Multiple filters can be |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1186 passed in \a filter by separating them with semicolons or spaces. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1187 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1188 \sa setNameFilter(), setNameFilters(), selectedNameFilter() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1189 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1190 void QFileDialog::selectNameFilter(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
|
1191 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1192 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1193 if (d->nativeDialogInUse) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1194 d->selectNameFilter_sys(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1195 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1196 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1197 int i = -1; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1198 if (testOption(HideNameFilterDetails)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1199 const QStringList filters = qt_strip_filters(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
|
1200 if (!filters.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1201 i = d->qFileDialogUi->fileTypeCombo->findText(filters.first()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1202 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1203 i = d->qFileDialogUi->fileTypeCombo->findText(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1204 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1205 if (i >= 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1206 d->qFileDialogUi->fileTypeCombo->setCurrentIndex(i); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1207 d->_q_useNameFilter(d->qFileDialogUi->fileTypeCombo->currentIndex()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1208 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1209 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1210 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1211 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1212 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1213 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1214 Use selectNameFilter() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1215 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1216 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1217 void QFileDialog::selectFilter(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
|
1218 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1219 selectNameFilter(filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1220 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1221 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1222 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1223 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1224 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1225 Returns the filter that the user selected in the file dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1226 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1227 \sa selectedFiles() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1228 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1229 QString QFileDialog::selectedNameFilter() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1230 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1231 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1232 if (d->nativeDialogInUse) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1233 return d->selectedNameFilter_sys(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1234 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1235 return d->qFileDialogUi->fileTypeCombo->currentText(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1236 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1237 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1238 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1239 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1240 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1241 Use selectedNameFilter() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1242 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1243 QString QFileDialog::selectedFilter() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1244 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1245 return selectedNameFilter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1246 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1247 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1248 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1249 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1250 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1251 Returns the filter that is used when displaying files. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1252 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1253 \sa setFilter() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1254 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1255 QDir::Filters QFileDialog::filter() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1256 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1257 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1258 return d->model->filter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1259 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1260 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1261 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1262 \since 4.4 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1263 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1264 Sets the filter used by the model to \a filters. The filter is used |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1265 to specify the kind of files that should be shown. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1266 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1267 \sa filter() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1268 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1269 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1270 void QFileDialog::setFilter(QDir::Filters filters) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1271 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1272 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1273 d->model->setFilter(filters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1274 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1275 d->setFilter_sys(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1276 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1277 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1278 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1279 d->showHiddenAction->setChecked((filters & QDir::Hidden)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1280 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1281 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1282 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1283 \property QFileDialog::viewMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1284 \brief the way files and directories are displayed in the dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1285 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1286 By default, the \c Detail mode is used to display information about |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1287 files and directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1288 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1289 \sa ViewMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1290 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1291 void QFileDialog::setViewMode(QFileDialog::ViewMode mode) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1292 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1293 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1294 if (mode == Detail) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1295 d->_q_showDetailsView(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1296 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1297 d->_q_showListView(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1298 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1299 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1300 QFileDialog::ViewMode QFileDialog::viewMode() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1301 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1302 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1303 return (d->qFileDialogUi->stackedWidget->currentWidget() == d->qFileDialogUi->listView->parent() ? QFileDialog::List : QFileDialog::Detail); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1304 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1305 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1306 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1307 \property QFileDialog::fileMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1308 \brief the file mode of the dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1309 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1310 The file mode defines the number and type of items that the user is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1311 expected to select in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1312 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1313 By default, this property is set to AnyFile. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1314 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1315 This function will set the labels for the FileName and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1316 \l{QFileDialog::}{Accept} \l{DialogLabel}s. It is possible to set |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1317 custom text after the call to setFileMode(). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1318 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1319 \sa FileMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1320 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1321 void QFileDialog::setFileMode(QFileDialog::FileMode mode) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1322 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1323 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1324 d->fileMode = mode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1325 d->retranslateWindowTitle(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1326 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1327 // keep ShowDirsOnly option in sync with fileMode (BTW, DirectoryOnly is obsolete) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1328 setOption(ShowDirsOnly, mode == DirectoryOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1329 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1330 // set selection mode and behavior |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1331 QAbstractItemView::SelectionMode selectionMode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1332 if (mode == QFileDialog::ExistingFiles) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1333 selectionMode = QAbstractItemView::ExtendedSelection; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1334 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1335 selectionMode = QAbstractItemView::SingleSelection; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1336 d->qFileDialogUi->listView->setSelectionMode(selectionMode); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1337 d->qFileDialogUi->treeView->setSelectionMode(selectionMode); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1338 // set filter |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1339 d->model->setFilter(d->filterForMode(filter())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1340 // setup file type for directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1341 QString buttonText = (d->acceptMode == AcceptOpen ? tr("&Open") : tr("&Save")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1342 if (mode == DirectoryOnly || mode == Directory) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1343 d->qFileDialogUi->fileTypeCombo->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1344 d->qFileDialogUi->fileTypeCombo->addItem(tr("Directories")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1345 d->qFileDialogUi->fileTypeCombo->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1346 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1347 if (!d->fileNameLabelExplicitlySat){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1348 setLabelText(FileName, tr("Directory:")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1349 d->fileNameLabelExplicitlySat = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1350 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1351 buttonText = tr("&Choose"); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1352 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1353 if (!d->fileNameLabelExplicitlySat){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1354 setLabelText(FileName, tr("File &name:")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1355 d->fileNameLabelExplicitlySat = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1356 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1357 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1358 setLabelText(Accept, buttonText); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1359 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1360 d->setFilter_sys(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1361 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1362 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1363 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1364 d->qFileDialogUi->fileTypeCombo->setEnabled(!testOption(ShowDirsOnly)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1365 d->_q_updateOkButton(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1366 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1367 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1368 QFileDialog::FileMode QFileDialog::fileMode() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1369 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1370 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1371 return d->fileMode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1372 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1373 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1374 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1375 \property QFileDialog::acceptMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1376 \brief the accept mode of the dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1377 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1378 The action mode defines whether the dialog is for opening or saving files. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1379 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1380 By default, this property is set to \l{AcceptOpen}. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1381 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1382 \sa AcceptMode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1383 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1384 void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1385 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1386 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1387 d->acceptMode = mode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1388 bool directoryMode = (d->fileMode == Directory || d->fileMode == DirectoryOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1389 QDialogButtonBox::StandardButton button = (mode == AcceptOpen ? QDialogButtonBox::Open : QDialogButtonBox::Save); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1390 d->qFileDialogUi->buttonBox->setStandardButtons(button | QDialogButtonBox::Cancel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1391 d->qFileDialogUi->buttonBox->button(button)->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1392 d->_q_updateOkButton(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1393 if (mode == AcceptOpen && directoryMode) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1394 setLabelText(Accept, tr("&Choose")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1395 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1396 setLabelText(Accept, (mode == AcceptOpen ? tr("&Open") : tr("&Save"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1397 if (mode == AcceptSave) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1398 d->qFileDialogUi->lookInCombo->setEditable(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1399 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1400 d->retranslateWindowTitle(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1401 #if defined(Q_WS_MAC) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1402 d->deleteNativeDialog_sys(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1403 setAttribute(Qt::WA_DontShowOnScreen, false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1404 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1405 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1406 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1407 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1408 Returns the file system model index that is the root index 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
|
1409 views |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1410 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1411 QModelIndex QFileDialogPrivate::rootIndex() const { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1412 return mapToSource(qFileDialogUi->listView->rootIndex()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1413 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1414 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1415 QAbstractItemView *QFileDialogPrivate::currentView() const { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1416 if (!qFileDialogUi->stackedWidget) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1417 return 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1418 if (qFileDialogUi->stackedWidget->currentWidget() == qFileDialogUi->listView->parent()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1419 return qFileDialogUi->listView; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1420 return qFileDialogUi->treeView; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1421 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1422 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1423 QLineEdit *QFileDialogPrivate::lineEdit() const { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1424 return (QLineEdit*)qFileDialogUi->fileNameEdit; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1425 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1426 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1427 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1428 Sets the view root index to be the file system model index |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1429 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1430 void QFileDialogPrivate::setRootIndex(const QModelIndex &index) const { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1431 Q_ASSERT(index.isValid() ? index.model() == model : true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1432 QModelIndex idx = mapFromSource(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1433 qFileDialogUi->treeView->setRootIndex(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1434 qFileDialogUi->listView->setRootIndex(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1435 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1436 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1437 Select a file system model index |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1438 returns the index that was selected (or not depending upon sortfilterproxymodel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1439 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1440 QModelIndex QFileDialogPrivate::select(const QModelIndex &index) const { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1441 Q_ASSERT(index.isValid() ? index.model() == model : true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1442 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1443 QModelIndex idx = mapFromSource(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1444 if (idx.isValid() && !qFileDialogUi->listView->selectionModel()->isSelected(idx)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1445 qFileDialogUi->listView->selectionModel()->select(idx, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1446 QItemSelectionModel::Select | QItemSelectionModel::Rows); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1447 return idx; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1448 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1449 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1450 QFileDialog::AcceptMode QFileDialog::acceptMode() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1451 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1452 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1453 return d->acceptMode; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1454 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1455 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1456 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1457 \property QFileDialog::readOnly |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1458 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1459 \brief Whether the filedialog is read-only |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1460 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1461 If this property is set to false, the file dialog will allow renaming, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1462 and deleting of files and directories and creating directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1463 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1464 Use setOption(ReadOnly, \e enabled) or testOption(ReadOnly) instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1465 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1466 void QFileDialog::setReadOnly(bool enabled) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1467 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1468 setOption(ReadOnly, enabled); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1469 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1470 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1471 bool QFileDialog::isReadOnly() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1472 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1473 return testOption(ReadOnly); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1474 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1475 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1476 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1477 \property QFileDialog::resolveSymlinks |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1478 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1479 \brief whether the filedialog should resolve shortcuts |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1480 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1481 If this property is set to true, the file dialog will resolve |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1482 shortcuts or symbolic links. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1483 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1484 Use setOption(DontResolveSymlinks, !\a enabled) or |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1485 !testOption(DontResolveSymlinks). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1486 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1487 void QFileDialog::setResolveSymlinks(bool enabled) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1488 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1489 setOption(DontResolveSymlinks, !enabled); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1490 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1491 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1492 bool QFileDialog::resolveSymlinks() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1493 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1494 return !testOption(DontResolveSymlinks); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1495 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1496 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1497 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1498 \property QFileDialog::confirmOverwrite |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1499 \obsolete |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1500 \brief whether the filedialog should ask before accepting a selected file, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1501 when the accept mode is AcceptSave |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1502 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1503 Use setOption(DontConfirmOverwrite, !\e enabled) or |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1504 !testOption(DontConfirmOverwrite) instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1505 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1506 void QFileDialog::setConfirmOverwrite(bool enabled) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1507 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1508 setOption(DontConfirmOverwrite, !enabled); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1509 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1510 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1511 bool QFileDialog::confirmOverwrite() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1512 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1513 return !testOption(DontConfirmOverwrite); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1514 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1515 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1516 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1517 \property QFileDialog::defaultSuffix |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1518 \brief suffix added to the filename if no other suffix was specified |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1519 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1520 This property specifies a string that will be added to the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1521 filename if it has no suffix already. The suffix is typically |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1522 used to indicate the file type (e.g. "txt" indicates a text |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1523 file). |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1524 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1525 void QFileDialog::setDefaultSuffix(const QString &suffix) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1526 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1527 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1528 d->defaultSuffix = suffix; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1529 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1530 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1531 QString QFileDialog::defaultSuffix() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1532 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1533 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1534 return d->defaultSuffix; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1535 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1536 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1537 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1538 Sets the browsing history of the filedialog to contain the given |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1539 \a paths. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1540 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1541 void QFileDialog::setHistory(const QStringList &paths) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1542 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1543 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1544 d->qFileDialogUi->lookInCombo->setHistory(paths); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1545 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1546 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1547 void QFileDialogComboBox::setHistory(const QStringList &paths) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1548 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1549 m_history = paths; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1550 // Only populate the first item, showPopup will populate the rest if needed |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1551 QList<QUrl> list; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1552 QModelIndex idx = d_ptr->model->index(d_ptr->rootPath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1553 //On windows the popup display the "C:\", convert to nativeSeparators |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1554 QUrl url = QUrl::fromLocalFile(QDir::toNativeSeparators(idx.data(QFileSystemModel::FilePathRole).toString())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1555 if (url.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1556 list.append(url); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1557 urlModel->setUrls(list); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1558 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1559 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1560 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1561 Returns the browsing history of the filedialog as a list of paths. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1562 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1563 QStringList QFileDialog::history() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1564 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1565 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1566 QStringList currentHistory = d->qFileDialogUi->lookInCombo->history(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1567 //On windows the popup display the "C:\", convert to nativeSeparators |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1568 QString newHistory = QDir::toNativeSeparators(d->rootIndex().data(QFileSystemModel::FilePathRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1569 if (!currentHistory.contains(newHistory)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1570 currentHistory << newHistory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1571 return currentHistory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1572 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1573 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1574 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1575 Sets the item delegate used to render items in the views 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
|
1576 file dialog to the given \a delegate. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1577 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1578 \warning You should not share the same instance of a delegate between views. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1579 Doing so can cause incorrect or unintuitive editing behavior since each |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1580 view connected to a given delegate may receive the \l{QAbstractItemDelegate::}{closeEditor()} |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1581 signal, and attempt to access, modify or close an editor that has already been closed. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1582 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1583 Note that the model used is QFileSystemModel. It has custom item data roles, which is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1584 described by the \l{QFileSystemModel::}{Roles} enum. You can use a QFileIconProvider if |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1585 you only want custom icons. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1586 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1587 \sa itemDelegate(), setIconProvider(), QFileSystemModel |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1588 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1589 void QFileDialog::setItemDelegate(QAbstractItemDelegate *delegate) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1590 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1591 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1592 d->qFileDialogUi->listView->setItemDelegate(delegate); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1593 d->qFileDialogUi->treeView->setItemDelegate(delegate); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1594 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1595 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1596 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1597 Returns the item delegate used to render the items in the views in the filedialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1598 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1599 QAbstractItemDelegate *QFileDialog::itemDelegate() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1600 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1601 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1602 return d->qFileDialogUi->listView->itemDelegate(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1603 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1604 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1605 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1606 Sets the icon provider used by the filedialog to the specified \a provider. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1607 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1608 void QFileDialog::setIconProvider(QFileIconProvider *provider) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1609 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1610 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1611 d->model->setIconProvider(provider); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1612 //It forces the refresh of all entries in the side bar, then we can get new icons |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1613 d->qFileDialogUi->sidebar->setUrls(d->qFileDialogUi->sidebar->urls()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1614 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1615 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1616 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1617 Returns the icon provider used by the filedialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1618 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1619 QFileIconProvider *QFileDialog::iconProvider() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1620 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1621 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1622 return d->model->iconProvider(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1623 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1624 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1625 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1626 Sets the \a text shown in the filedialog in the specified \a label. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1627 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1628 void QFileDialog::setLabelText(DialogLabel label, const QString &text) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1629 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1630 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1631 QPushButton *button; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1632 switch (label) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1633 case LookIn: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1634 d->qFileDialogUi->lookInLabel->setText(text); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1635 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1636 case FileName: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1637 d->qFileDialogUi->fileNameLabel->setText(text); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1638 d->fileNameLabelExplicitlySat = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1639 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1640 case FileType: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1641 d->qFileDialogUi->fileTypeLabel->setText(text); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1642 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1643 case Accept: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1644 d->acceptLabel = text; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1645 if (acceptMode() == AcceptOpen) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1646 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Open); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1647 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1648 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1649 if (button) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1650 button->setText(text); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1651 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1652 case Reject: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1653 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1654 if (button) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1655 button->setText(text); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1656 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1657 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1658 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1659 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1660 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1661 Returns the text shown in the filedialog in the specified \a label. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1662 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1663 QString QFileDialog::labelText(DialogLabel label) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1664 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1665 QPushButton *button; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1666 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1667 switch (label) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1668 case LookIn: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1669 return d->qFileDialogUi->lookInLabel->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1670 case FileName: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1671 return d->qFileDialogUi->fileNameLabel->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1672 case FileType: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1673 return d->qFileDialogUi->fileTypeLabel->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1674 case Accept: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1675 if (acceptMode() == AcceptOpen) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1676 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Open); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1677 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1678 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1679 if (button) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1680 return button->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1681 case Reject: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1682 button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1683 if (button) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1684 return button->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1685 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1686 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1687 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1688 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1689 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1690 For the native file dialogs |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1691 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1692 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1693 #if defined(Q_WS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1694 extern QString qt_win_get_open_file_name(const QFileDialogArgs &args, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1695 QString *initialDirectory, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1696 QString *selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1697 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1698 extern QString qt_win_get_save_file_name(const QFileDialogArgs &args, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1699 QString *initialDirectory, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1700 QString *selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1701 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1702 extern QStringList qt_win_get_open_file_names(const QFileDialogArgs &args, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1703 QString *initialDirectory, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1704 QString *selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1705 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1706 extern QString qt_win_get_existing_directory(const QFileDialogArgs &args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1707 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1708 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1709 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1710 For Symbian file dialogs |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1711 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1712 #if defined(Q_WS_S60) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1713 extern 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
|
1714 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
|
1715 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
|
1716 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1717 extern 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
|
1718 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
|
1719 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
|
1720 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1721 extern 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
|
1722 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
|
1723 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1724 extern 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
|
1725 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
|
1726 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1727 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1728 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1729 This is a convenience static function that returns an existing file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1730 selected by the user. If the user presses Cancel, it returns a null string. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1731 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1732 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 8 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1733 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1734 The function creates a modal file dialog with the given \a parent widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1735 If \a parent is not 0, the dialog will be shown centered over the parent |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1736 widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1737 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1738 The file dialog's working directory will be set to \a dir. If \a dir |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1739 includes a file name, the file will be selected. Only files that match the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1740 given \a filter are shown. The filter selected is set to \a selectedFilter. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1741 The parameters \a dir, \a selectedFilter, and \a filter may be empty |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1742 strings. If you want multiple filters, separate them with ';;', for |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1743 example: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1744 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1745 \code |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1746 "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1747 \endcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1748 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1749 The \a options argument holds various options about how to run the dialog, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1750 see the QFileDialog::Option enum for more information on the flags you can |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1751 pass. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1752 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1753 The dialog's caption is set to \a caption. If \a caption is not specified |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1754 then a default caption will be used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1755 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1756 On Windows, Mac OS X and Symbian^3, this static function will use the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1757 native file dialog and not a QFileDialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1758 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1759 On Windows the dialog will spin a blocking modal event loop that will not |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1760 dispatch any QTimers, and if \a parent is not 0 then it will position the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1761 dialog just below the parent's title bar. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1762 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1763 On Unix/X11, the normal behavior of the file dialog is to resolve and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1764 follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1765 the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1766 \a options includes DontResolveSymlinks, the file dialog will treat |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1767 symlinks as regular directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1768 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1769 On Symbian^3 the parameter \a selectedFilter has no meaning and the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1770 \a options parameter is only used to define if the native file dialog is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1771 used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1772 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1773 \warning Do not delete \a parent during the execution of the dialog. If you |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1774 want to do this, you should create the dialog yourself using one of the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1775 QFileDialog constructors. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1776 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1777 \sa getOpenFileNames(), getSaveFileName(), getExistingDirectory() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1778 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1779 QString QFileDialog::getOpenFileName(QWidget *parent, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1780 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
|
1781 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
|
1782 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
|
1783 QString *selectedFilter, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1784 Options options) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1785 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1786 if (qt_filedialog_open_filename_hook && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1787 return qt_filedialog_open_filename_hook(parent, caption, dir, filter, selectedFilter, options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1788 #if defined(Q_WS_S60) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1789 if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1790 return qtSymbianGetOpenFileName(caption, dir, filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1791 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1792 QFileDialogArgs args; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1793 args.parent = parent; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1794 args.caption = caption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1795 args.directory = QFileDialogPrivate::workingDirectory(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1796 args.selection = QFileDialogPrivate::initialSelection(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1797 args.filter = filter; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1798 args.mode = ExistingFile; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1799 args.options = options; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1800 #if defined(Q_WS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1801 if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1802 return qt_win_get_open_file_name(args, &(args.directory), selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1803 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1804 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1805 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1806 // create a qt dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1807 QFileDialog dialog(args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1808 if (selectedFilter && !selectedFilter->isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1809 dialog.selectNameFilter(*selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1810 if (dialog.exec() == QDialog::Accepted) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1811 if (selectedFilter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1812 *selectedFilter = dialog.selectedFilter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1813 return dialog.selectedFiles().value(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1814 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1815 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1816 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1817 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1818 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1819 This is a convenience static function that will return one or more existing |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1820 files selected by the user. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1821 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1822 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 9 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1823 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1824 This function creates a modal file dialog with the given \a parent widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1825 If \a parent is not 0, the dialog will be shown centered over the parent |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1826 widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1827 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1828 The file dialog's working directory will be set to \a dir. If \a dir |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1829 includes a file name, the file will be selected. The filter is set to |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1830 \a filter so that only those files which match the filter are shown. The |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1831 filter selected is set to \a selectedFilter. The parameters \a dir, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1832 \a selectedFilter and \a filter may be empty strings. If you need multiple |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1833 filters, separate them with ';;', for instance: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1834 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1835 \code |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1836 "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1837 \endcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1838 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1839 The dialog's caption is set to \a caption. If \a caption is not specified |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1840 then a default caption will be used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1841 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1842 On Windows, Mac OS X and Symbian^3, this static function will use the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1843 native file dialog and not a QFileDialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1844 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1845 On Windows the dialog will spin a blocking modal event loop that will not |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1846 dispatch any QTimers, and if \a parent is not 0 then it will position the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1847 dialog just below the parent's title bar. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1848 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1849 On Unix/X11, the normal behavior of the file dialog is to resolve and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1850 follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1851 the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1852 The \a options argument holds various options about how to run the dialog, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1853 see the QFileDialog::Option enum for more information on the flags you can |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1854 pass. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1855 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1856 \note If you want to iterate over the list of files, you should iterate |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1857 over a copy. For example: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1858 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1859 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 10 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1860 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1861 On Symbian^3 the parameter \a selectedFilter has no meaning and the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1862 \a options parameter is only used to define if the native file dialog is |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1863 used. On Symbian^3, this function can only return a single filename. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1864 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1865 \warning Do not delete \a parent during the execution of the dialog. If you |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1866 want to do this, you should create the dialog yourself using one of the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1867 QFileDialog constructors. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1868 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1869 \sa getOpenFileName(), getSaveFileName(), getExistingDirectory() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1870 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1871 QStringList QFileDialog::getOpenFileNames(QWidget *parent, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1872 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
|
1873 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
|
1874 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
|
1875 QString *selectedFilter, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1876 Options options) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1877 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1878 if (qt_filedialog_open_filenames_hook && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1879 return qt_filedialog_open_filenames_hook(parent, caption, dir, filter, selectedFilter, options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1880 #if defined(Q_WS_S60) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1881 if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1882 return qtSymbianGetOpenFileNames(caption, dir, filter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1883 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1884 QFileDialogArgs args; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1885 args.parent = parent; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1886 args.caption = caption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1887 args.directory = QFileDialogPrivate::workingDirectory(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1888 args.selection = QFileDialogPrivate::initialSelection(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1889 args.filter = filter; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1890 args.mode = ExistingFiles; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1891 args.options = options; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1892 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1893 #if defined(Q_WS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1894 if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1895 return qt_win_get_open_file_names(args, &(args.directory), selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1896 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1897 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1898 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1899 // create a qt dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1900 QFileDialog dialog(args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1901 if (selectedFilter && !selectedFilter->isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1902 dialog.selectNameFilter(*selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1903 if (dialog.exec() == QDialog::Accepted) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1904 if (selectedFilter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1905 *selectedFilter = dialog.selectedFilter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1906 return dialog.selectedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1907 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1908 return QStringList(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1909 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1910 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1911 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1912 This is a convenience static function that will return a file name selected |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1913 by the user. The file does not have to exist. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1914 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1915 It creates a modal file dialog with the given \a parent widget. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1916 \a parent is not 0, the dialog will be shown centered over the parent |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1917 widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1918 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1919 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 11 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1920 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1921 The file dialog's working directory will be set to \a dir. If \a dir |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1922 includes a file name, the file will be selected. Only files that match the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1923 \a filter are shown. The filter selected is set to \a selectedFilter. The |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1924 parameters \a dir, \a selectedFilter, and \a filter may be empty strings. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1925 Multiple filters are separated with ';;'. For instance: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1926 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1927 \code |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1928 "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1929 \endcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1930 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1931 The \a options argument holds various options about how to run the dialog, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1932 see the QFileDialog::Option enum for more information on the flags you can |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1933 pass. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1934 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1935 The default filter can be chosen by setting \a selectedFilter to the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1936 desired value. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1937 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1938 The dialog's caption is set to \a caption. If \a caption is not specified, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1939 a default caption will be used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1940 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1941 On Windows, Mac OS X and Symbian^3, this static function will use the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1942 native file dialog and not a QFileDialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1943 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1944 On Windows the dialog will spin a blocking modal event loop that will not |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1945 dispatch any QTimers, and if \a parent is not 0 then it will position the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1946 dialog just below the parent's title bar. On Mac OS X, with its native file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1947 dialog, the filter argument is ignored. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1948 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1949 On Unix/X11, the normal behavior of the file dialog is to resolve and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1950 follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1951 the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1952 \a options includes DontResolveSymlinks the file dialog will treat symlinks |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1953 as regular directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1954 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1955 On Symbian^3 the parameters \a filter and \a selectedFilter have no |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1956 meaning. The \a options parameter is only used to define if the native file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1957 dialog is used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1958 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1959 \warning Do not delete \a parent during the execution of the dialog. If you |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1960 want to do this, you should create the dialog yourself using one of the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1961 QFileDialog constructors. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1962 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1963 \sa getOpenFileName(), getOpenFileNames(), getExistingDirectory() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1964 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1965 QString QFileDialog::getSaveFileName(QWidget *parent, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1966 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
|
1967 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
|
1968 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
|
1969 QString *selectedFilter, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1970 Options options) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1971 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1972 if (qt_filedialog_save_filename_hook && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1973 return qt_filedialog_save_filename_hook(parent, caption, dir, filter, selectedFilter, options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1974 #if defined(Q_WS_S60) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1975 if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1976 return qtSymbianGetSaveFileName(caption, dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1977 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1978 QFileDialogArgs args; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1979 args.parent = parent; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1980 args.caption = caption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1981 args.directory = QFileDialogPrivate::workingDirectory(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1982 args.selection = QFileDialogPrivate::initialSelection(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1983 args.filter = filter; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1984 args.mode = AnyFile; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1985 args.options = options; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1986 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1987 #if defined(Q_WS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1988 if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1989 return qt_win_get_save_file_name(args, &(args.directory), selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1990 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1991 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1992 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1993 // create a qt dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1994 QFileDialog dialog(args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1995 dialog.setAcceptMode(AcceptSave); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1996 if (selectedFilter && !selectedFilter->isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1997 dialog.selectNameFilter(*selectedFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1998 if (dialog.exec() == QDialog::Accepted) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
1999 if (selectedFilter) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2000 *selectedFilter = dialog.selectedFilter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2001 return dialog.selectedFiles().value(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2002 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2003 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2004 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2005 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2006 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2007 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2008 This is a convenience static function that will return an existing |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2009 directory selected by the user. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2010 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2011 \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 12 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2012 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2013 This function creates a modal file dialog with the given \a parent widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2014 If \a parent is not 0, the dialog will be shown centered over the parent |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2015 widget. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2016 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2017 The dialog's working directory is set to \a dir, and the caption is set to |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2018 \a caption. Either of these may be an empty string in which case the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2019 current directory and a default caption will be used respectively. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2020 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2021 The \a options argument holds various options about how to run the dialog, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2022 see the QFileDialog::Option enum for more information on the flags you can |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2023 pass. To ensure a native file dialog, \l{QFileDialog::}{ShowDirsOnly} must |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2024 be set. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2025 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2026 On Windows, Mac OS X and Symbian^3, this static function will use the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2027 native file dialog and not a QFileDialog. On Windows CE, if the device has |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2028 no native file dialog, a QFileDialog will be used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2029 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2030 On Unix/X11, the normal behavior of the file dialog is to resolve and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2031 follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2032 the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. If |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2033 \a options includes DontResolveSymlinks, the file dialog will treat |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2034 symlinks as regular directories. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2035 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2036 On Windows the dialog will spin a blocking modal event loop that will not |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2037 dispatch any QTimers, and if \a parent is not 0 then it will position the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2038 dialog just below the parent's title bar. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2039 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2040 On Symbian^3 the \a options parameter is only used to define if the native |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2041 file dialog is used. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2042 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2043 \warning Do not delete \a parent during the execution of the dialog. If you |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2044 want to do this, you should create the dialog yourself using one of the |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2045 QFileDialog constructors. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2046 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2047 \sa getOpenFileName(), getOpenFileNames(), getSaveFileName() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2048 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2049 QString QFileDialog::getExistingDirectory(QWidget *parent, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2050 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
|
2051 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
|
2052 Options options) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2053 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2054 if (qt_filedialog_existing_directory_hook && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2055 return qt_filedialog_existing_directory_hook(parent, caption, dir, options); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2056 #if defined(Q_WS_S60) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2057 if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2058 return qtSymbianGetExistingDirectory(caption, dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2059 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2060 QFileDialogArgs args; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2061 args.parent = parent; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2062 args.caption = caption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2063 args.directory = QFileDialogPrivate::workingDirectory(dir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2064 args.mode = (options & ShowDirsOnly ? DirectoryOnly : Directory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2065 args.options = options; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2066 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2067 #if defined(Q_WS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2068 if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog) && (options & ShowDirsOnly) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2069 #if defined(Q_WS_WINCE) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2070 && qt_priv_ptr_valid |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2071 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2072 ) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2073 return qt_win_get_existing_directory(args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2074 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2075 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2076 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2077 // create a qt dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2078 QFileDialog dialog(args); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2079 if (dialog.exec() == QDialog::Accepted) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2080 return dialog.selectedFiles().value(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2081 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2082 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2083 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2084 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2085 inline static QString _qt_get_directory(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2086 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2087 QFileInfo info = QFileInfo(QDir::current(), path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2088 if (info.exists() && info.isDir()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2089 return QDir::cleanPath(info.absoluteFilePath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2090 info.setFile(info.absolutePath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2091 if (info.exists() && info.isDir()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2092 return info.absoluteFilePath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2093 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2094 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2095 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2096 Get the initial directory path |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2097 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2098 \sa initialSelection() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2099 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2100 QString QFileDialogPrivate::workingDirectory(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2101 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2102 if (!path.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2103 QString directory = _qt_get_directory(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2104 if (!directory.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2105 return directory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2106 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2107 QString directory = _qt_get_directory(*lastVisitedDir()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2108 if (!directory.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2109 return directory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2110 return QDir::currentPath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2111 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2112 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2113 /* |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2114 Get the initial selection given a path. The initial directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2115 can contain both the initial directory and initial selection |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2116 /home/user/foo.txt |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2117 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2118 \sa workingDirectory() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2119 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2120 QString QFileDialogPrivate::initialSelection(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2121 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2122 if (!path.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2123 QFileInfo info(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2124 if (!info.isDir()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2125 return info.fileName(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2126 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2127 return QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2128 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2129 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2130 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2131 \reimp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2132 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2133 void QFileDialog::done(int result) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2134 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2135 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2136 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2137 QDialog::done(result); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2138 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2139 if (d->receiverToDisconnectOnClose) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2140 disconnect(this, d->signalToDisconnectOnClose, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2141 d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2142 d->receiverToDisconnectOnClose = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2143 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2144 d->memberToDisconnectOnClose.clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2145 d->signalToDisconnectOnClose.clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2146 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2147 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2148 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2149 \reimp |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2150 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2151 void QFileDialog::accept() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2152 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2153 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2154 QStringList files = selectedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2155 if (files.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2156 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2157 if (d->nativeDialogInUse){ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2158 d->emitFilesSelected(files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2159 QDialog::accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2160 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2161 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2162 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2163 QString lineEditText = d->lineEdit()->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2164 // "hidden feature" type .. and then enter, and it will move up a dir |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2165 // special case for ".." |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2166 if (lineEditText == QLatin1String("..")) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2167 d->_q_navigateToParent(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2168 bool block = d->qFileDialogUi->fileNameEdit->blockSignals(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2169 d->lineEdit()->selectAll(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2170 d->qFileDialogUi->fileNameEdit->blockSignals(block); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2171 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2172 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2173 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2174 switch (d->fileMode) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2175 case DirectoryOnly: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2176 case Directory: { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2177 QString fn = files.first(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2178 QFileInfo info(fn); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2179 if (!info.exists()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2180 info = QFileInfo(d->getEnvironmentVariable(fn)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2181 if (!info.exists()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2182 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2183 QString message = tr("%1\nDirectory not found.\nPlease verify the " |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2184 "correct directory name was given."); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2185 QMessageBox::warning(this, windowTitle(), message.arg(info.fileName())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2186 #endif // QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2187 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2188 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2189 if (info.isDir()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2190 d->emitFilesSelected(files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2191 QDialog::accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2192 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2193 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2194 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2195 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2196 case AnyFile: { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2197 QString fn = files.first(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2198 QFileInfo info(fn); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2199 if (info.isDir()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2200 setDirectory(info.absoluteFilePath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2201 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2202 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2203 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2204 if (!info.exists()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2205 int maxNameLength = d->maxNameLength(info.path()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2206 if (maxNameLength >= 0 && info.fileName().length() > maxNameLength) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2207 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2208 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2209 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2210 // check if we have to ask for permission to overwrite the file |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2211 if (!info.exists() || !confirmOverwrite() || acceptMode() == AcceptOpen) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2212 d->emitFilesSelected(QStringList(fn)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2213 QDialog::accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2214 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2215 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2216 if (QMessageBox::warning(this, windowTitle(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2217 tr("%1 already exists.\nDo you want to replace it?") |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2218 .arg(info.fileName()), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2219 QMessageBox::Yes | QMessageBox::No, QMessageBox::No) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2220 == QMessageBox::Yes) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2221 d->emitFilesSelected(QStringList(fn)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2222 QDialog::accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2223 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2224 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2225 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2226 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2227 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2228 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2229 case ExistingFile: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2230 case ExistingFiles: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2231 for (int i = 0; i < files.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2232 QFileInfo info(files.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2233 if (!info.exists()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2234 info = QFileInfo(d->getEnvironmentVariable(files.at(i))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2235 if (!info.exists()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2236 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2237 QString message = tr("%1\nFile not found.\nPlease verify the " |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2238 "correct file name was given."); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2239 QMessageBox::warning(this, windowTitle(), message.arg(info.fileName())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2240 #endif // QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2241 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2242 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2243 if (info.isDir()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2244 setDirectory(info.absoluteFilePath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2245 d->lineEdit()->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2246 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2247 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2248 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2249 d->emitFilesSelected(files); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2250 QDialog::accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2251 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2252 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2253 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2254 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2255 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2256 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2257 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2258 Create widgets, layout and set default values |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2259 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2260 void QFileDialogPrivate::init(const QString &directory, const QString &nameFilter, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2261 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
|
2262 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2263 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2264 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
|
2265 useDefaultCaption = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2266 setWindowTitle = caption; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2267 q->setWindowTitle(caption); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2268 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2269 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2270 createWidgets(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2271 createMenuActions(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2272 retranslateStrings(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2273 q->setFileMode(fileMode); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2274 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2275 #ifndef QT_NO_SETTINGS |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2276 QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2277 settings.beginGroup(QLatin1String("Qt")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2278 if (!directory.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2279 setLastVisitedDirectory(workingDirectory(directory)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2280 q->restoreState(settings.value(QLatin1String("filedialog")).toByteArray()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2281 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2282 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2283 #if defined(Q_EMBEDDED_SMALLSCREEN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2284 qFileDialogUi->lookInLabel->setVisible(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2285 qFileDialogUi->fileNameLabel->setVisible(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2286 qFileDialogUi->fileTypeLabel->setVisible(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2287 qFileDialogUi->sidebar->hide(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2288 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2289 // Default case |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2290 if (!nameFilter.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2291 q->setNameFilter(nameFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2292 q->setAcceptMode(QFileDialog::AcceptOpen); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2293 q->setDirectory(workingDirectory(directory)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2294 q->selectFile(initialSelection(directory)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2295 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2296 _q_updateOkButton(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2297 q->resize(q->sizeHint()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2298 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2299 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2300 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2301 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2302 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2303 Create the widgets, set properties and connections |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2304 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2305 void QFileDialogPrivate::createWidgets() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2306 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2307 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2308 model = new QFileSystemModel(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2309 model->setObjectName(QLatin1String("qt_filesystem_model")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2310 #ifdef Q_WS_MAC |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2311 model->setNameFilterDisables(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2312 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2313 model->setNameFilterDisables(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2314 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2315 model->d_func()->disableRecursiveSort = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2316 QFileDialog::connect(model, SIGNAL(fileRenamed(QString,QString,QString)), q, SLOT(_q_fileRenamed(QString,QString,QString))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2317 QFileDialog::connect(model, SIGNAL(rootPathChanged(QString)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2318 q, SLOT(_q_pathChanged(QString))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2319 QFileDialog::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2320 q, SLOT(_q_rowsInserted(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2321 model->setReadOnly(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2322 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2323 qFileDialogUi.reset(new Ui_QFileDialog()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2324 qFileDialogUi->setupUi(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2325 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2326 QList<QUrl> initialBookmarks; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2327 initialBookmarks << QUrl::fromLocalFile(QLatin1String("")) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2328 << QUrl::fromLocalFile(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
|
2329 qFileDialogUi->sidebar->init(model, initialBookmarks); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2330 QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2331 q, SLOT(_q_goToUrl(QUrl))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2332 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2333 QObject::connect(qFileDialogUi->buttonBox, SIGNAL(accepted()), q, SLOT(accept())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2334 QObject::connect(qFileDialogUi->buttonBox, SIGNAL(rejected()), q, SLOT(reject())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2335 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2336 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2337 qFileDialogUi->lookInCombo->init(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2338 QObject::connect(qFileDialogUi->lookInCombo, SIGNAL(activated(QString)), q, SLOT(_q_goToDirectory(QString))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2339 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2340 qFileDialogUi->lookInCombo->setInsertPolicy(QComboBox::NoInsert); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2341 qFileDialogUi->lookInCombo->setDuplicatesEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2342 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2343 // filename |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2344 qFileDialogUi->fileNameEdit->init(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2345 #ifndef QT_NO_SHORTCUT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2346 qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2347 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2348 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2349 completer = new QFSCompleter(model, q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2350 qFileDialogUi->fileNameEdit->setCompleter(completer); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2351 #endif // QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2352 QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2353 q, SLOT(_q_autoCompleteFileName(QString))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2354 QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2355 q, SLOT(_q_updateOkButton())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2356 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2357 QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(returnPressed()), q, SLOT(accept())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2358 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2359 // filetype |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2360 qFileDialogUi->fileTypeCombo->setDuplicatesEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2361 qFileDialogUi->fileTypeCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2362 qFileDialogUi->fileTypeCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2363 QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2364 q, SLOT(_q_useNameFilter(int))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2365 QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(QString)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2366 q, SIGNAL(filterSelected(QString))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2367 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2368 qFileDialogUi->listView->init(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2369 qFileDialogUi->listView->setModel(model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2370 QObject::connect(qFileDialogUi->listView, SIGNAL(activated(QModelIndex)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2371 q, SLOT(_q_enterDirectory(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2372 QObject::connect(qFileDialogUi->listView, SIGNAL(customContextMenuRequested(QPoint)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2373 q, SLOT(_q_showContextMenu(QPoint))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2374 #ifndef QT_NO_SHORTCUT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2375 QShortcut *shortcut = new QShortcut(qFileDialogUi->listView); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2376 shortcut->setKey(QKeySequence(QLatin1String("Delete"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2377 QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2378 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2379 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2380 qFileDialogUi->treeView->init(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2381 qFileDialogUi->treeView->setModel(model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2382 QHeaderView *treeHeader = qFileDialogUi->treeView->header(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2383 QFontMetrics fm(q->font()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2384 treeHeader->resizeSection(0, fm.width(QLatin1String("wwwwwwwwwwwwwwwwwwwwwwwwww"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2385 treeHeader->resizeSection(1, fm.width(QLatin1String("128.88 GB"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2386 treeHeader->resizeSection(2, fm.width(QLatin1String("mp3Folder"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2387 treeHeader->resizeSection(3, fm.width(QLatin1String("10/29/81 02:02PM"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2388 treeHeader->setContextMenuPolicy(Qt::ActionsContextMenu); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2389 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2390 QActionGroup *showActionGroup = new QActionGroup(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2391 showActionGroup->setExclusive(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2392 QObject::connect(showActionGroup, SIGNAL(triggered(QAction*)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2393 q, SLOT(_q_showHeader(QAction*)));; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2394 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2395 QAbstractItemModel *abstractModel = model; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2396 #ifndef QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2397 if (proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2398 abstractModel = proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2399 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2400 for (int i = 1; i < abstractModel->columnCount(QModelIndex()); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2401 QAction *showHeader = new QAction(showActionGroup); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2402 showHeader->setCheckable(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2403 showHeader->setChecked(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2404 treeHeader->addAction(showHeader); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2405 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2406 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2407 QScopedPointer<QItemSelectionModel> selModel(qFileDialogUi->treeView->selectionModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2408 qFileDialogUi->treeView->setSelectionModel(qFileDialogUi->listView->selectionModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2409 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2410 QObject::connect(qFileDialogUi->treeView, SIGNAL(activated(QModelIndex)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2411 q, SLOT(_q_enterDirectory(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2412 QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2413 q, SLOT(_q_showContextMenu(QPoint))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2414 #ifndef QT_NO_SHORTCUT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2415 shortcut = new QShortcut(qFileDialogUi->treeView); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2416 shortcut->setKey(QKeySequence(QLatin1String("Delete"))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2417 QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2418 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2419 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2420 // Selections |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2421 QItemSelectionModel *selections = qFileDialogUi->listView->selectionModel(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2422 QObject::connect(selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2423 q, SLOT(_q_selectionChanged())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2424 QObject::connect(selections, SIGNAL(currentChanged(QModelIndex,QModelIndex)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2425 q, SLOT(_q_currentChanged(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2426 qFileDialogUi->splitter->setStretchFactor(qFileDialogUi->splitter->indexOf(qFileDialogUi->splitter->widget(1)), QSizePolicy::Expanding); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2427 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2428 createToolButtons(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2429 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2430 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2431 void QFileDialogPrivate::_q_showHeader(QAction *action) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2432 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2433 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2434 QActionGroup *actionGroup = qobject_cast<QActionGroup*>(q->sender()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2435 qFileDialogUi->treeView->header()->setSectionHidden(actionGroup->actions().indexOf(action) + 1, !action->isChecked()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2436 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2437 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2438 #ifndef QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2439 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2440 \since 4.3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2441 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2442 Sets the model for the views to the given \a proxyModel. This is useful if you |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2443 want to modify the underlying model; for example, to add columns, filter |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2444 data or add drives. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2445 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2446 Any existing proxy model will be removed, but not deleted. The file dialog |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2447 will take ownership of the \a proxyModel. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2448 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2449 \sa proxyModel() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2450 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2451 void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2452 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2453 Q_D(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2454 if ((!proxyModel && !d->proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2455 || (proxyModel == d->proxyModel)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2456 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2457 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2458 QModelIndex idx = d->rootIndex(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2459 if (d->proxyModel) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2460 disconnect(d->proxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2461 this, SLOT(_q_rowsInserted(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2462 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2463 disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2464 this, SLOT(_q_rowsInserted(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2465 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2466 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2467 if (proxyModel != 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2468 proxyModel->setParent(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2469 d->proxyModel = proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2470 proxyModel->setSourceModel(d->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2471 d->qFileDialogUi->listView->setModel(d->proxyModel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2472 d->qFileDialogUi->treeView->setModel(d->proxyModel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2473 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2474 d->completer->setModel(d->proxyModel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2475 d->completer->proxyModel = d->proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2476 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2477 connect(d->proxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2478 this, SLOT(_q_rowsInserted(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2479 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2480 d->proxyModel = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2481 d->qFileDialogUi->listView->setModel(d->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2482 d->qFileDialogUi->treeView->setModel(d->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2483 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2484 d->completer->setModel(d->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2485 d->completer->sourceModel = d->model; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2486 d->completer->proxyModel = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2487 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2488 connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2489 this, SLOT(_q_rowsInserted(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2490 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2491 QScopedPointer<QItemSelectionModel> selModel(d->qFileDialogUi->treeView->selectionModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2492 d->qFileDialogUi->treeView->setSelectionModel(d->qFileDialogUi->listView->selectionModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2493 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2494 d->setRootIndex(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2495 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2496 // reconnect selection |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2497 QItemSelectionModel *selections = d->qFileDialogUi->listView->selectionModel(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2498 QObject::connect(selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2499 this, SLOT(_q_selectionChanged())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2500 QObject::connect(selections, SIGNAL(currentChanged(QModelIndex,QModelIndex)), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2501 this, SLOT(_q_currentChanged(QModelIndex))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2502 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2503 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2504 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2505 Returns the proxy model used by the file dialog. By default no proxy is set. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2506 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2507 \sa setProxyModel() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2508 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2509 QAbstractProxyModel *QFileDialog::proxyModel() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2510 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2511 Q_D(const QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2512 return d->proxyModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2513 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2514 #endif // QT_NO_PROXYMODEL |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2515 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2516 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2517 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2518 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2519 Create tool buttons, set properties and connections |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2520 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2521 void QFileDialogPrivate::createToolButtons() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2522 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2523 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2524 qFileDialogUi->backButton->setIcon(q->style()->standardIcon(QStyle::SP_ArrowBack, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2525 qFileDialogUi->backButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2526 qFileDialogUi->backButton->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2527 QObject::connect(qFileDialogUi->backButton, SIGNAL(clicked()), q, SLOT(_q_navigateBackward())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2528 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2529 qFileDialogUi->forwardButton->setIcon(q->style()->standardIcon(QStyle::SP_ArrowForward, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2530 qFileDialogUi->forwardButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2531 qFileDialogUi->forwardButton->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2532 QObject::connect(qFileDialogUi->forwardButton, SIGNAL(clicked()), q, SLOT(_q_navigateForward())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2533 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2534 qFileDialogUi->toParentButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogToParent, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2535 qFileDialogUi->toParentButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2536 qFileDialogUi->toParentButton->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2537 QObject::connect(qFileDialogUi->toParentButton, SIGNAL(clicked()), q, SLOT(_q_navigateToParent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2538 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2539 qFileDialogUi->listModeButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogListView, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2540 qFileDialogUi->listModeButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2541 qFileDialogUi->listModeButton->setDown(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2542 QObject::connect(qFileDialogUi->listModeButton, SIGNAL(clicked()), q, SLOT(_q_showListView())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2543 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2544 qFileDialogUi->detailModeButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogDetailedView, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2545 qFileDialogUi->detailModeButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2546 QObject::connect(qFileDialogUi->detailModeButton, SIGNAL(clicked()), q, SLOT(_q_showDetailsView())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2547 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2548 QSize toolSize(qFileDialogUi->fileNameEdit->sizeHint().height(), qFileDialogUi->fileNameEdit->sizeHint().height()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2549 qFileDialogUi->backButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2550 qFileDialogUi->listModeButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2551 qFileDialogUi->detailModeButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2552 qFileDialogUi->forwardButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2553 qFileDialogUi->toParentButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2554 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2555 qFileDialogUi->newFolderButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogNewFolder, 0, q)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2556 qFileDialogUi->newFolderButton->setFixedSize(toolSize); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2557 qFileDialogUi->newFolderButton->setAutoRaise(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2558 qFileDialogUi->newFolderButton->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2559 QObject::connect(qFileDialogUi->newFolderButton, SIGNAL(clicked()), q, SLOT(_q_createDirectory())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2560 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2561 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2562 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2563 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2564 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2565 Create actions which will be used in the right click. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2566 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2567 void QFileDialogPrivate::createMenuActions() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2568 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2569 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2570 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2571 QAction *goHomeAction = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2572 #ifndef QT_NO_SHORTCUT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2573 goHomeAction->setShortcut(Qt::CTRL + Qt::Key_H + Qt::SHIFT); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2574 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2575 QObject::connect(goHomeAction, SIGNAL(triggered()), q, SLOT(_q_goHome())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2576 q->addAction(goHomeAction); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2577 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2578 // ### TODO add Desktop & Computer actions |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2579 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2580 QAction *goToParent = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2581 goToParent->setObjectName(QLatin1String("qt_goto_parent_action")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2582 #ifndef QT_NO_SHORTCUT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2583 goToParent->setShortcut(Qt::CTRL + Qt::UpArrow); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2584 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2585 QObject::connect(goToParent, SIGNAL(triggered()), q, SLOT(_q_navigateToParent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2586 q->addAction(goToParent); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2587 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2588 renameAction = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2589 renameAction->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2590 renameAction->setObjectName(QLatin1String("qt_rename_action")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2591 QObject::connect(renameAction, SIGNAL(triggered()), q, SLOT(_q_renameCurrent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2592 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2593 deleteAction = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2594 deleteAction->setEnabled(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2595 deleteAction->setObjectName(QLatin1String("qt_delete_action")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2596 QObject::connect(deleteAction, SIGNAL(triggered()), q, SLOT(_q_deleteCurrent())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2597 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2598 showHiddenAction = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2599 showHiddenAction->setObjectName(QLatin1String("qt_show_hidden_action")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2600 showHiddenAction->setCheckable(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2601 QObject::connect(showHiddenAction, SIGNAL(triggered()), q, SLOT(_q_showHidden())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2602 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2603 newFolderAction = new QAction(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2604 newFolderAction->setObjectName(QLatin1String("qt_new_folder_action")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2605 QObject::connect(newFolderAction, SIGNAL(triggered()), q, SLOT(_q_createDirectory())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2606 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2607 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2608 void QFileDialogPrivate::_q_goHome() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2609 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2610 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2611 q->setDirectory(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
|
2612 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2613 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2614 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2615 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2616 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2617 Update history with new path, buttons, and combo |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2618 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2619 void QFileDialogPrivate::_q_pathChanged(const QString &newPath) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2620 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2621 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2622 QDir dir(model->rootDirectory()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2623 qFileDialogUi->toParentButton->setEnabled(dir.exists()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2624 qFileDialogUi->sidebar->selectUrl(QUrl::fromLocalFile(newPath)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2625 q->setHistory(qFileDialogUi->lookInCombo->history()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2626 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2627 if (currentHistoryLocation < 0 || currentHistory.value(currentHistoryLocation) != QDir::toNativeSeparators(newPath)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2628 while (currentHistoryLocation >= 0 && currentHistoryLocation + 1 < currentHistory.count()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2629 currentHistory.removeLast(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2630 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2631 currentHistory.append(QDir::toNativeSeparators(newPath)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2632 ++currentHistoryLocation; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2633 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2634 qFileDialogUi->forwardButton->setEnabled(currentHistory.size() - currentHistoryLocation > 1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2635 qFileDialogUi->backButton->setEnabled(currentHistoryLocation > 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2636 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2637 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2638 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2639 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2640 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2641 Navigates to the last directory viewed in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2642 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2643 void QFileDialogPrivate::_q_navigateBackward() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2644 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2645 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2646 if (!currentHistory.isEmpty() && currentHistoryLocation > 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2647 --currentHistoryLocation; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2648 QString previousHistory = currentHistory.at(currentHistoryLocation); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2649 q->setDirectory(previousHistory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2650 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2651 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2652 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2653 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2654 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2655 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2656 Navigates to the last directory viewed in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2657 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2658 void QFileDialogPrivate::_q_navigateForward() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2659 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2660 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2661 if (!currentHistory.isEmpty() && currentHistoryLocation < currentHistory.size() - 1) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2662 ++currentHistoryLocation; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2663 QString nextHistory = currentHistory.at(currentHistoryLocation); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2664 q->setDirectory(nextHistory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2665 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2666 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2667 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2668 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2669 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2670 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2671 Navigates to the parent directory of the currently displayed directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2672 in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2673 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2674 void QFileDialogPrivate::_q_navigateToParent() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2675 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2676 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2677 QDir dir(model->rootDirectory()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2678 QString newDirectory; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2679 if (dir.isRoot()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2680 newDirectory = model->myComputer().toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2681 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2682 dir.cdUp(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2683 newDirectory = dir.absolutePath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2684 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2685 q->setDirectory(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2686 emit q->directoryEntered(newDirectory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2687 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2688 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2689 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2690 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2691 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2692 Creates a new directory, first asking the user for a suitable name. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2693 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2694 void QFileDialogPrivate::_q_createDirectory() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2695 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2696 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2697 qFileDialogUi->listView->clearSelection(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2698 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2699 QString newFolderString = QFileDialog::tr("New Folder"); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2700 QString folderName = newFolderString; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2701 QString prefix = q->directory().absolutePath() + QDir::separator(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2702 if (QFile::exists(prefix + folderName)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2703 qlonglong suffix = 2; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2704 while (QFile::exists(prefix + folderName)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2705 folderName = newFolderString + QString::number(suffix++); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2706 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2707 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2708 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2709 QModelIndex parent = rootIndex(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2710 QModelIndex index = model->mkdir(parent, folderName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2711 if (!index.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2712 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2713 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2714 index = select(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2715 if (index.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2716 qFileDialogUi->treeView->setCurrentIndex(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2717 currentView()->edit(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2718 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2719 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2720 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2721 void QFileDialogPrivate::_q_showListView() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2722 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2723 qFileDialogUi->listModeButton->setDown(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2724 qFileDialogUi->detailModeButton->setDown(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2725 qFileDialogUi->treeView->hide(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2726 qFileDialogUi->listView->show(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2727 qFileDialogUi->stackedWidget->setCurrentWidget(qFileDialogUi->listView->parentWidget()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2728 qFileDialogUi->listView->doItemsLayout(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2729 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2730 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2731 void QFileDialogPrivate::_q_showDetailsView() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2732 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2733 qFileDialogUi->listModeButton->setDown(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2734 qFileDialogUi->detailModeButton->setDown(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2735 qFileDialogUi->listView->hide(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2736 qFileDialogUi->treeView->show(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2737 qFileDialogUi->stackedWidget->setCurrentWidget(qFileDialogUi->treeView->parentWidget()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2738 qFileDialogUi->treeView->doItemsLayout(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2739 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2740 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2741 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2742 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2743 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2744 Show the context menu for the file/dir under position |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2745 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2746 void QFileDialogPrivate::_q_showContextMenu(const QPoint &position) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2747 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2748 #ifdef QT_NO_MENU |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2749 Q_UNUSED(position); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2750 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2751 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2752 QAbstractItemView *view = 0; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2753 if (q->viewMode() == QFileDialog::Detail) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2754 view = qFileDialogUi->treeView; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2755 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2756 view = qFileDialogUi->listView; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2757 QModelIndex index = view->indexAt(position); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2758 index = mapToSource(index.sibling(index.row(), 0)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2759 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2760 QMenu menu(view); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2761 if (index.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2762 // file context menu |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2763 QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2764 renameAction->setEnabled(p & QFile::WriteUser); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2765 menu.addAction(renameAction); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2766 deleteAction->setEnabled(p & QFile::WriteUser); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2767 menu.addAction(deleteAction); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2768 menu.addSeparator(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2769 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2770 menu.addAction(showHiddenAction); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2771 if (qFileDialogUi->newFolderButton->isVisible()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2772 newFolderAction->setEnabled(qFileDialogUi->newFolderButton->isEnabled()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2773 menu.addAction(newFolderAction); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2774 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2775 menu.exec(view->viewport()->mapToGlobal(position)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2776 #endif // QT_NO_MENU |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2777 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2778 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2779 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2780 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2781 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2782 void QFileDialogPrivate::_q_renameCurrent() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2783 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2784 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2785 QModelIndex index = qFileDialogUi->listView->currentIndex(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2786 index = index.sibling(index.row(), 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2787 if (q->viewMode() == QFileDialog::List) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2788 qFileDialogUi->listView->edit(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2789 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2790 qFileDialogUi->treeView->edit(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2791 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2792 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2793 bool QFileDialogPrivate::removeDirectory(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2794 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2795 QModelIndex modelIndex = model->index(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2796 return model->remove(modelIndex); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2797 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2798 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2799 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2800 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2801 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2802 Deletes the currently selected item in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2803 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2804 void QFileDialogPrivate::_q_deleteCurrent() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2805 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2806 if (model->isReadOnly()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2807 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2808 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2809 QModelIndexList list = qFileDialogUi->listView->selectionModel()->selectedRows(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2810 for (int i = list.count() - 1; i >= 0; --i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2811 QModelIndex index = list.at(i); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2812 if (index == qFileDialogUi->listView->rootIndex()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2813 continue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2814 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2815 index = mapToSource(index.sibling(index.row(), 0)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2816 if (!index.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2817 continue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2818 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2819 QString fileName = index.data(QFileSystemModel::FileNameRole).toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2820 QString filePath = index.data(QFileSystemModel::FilePathRole).toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2821 bool isDir = model->isDir(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2822 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2823 QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2824 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2825 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2826 if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), q_func()->windowTitle(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2827 QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?") |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2828 .arg(fileName), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2829 QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2830 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2831 else if (QMessageBox::warning(q_func(), q_func()->windowTitle(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2832 QFileDialog::tr("Are sure you want to delete '%1'?") |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2833 .arg(fileName), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2834 QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2835 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2836 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2837 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2838 if (!(p & QFile::WriteUser)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2839 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2840 #endif // QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2841 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2842 // the event loop has run, we can NOT reuse index because the model might have removed it. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2843 if (isDir) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2844 if (!removeDirectory(filePath)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2845 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2846 QMessageBox::warning(q, q->windowTitle(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2847 QFileDialog::tr("Could not delete directory.")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2848 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2849 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2850 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2851 model->remove(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2852 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2853 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2854 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2855 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2856 void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2857 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2858 if (text.startsWith(QLatin1String("//")) || text.startsWith(QLatin1Char('\\'))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2859 qFileDialogUi->listView->selectionModel()->clearSelection(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2860 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2861 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2862 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2863 QStringList multipleFiles = typedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2864 if (multipleFiles.count() > 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2865 QModelIndexList oldFiles = qFileDialogUi->listView->selectionModel()->selectedRows(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2866 QModelIndexList newFiles; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2867 for (int i = 0; i < multipleFiles.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2868 QModelIndex idx = model->index(multipleFiles.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2869 if (oldFiles.contains(idx)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2870 oldFiles.removeAll(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2871 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2872 newFiles.append(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2873 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2874 for (int i = 0; i < newFiles.count(); ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2875 select(newFiles.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2876 if (lineEdit()->hasFocus()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2877 for (int i = 0; i < oldFiles.count(); ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2878 qFileDialogUi->listView->selectionModel()->select(oldFiles.at(i), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2879 QItemSelectionModel::Toggle | QItemSelectionModel::Rows); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2880 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2881 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2882 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2883 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2884 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2885 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2886 void QFileDialogPrivate::_q_updateOkButton() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2887 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2888 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2889 QPushButton *button = qFileDialogUi->buttonBox->button((acceptMode == QFileDialog::AcceptOpen) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2890 ? QDialogButtonBox::Open : QDialogButtonBox::Save); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2891 if (!button) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2892 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2893 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2894 bool enableButton = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2895 bool isOpenDirectory = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2896 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2897 QStringList files = q->selectedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2898 QString lineEditText = lineEdit()->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2899 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2900 if (lineEditText.startsWith(QLatin1String("//")) || lineEditText.startsWith(QLatin1Char('\\'))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2901 button->setEnabled(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2902 if (acceptMode == QFileDialog::AcceptSave) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2903 button->setText(acceptLabel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2904 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2905 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2906 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2907 if (files.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2908 enableButton = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2909 } else if (lineEditText == QLatin1String("..")) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2910 isOpenDirectory = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2911 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2912 switch (fileMode) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2913 case QFileDialog::DirectoryOnly: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2914 case QFileDialog::Directory: { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2915 QString fn = files.first(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2916 QModelIndex idx = model->index(fn); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2917 if (!idx.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2918 idx = model->index(getEnvironmentVariable(fn)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2919 if (!idx.isValid() || !model->isDir(idx)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2920 enableButton = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2921 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2922 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2923 case QFileDialog::AnyFile: { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2924 QString fn = files.first(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2925 QFileInfo info(fn); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2926 QModelIndex idx = model->index(fn); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2927 QString fileDir; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2928 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
|
2929 if (info.isDir()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2930 fileDir = info.canonicalFilePath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2931 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2932 fileDir = fn.mid(0, fn.lastIndexOf(QLatin1Char('/'))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2933 fileName = fn.mid(fileDir.length() + 1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2934 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2935 if (lineEditText.contains(QLatin1String(".."))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2936 fileDir = info.canonicalFilePath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2937 fileName = info.fileName(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2938 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2939 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2940 if (fileDir == q->directory().canonicalPath() && fileName.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2941 enableButton = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2942 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2943 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2944 if (idx.isValid() && model->isDir(idx)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2945 isOpenDirectory = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2946 enableButton = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2947 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2948 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2949 if (!idx.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2950 int maxLength = maxNameLength(fileDir); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2951 enableButton = maxLength < 0 || fileName.length() <= maxLength; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2952 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2953 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2954 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2955 case QFileDialog::ExistingFile: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2956 case QFileDialog::ExistingFiles: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2957 for (int i = 0; i < files.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2958 QModelIndex idx = model->index(files.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2959 if (!idx.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2960 idx = model->index(getEnvironmentVariable(files.at(i))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2961 if (!idx.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2962 enableButton = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2963 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2964 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2965 if (idx.isValid() && model->isDir(idx)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2966 isOpenDirectory = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2967 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2968 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2969 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2970 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2971 default: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2972 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2973 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2974 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2975 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2976 button->setEnabled(enableButton); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2977 if (acceptMode == QFileDialog::AcceptSave) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2978 button->setText(isOpenDirectory ? QFileDialog::tr("&Open") : acceptLabel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2979 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2980 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2981 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2982 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2983 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2984 void QFileDialogPrivate::_q_currentChanged(const QModelIndex &index) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2985 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2986 _q_updateOkButton(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2987 emit q_func()->currentChanged(index.data(QFileSystemModel::FilePathRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2988 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2989 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2990 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2991 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2992 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2993 This is called when the user double clicks on a file with the corresponding |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2994 model item \a index. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2995 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2996 void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2997 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2998 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
2999 // My Computer or a directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3000 QModelIndex sourceIndex = index.model() == proxyModel ? mapToSource(index) : index; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3001 QString path = sourceIndex.data(QFileSystemModel::FilePathRole).toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3002 if (path.isEmpty() || model->isDir(sourceIndex)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3003 q->setDirectory(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3004 emit q->directoryEntered(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3005 if (fileMode == QFileDialog::Directory |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3006 || fileMode == QFileDialog::DirectoryOnly) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3007 // ### find out why you have to do both of these. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3008 lineEdit()->setText(QString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3009 lineEdit()->clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3010 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3011 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3012 // Do not accept when shift-clicking to multi-select a file in environments with single-click-activation (KDE) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3013 if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3014 || q->fileMode() != QFileDialog::ExistingFiles || !(QApplication::keyboardModifiers() & Qt::CTRL)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3015 q->accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3016 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3017 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3018 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3019 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3020 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3021 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3022 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3023 Changes the file dialog's current directory to the one specified |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3024 by \a path. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3025 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3026 void QFileDialogPrivate::_q_goToDirectory(const QString &path) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3027 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3028 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3029 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3030 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3031 QModelIndex index = qFileDialogUi->lookInCombo->model()->index(qFileDialogUi->lookInCombo->currentIndex(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3032 qFileDialogUi->lookInCombo->modelColumn(), |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3033 qFileDialogUi->lookInCombo->rootModelIndex()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3034 QString path2 = path; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3035 if (!index.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3036 index = mapFromSource(model->index(getEnvironmentVariable(path))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3037 else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3038 path2 = index.data(UrlRole).toUrl().toLocalFile(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3039 index = mapFromSource(model->index(path2)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3040 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3041 QDir dir(path2); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3042 if (!dir.exists()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3043 dir = getEnvironmentVariable(path2); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3044 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3045 if (dir.exists() || path2.isEmpty() || path2 == model->myComputer().toString()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3046 _q_enterDirectory(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3047 #ifndef QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3048 } else { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3049 QString message = QFileDialog::tr("%1\nDirectory not found.\nPlease verify the " |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3050 "correct directory name was given."); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3051 QMessageBox::warning(q, q->windowTitle(), message.arg(path2)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3052 #endif // QT_NO_MESSAGEBOX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3053 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3054 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3055 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3056 // Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3057 QStringList qt_clean_filter_list(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
|
3058 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3059 QRegExp regexp(QString::fromLatin1(qt_file_dialog_filter_reg_exp)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3060 QString f = filter; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3061 int i = regexp.indexIn(f); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3062 if (i >= 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3063 f = regexp.cap(2); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3064 return f.split(QLatin1Char(' '), QString::SkipEmptyParts); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3065 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3066 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3067 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3068 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3069 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3070 Sets the current name filter to be nameFilter and |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3071 update the qFileDialogUi->fileNameEdit when in AcceptSave mode with the new extension. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3072 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3073 void QFileDialogPrivate::_q_useNameFilter(int index) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3074 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3075 if (index == nameFilters.size()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3076 QAbstractItemModel *comboModel = qFileDialogUi->fileTypeCombo->model(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3077 nameFilters.append(comboModel->index(comboModel->rowCount() - 1, 0).data().toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3078 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3079 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3080 QString nameFilter = nameFilters.at(index); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3081 QStringList newNameFilters = qt_clean_filter_list(nameFilter); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3082 if (acceptMode == QFileDialog::AcceptSave) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3083 QString newNameFilterExtension; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3084 if (newNameFilters.count() > 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3085 newNameFilterExtension = QFileInfo(newNameFilters.at(0)).suffix(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3086 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3087 QString fileName = lineEdit()->text(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3088 const QString fileNameExtension = QFileInfo(fileName).suffix(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3089 if (!fileNameExtension.isEmpty() && !newNameFilterExtension.isEmpty()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3090 const int fileNameExtensionLength = fileNameExtension.count(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3091 fileName.replace(fileName.count() - fileNameExtensionLength, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3092 fileNameExtensionLength, newNameFilterExtension); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3093 qFileDialogUi->listView->clearSelection(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3094 lineEdit()->setText(fileName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3095 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3096 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3097 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3098 model->setNameFilters(newNameFilters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3099 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3100 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3101 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3102 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3103 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3104 This is called when the model index corresponding to the current file is changed |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3105 from \a index to \a current. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3106 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3107 void QFileDialogPrivate::_q_selectionChanged() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3108 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3109 QModelIndexList indexes = qFileDialogUi->listView->selectionModel()->selectedRows(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3110 bool stripDirs = (fileMode != QFileDialog::DirectoryOnly && fileMode != QFileDialog::Directory); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3111 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3112 QStringList allFiles; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3113 for (int i = 0; i < indexes.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3114 if (stripDirs && model->isDir(mapToSource(indexes.at(i)))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3115 continue; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3116 allFiles.append(indexes.at(i).data().toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3117 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3118 if (allFiles.count() > 1) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3119 for (int i = 0; i < allFiles.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3120 allFiles.replace(i, QString(QLatin1Char('"') + allFiles.at(i) + QLatin1Char('"'))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3121 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3122 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3123 QString finalFiles = allFiles.join(QLatin1String(" ")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3124 if (!finalFiles.isEmpty() && !lineEdit()->hasFocus() && lineEdit()->isVisible()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3125 lineEdit()->setText(finalFiles); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3126 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3127 _q_updateOkButton(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3128 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3129 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3130 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3131 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3132 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3133 Includes hidden files and directories in the items displayed in the dialog. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3134 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3135 void QFileDialogPrivate::_q_showHidden() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3136 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3137 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3138 QDir::Filters dirFilters = q->filter(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3139 if (showHiddenAction->isChecked()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3140 dirFilters |= QDir::Hidden; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3141 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3142 dirFilters &= ~QDir::Hidden; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3143 q->setFilter(dirFilters); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3144 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3145 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3146 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3147 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3148 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3149 When parent is root and rows have been inserted when none was there before |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3150 then select the first one. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3151 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3152 void QFileDialogPrivate::_q_rowsInserted(const QModelIndex &parent) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3153 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3154 if (!qFileDialogUi->treeView |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3155 || parent != qFileDialogUi->treeView->rootIndex() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3156 || !qFileDialogUi->treeView->selectionModel() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3157 || qFileDialogUi->treeView->selectionModel()->hasSelection() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3158 || qFileDialogUi->treeView->model()->rowCount(parent) == 0) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3159 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3160 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3161 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3162 void QFileDialogPrivate::_q_fileRenamed(const QString &path, const QString oldName, const QString newName) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3163 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3164 if (fileMode == QFileDialog::Directory || fileMode == QFileDialog::DirectoryOnly) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3165 if (path == rootPath() && lineEdit()->text() == oldName) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3166 lineEdit()->setText(newName); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3167 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3168 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3169 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3170 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3171 \internal |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3172 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3173 For the list and tree view watch keys to goto parent and back in the history |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3174 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3175 returns true if handled |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3176 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3177 bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3178 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3179 Q_Q(QFileDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3180 switch (event->key()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3181 case Qt::Key_Backspace: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3182 _q_navigateToParent(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3183 return true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3184 case Qt::Key_Back: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3185 #ifdef QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3186 if (QApplication::keypadNavigationEnabled()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3187 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3188 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3189 case Qt::Key_Left: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3190 if (event->key() == Qt::Key_Back || event->modifiers() == Qt::AltModifier) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3191 _q_navigateBackward(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3192 return true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3193 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3194 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3195 case Qt::Key_Escape: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3196 q->hide(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3197 return true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3198 default: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3199 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3200 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3201 return false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3202 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3203 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3204 QString QFileDialogPrivate::getEnvironmentVariable(const QString &string) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3205 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3206 #ifdef Q_OS_UNIX |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3207 if (string.size() > 1 && string.startsWith(QLatin1Char('$'))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3208 return QString::fromLocal8Bit(getenv(string.mid(1).toLatin1().constData())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3209 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3210 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3211 if (string.size() > 2 && string.startsWith(QLatin1Char('%')) && string.endsWith(QLatin1Char('%'))) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3212 return QString::fromLocal8Bit(qgetenv(string.mid(1, string.size() - 2).toLatin1().constData())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3213 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3214 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3215 return string; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3216 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3217 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3218 void QFileDialogComboBox::init(QFileDialogPrivate *d_pointer) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3219 d_ptr = d_pointer; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3220 urlModel = new QUrlModel(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3221 urlModel->showFullPath = true; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3222 urlModel->setFileSystemModel(d_ptr->model); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3223 setModel(urlModel); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3224 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3225 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3226 void QFileDialogComboBox::showPopup() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3227 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3228 if (model()->rowCount() > 1) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3229 QComboBox::showPopup(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3230 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3231 urlModel->setUrls(QList<QUrl>()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3232 QList<QUrl> list; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3233 QModelIndex idx = d_ptr->model->index(d_ptr->rootPath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3234 while (idx.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3235 QUrl url = QUrl::fromLocalFile(idx.data(QFileSystemModel::FilePathRole).toString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3236 if (url.isValid()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3237 list.append(url); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3238 idx = idx.parent(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3239 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3240 // add "my computer" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3241 list.append(QUrl::fromLocalFile(QLatin1String(""))); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3242 urlModel->addUrls(list, 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3243 idx = model()->index(model()->rowCount() - 1, 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3244 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3245 // append history |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3246 QList<QUrl> urls; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3247 for (int i = 0; i < m_history.count(); ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3248 QUrl path = QUrl::fromLocalFile(m_history.at(i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3249 if (!urls.contains(path)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3250 urls.prepend(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3251 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3252 if (urls.count() > 0) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3253 model()->insertRow(model()->rowCount()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3254 idx = model()->index(model()->rowCount()-1, 0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3255 // ### TODO maybe add a horizontal line before this |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3256 model()->setData(idx, QFileDialog::tr("Recent Places")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3257 QStandardItemModel *m = qobject_cast<QStandardItemModel*>(model()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3258 if (m) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3259 Qt::ItemFlags flags = m->flags(idx); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3260 flags &= ~Qt::ItemIsEnabled; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3261 m->item(idx.row(), idx.column())->setFlags(flags); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3262 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3263 urlModel->addUrls(urls, -1, false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3264 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3265 setCurrentIndex(0); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3266 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3267 QComboBox::showPopup(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3268 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3269 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3270 // Exact same as QComboBox::paintEvent(), except we elide the text. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3271 void QFileDialogComboBox::paintEvent(QPaintEvent *) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3272 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3273 QStylePainter painter(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3274 painter.setPen(palette().color(QPalette::Text)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3275 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3276 // draw the combobox frame, focusrect and selected etc. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3277 QStyleOptionComboBox opt; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3278 initStyleOption(&opt); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3279 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3280 QRect editRect = style()->subControlRect(QStyle::CC_ComboBox, &opt, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3281 QStyle::SC_ComboBoxEditField, this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3282 int size = editRect.width() - opt.iconSize.width() - 4; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3283 opt.currentText = opt.fontMetrics.elidedText(opt.currentText, Qt::ElideMiddle, size); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3284 painter.drawComplexControl(QStyle::CC_ComboBox, opt); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3285 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3286 // draw the icon and text |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3287 painter.drawControl(QStyle::CE_ComboBoxLabel, opt); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3288 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3289 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3290 QFileDialogListView::QFileDialogListView(QWidget *parent) : QListView(parent) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3291 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3292 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3293 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3294 void QFileDialogListView::init(QFileDialogPrivate *d_pointer) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3295 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3296 d_ptr = d_pointer; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3297 setSelectionBehavior(QAbstractItemView::SelectRows); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3298 setWrapping(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3299 setResizeMode(QListView::Adjust); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3300 setEditTriggers(QAbstractItemView::EditKeyPressed); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3301 setContextMenuPolicy(Qt::CustomContextMenu); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3302 #ifndef QT_NO_DRAGANDDROP |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3303 setDragDropMode(QAbstractItemView::InternalMove); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3304 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3305 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3306 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3307 QSize QFileDialogListView::sizeHint() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3308 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3309 int height = qMax(10, sizeHintForRow(0)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3310 return QSize(QListView::sizeHint().width() * 2, height * 30); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3311 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3312 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3313 void QFileDialogListView::keyPressEvent(QKeyEvent *e) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3314 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3315 #ifdef QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3316 if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3317 QListView::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3318 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3319 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3320 #endif // QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3321 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3322 if (!d_ptr->itemViewKeyboardEvent(e)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3323 QListView::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3324 e->accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3325 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3326 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3327 QFileDialogTreeView::QFileDialogTreeView(QWidget *parent) : QTreeView(parent) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3328 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3329 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3330 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3331 void QFileDialogTreeView::init(QFileDialogPrivate *d_pointer) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3332 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3333 d_ptr = d_pointer; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3334 setSelectionBehavior(QAbstractItemView::SelectRows); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3335 setRootIsDecorated(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3336 setItemsExpandable(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3337 setSortingEnabled(true); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3338 header()->setSortIndicator(0, Qt::AscendingOrder); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3339 header()->setStretchLastSection(false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3340 setTextElideMode(Qt::ElideMiddle); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3341 setEditTriggers(QAbstractItemView::EditKeyPressed); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3342 setContextMenuPolicy(Qt::CustomContextMenu); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3343 #ifndef QT_NO_DRAGANDDROP |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3344 setDragDropMode(QAbstractItemView::InternalMove); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3345 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3346 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3347 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3348 void QFileDialogTreeView::keyPressEvent(QKeyEvent *e) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3349 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3350 #ifdef QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3351 if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3352 QTreeView::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3353 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3354 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3355 #endif // QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3356 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3357 if (!d_ptr->itemViewKeyboardEvent(e)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3358 QTreeView::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3359 e->accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3360 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3361 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3362 QSize QFileDialogTreeView::sizeHint() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3363 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3364 int height = qMax(10, sizeHintForRow(0)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3365 QSize sizeHint = header()->sizeHint(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3366 return QSize(sizeHint.width() * 4, height * 30); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3367 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3368 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3369 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3370 // FIXME: this is a hack to avoid propagating key press events |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3371 // to the dialog and from there to the "Ok" button |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3372 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3373 void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3374 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3375 #ifdef QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3376 if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3377 QLineEdit::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3378 return; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3379 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3380 #endif // QT_KEYPAD_NAVIGATION |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3381 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3382 int key = e->key(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3383 QLineEdit::keyPressEvent(e); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3384 if (key != Qt::Key_Escape) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3385 e->accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3386 if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3387 e->accept(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3388 hide(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3389 d_ptr->currentView()->setFocus(Qt::ShortcutFocusReason); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3390 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3391 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3392 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3393 #ifndef QT_NO_FSCOMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3394 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3395 QString QFSCompleter::pathFromIndex(const QModelIndex &index) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3396 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3397 const QFileSystemModel *dirModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3398 if (proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3399 dirModel = qobject_cast<const QFileSystemModel *>(proxyModel->sourceModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3400 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3401 dirModel = sourceModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3402 QString currentLocation = dirModel->rootPath(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3403 QString path = index.data(QFileSystemModel::FilePathRole).toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3404 if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3405 #if defined(Q_OS_UNIX) || defined(Q_OS_WINCE) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3406 if (currentLocation == QDir::separator()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3407 return path.mid(currentLocation.length()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3408 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3409 if (currentLocation.endsWith(QLatin1Char('/'))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3410 return path.mid(currentLocation.length()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3411 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3412 return path.mid(currentLocation.length()+1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3413 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3414 return index.data(QFileSystemModel::FilePathRole).toString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3415 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3416 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3417 QStringList QFSCompleter::splitPath(const QString &path) const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3418 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3419 if (path.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3420 return QStringList(completionPrefix()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3421 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3422 QString pathCopy = QDir::toNativeSeparators(path); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3423 QString sep = QDir::separator(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3424 #if defined(Q_OS_SYMBIAN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3425 if (pathCopy == QLatin1String("\\")) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3426 return QStringList(pathCopy); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3427 #elif defined(Q_OS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3428 if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3429 return QStringList(pathCopy); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3430 QString doubleSlash(QLatin1String("\\\\")); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3431 if (pathCopy.startsWith(doubleSlash)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3432 pathCopy = pathCopy.mid(2); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3433 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3434 doubleSlash.clear(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3435 #elif defined(Q_OS_UNIX) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3436 bool expanded; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3437 pathCopy = qt_tildeExpansion(pathCopy, &expanded); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3438 if (expanded) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3439 QFileSystemModel *dirModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3440 if (proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3441 dirModel = qobject_cast<QFileSystemModel *>(proxyModel->sourceModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3442 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3443 dirModel = sourceModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3444 dirModel->fetchMore(dirModel->index(pathCopy)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3445 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3446 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3447 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3448 QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']')); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3449 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3450 #if defined(Q_OS_SYMBIAN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3451 QStringList parts = pathCopy.split(re, QString::SkipEmptyParts); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3452 if (pathCopy.endsWith(sep)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3453 parts.append(QString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3454 #elif defined(Q_OS_WIN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3455 QStringList parts = pathCopy.split(re, QString::SkipEmptyParts); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3456 if (!doubleSlash.isEmpty() && !parts.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3457 parts[0].prepend(doubleSlash); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3458 if (pathCopy.endsWith(sep)) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3459 parts.append(QString()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3460 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3461 QStringList parts = pathCopy.split(re); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3462 if (pathCopy[0] == sep[0]) // read the "/" at the beginning as the split removed it |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3463 parts[0] = sep[0]; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3464 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3465 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3466 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3467 bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3468 #else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3469 bool startsFromRoot = pathCopy[0] == sep[0]; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3470 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3471 if (parts.count() == 1 || (parts.count() > 1 && !startsFromRoot)) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3472 const QFileSystemModel *dirModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3473 if (proxyModel) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3474 dirModel = qobject_cast<const QFileSystemModel *>(proxyModel->sourceModel()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3475 else |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3476 dirModel = sourceModel; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3477 QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3478 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3479 if (currentLocation.endsWith(QLatin1Char(':'))) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3480 currentLocation.append(sep); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3481 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3482 if (currentLocation.contains(sep) && path != currentLocation) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3483 QStringList currentLocationList = splitPath(currentLocation); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3484 while (!currentLocationList.isEmpty() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3485 && parts.count() > 0 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3486 && parts.at(0) == QLatin1String("..")) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3487 parts.removeFirst(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3488 currentLocationList.removeLast(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3489 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3490 if (!currentLocationList.isEmpty() && currentLocationList.last().isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3491 currentLocationList.removeLast(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3492 return currentLocationList + parts; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3493 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3494 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3495 return parts; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3496 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3497 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3498 #endif // QT_NO_COMPLETER |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3499 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3500 #ifdef QT3_SUPPORT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3501 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3502 Use selectedFiles() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3503 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3504 \oldcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3505 QString selected = dialog->selectedFile(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3506 \newcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3507 QStringList files = dialog->selectedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3508 QString selected; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3509 if (!files.isEmpty()) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3510 selected = files[0]; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3511 \endcode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3512 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3513 QString QFileDialog::selectedFile() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3514 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3515 QStringList files = selectedFiles(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3516 return files.size() ? files.at(0) : QString(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3517 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3518 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3519 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3520 \typedef QFileDialog::Mode |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3521 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3522 Use QFileDialog::FileMode instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3523 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3524 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3525 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3526 \fn void QFileDialog::setMode(FileMode m) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3527 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3528 Use setFileMode() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3529 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3530 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3531 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3532 \fn FileMode QFileDialog::mode() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3533 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3534 Use fileMode() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3535 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3536 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3537 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3538 \fn void QFileDialog::setDir(const QString &directory) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3539 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3540 Use setDirectory() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3541 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3542 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3543 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3544 \fn void QFileDialog::setDir( const QDir &directory ) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3545 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3546 Use setDirectory() instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3547 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3548 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3549 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3550 \fn QStringList QFileDialog::getOpenFileNames(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
|
3551 const QString &dir, QWidget *parent, const char* name, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3552 const QString &caption, QString *selectedFilter, bool resolveSymlinks) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3553 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3554 Use the getOpenFileNames() overload that takes \a parent as the first |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3555 argument instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3556 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3557 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3558 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3559 \fn QString QFileDialog::getOpenFileName(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
|
3560 const QString &filter, QWidget *parent = 0, const char *name, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3561 const QString &caption, QString *selectedFilter, bool resolveSymlinks) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3562 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3563 Use the getOpenFileName() overload that takes \a parent as the first |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3564 argument instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3565 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3566 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3567 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3568 \fn QString QFileDialog::getSaveFileName(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
|
3569 const QString &filter, QWidget *parent, const char *name, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3570 const QString &caption, QString *selectedFilter, bool resolveSymlinks) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3571 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3572 Use the getSaveFileName() overload that takes \a parent as the first |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3573 argument instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3574 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3575 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3576 /*! |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3577 \fn QString QFileDialog::getExistingDirectory(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
|
3578 QWidget *parent, const char *name, 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
|
3579 bool dirOnly, bool resolveSymlinks) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3580 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3581 Use the getExistingDirectory() overload that takes \a parent as |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3582 the first argument instead. |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3583 */ |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3584 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3585 #endif // QT3_SUPPORT |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3586 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3587 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
|
3588 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3589 #include "moc_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
|
3590 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3591 #endif // QT_NO_FILEDIALOG |