|
Krita Source Code Documentation
|
#include <KoFileDialog.h>
Inheritance diagram for KoFileDialog:Public Types | |
| enum | DialogType { OpenFile , OpenFiles , OpenDirectory , ImportFile , ImportFiles , ImportDirectory , SaveFile } |
Public Slots | |
| void | onFilterSelected (const QString &filter) |
Public Member Functions | |
| QString | filename () |
| Get the file name the user selected in the file dialog. | |
| QStringList | filenames () |
| Get the file names the user selected in the file dialog. | |
| KoFileDialog (QWidget *parent, KoFileDialog::DialogType type, const QString &dialogName) | |
| constructor | |
| Private (QWidget *parent_, KoFileDialog::DialogType dialogType_, const QString caption_, const QString defaultDir_, const QString dialogName_) | |
| QString | selectedMimeType () const |
| QString | selectedNameFilter () const |
| selectedNameFilter returns the name filter the user selected, either directory or by clicking on it. | |
| void | selectNameFilter (const QString &filter) |
| void | setCaption (const QString &caption) |
| void | setDefaultDir (const QString &defaultDir, bool force=false) |
| setDefaultDir set the default directory to defaultDir. | |
| void | setDirectoryUrl (const QUrl &defaultUri) |
| setDirectoryUrl set the default URI to defaultUri. | |
| void | setImageFilters () |
| setImageFilters sets the name filters for the file dialog to all image formats Qt's QImageReader supports. | |
| void | setMimeTypeFilters (const QStringList &mimeTypeList, QString defaultMimeType=QString()) |
| setMimeTypeFilters Update the list of file filters from mime types. | |
| void | setNameFilter (const QString &filter) |
| ~KoFileDialog () override | |
| ~Private () | |
Public Attributes | |
| QString | caption |
| QString | defaultDirectory |
| QString | defaultFilter |
| QUrl | defaultUri |
| QString | dialogName |
| QScopedPointer< KisPreviewFileDialog > | fileDialog |
| QStringList | filterList |
| QString | mimeType |
| QWidget * | parent |
| QString | proposedFileName |
| QMap< QString, QString > | suffixes |
| KoFileDialog::DialogType | type |
Private Member Functions | |
| void | createFileDialog () |
| const QPair< QStringList, QMap< QString, QString > > | getFilterStringListFromMime (const QStringList &mimeList, bool withAllSupportedEntry=false) |
| QString | getUsedDir (const QString &dialogName) |
| void | saveUsedDir (const QString &fileName, const QString &dialogName) |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Static Private Member Functions | |
| static QStringList | splitNameFilter (const QString &nameFilter, QStringList *mimeList) |
| splitNameFilter take a single line of a QDialog name filter and split it into several lines. This is needed because a single line name filter can contain more than one mimetype, making it impossible to figure out the correct extension. | |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Wrapper around QFileDialog providing native file dialogs on KDE/Gnome/Windows/OSX/etc.
Definition at line 32 of file KoFileDialog.cpp.
| Enumerator | |
|---|---|
| OpenFile | |
| OpenFiles | |
| OpenDirectory | |
| ImportFile | |
| ImportFiles | |
| ImportDirectory | |
| SaveFile | |
Definition at line 26 of file KoFileDialog.h.
|
inline |
Definition at line 50 of file KoFileDialog.cpp.
| KoFileDialog::KoFileDialog | ( | QWidget * | parent, |
| KoFileDialog::DialogType | type, | ||
| const QString & | dialogName ) |
constructor
| parent | The parent of the file dialog |
| dialogType | usage of the file dialog |
| dialogName | the name for the file dialog. This will be used to open the filedialog in the last open location, instead the specified directory. |
Definition at line 68 of file KoFileDialog.cpp.
|
override |
|
private |
Definition at line 138 of file KoFileDialog.cpp.
References connect(), d, KisMimeDatabase::descriptionForMimeType(), ImportDirectory, ImportFile, ImportFiles, KisMacosSecurityBookmarkManager::instance(), KisMacosSecurityBookmarkManager::isSandboxed(), KisMimeDatabase::mimeTypeForFile(), onFilterSelected(), OpenDirectory, OpenFile, and SaveFile.
| QString KoFileDialog::filename | ( | ) |
Get the file name the user selected in the file dialog.
Definition at line 261 of file KoFileDialog.cpp.
References createFileDialog(), d, KisMimeDatabase::mimeTypeForFile(), KisMimeDatabase::mimeTypeForSuffix(), SaveFile, saveUsedDir(), and warnWidgetUtils.
| QStringList KoFileDialog::filenames | ( | ) |
Get the file names the user selected in the file dialog.
Definition at line 372 of file KoFileDialog.cpp.
References createFileDialog(), d, and saveUsedDir().
|
private |
|
private |
Definition at line 567 of file KoFileDialog.cpp.
References dialogName.
|
slot |
Definition at line 588 of file KoFileDialog.cpp.
References d, debugWidgetUtils, and warnWidgetUtils.
|
inline |
Definition at line 35 of file KoFileDialog.cpp.
|
private |
Definition at line 576 of file KoFileDialog.cpp.
References dialogName.
| QString KoFileDialog::selectedMimeType | ( | ) | const |
| QString KoFileDialog::selectedNameFilter | ( | ) | const |
selectedNameFilter returns the name filter the user selected, either directory or by clicking on it.
Definition at line 128 of file KoFileDialog.cpp.
References d.
| void KoFileDialog::selectNameFilter | ( | const QString & | filter | ) |
Definition at line 123 of file KoFileDialog.cpp.
References d.
| void KoFileDialog::setCaption | ( | const QString & | caption | ) |
| void KoFileDialog::setDefaultDir | ( | const QString & | defaultDir, |
| bool | force = false ) |
setDefaultDir set the default directory to defaultDir.
| defaultDir | a path to a file or directory |
Definition at line 85 of file KoFileDialog.cpp.
References d.
| void KoFileDialog::setDirectoryUrl | ( | const QUrl & | defaultUri | ) |
setDirectoryUrl set the default URI to defaultUri.
| defaultUri | a Uri to a file from some ContentProvider |
Used only on Android.
Definition at line 103 of file KoFileDialog.cpp.
References d, and defaultUri.
| void KoFileDialog::setImageFilters | ( | ) |
setImageFilters sets the name filters for the file dialog to all image formats Qt's QImageReader supports.
Definition at line 108 of file KoFileDialog.cpp.
References setMimeTypeFilters().
| void KoFileDialog::setMimeTypeFilters | ( | const QStringList & | mimeTypeList, |
| QString | defaultMimeType = QString() ) |
setMimeTypeFilters Update the list of file filters from mime types.
| mimeTypeList | A list of mime types that forms the basis of this dialog's file filters |
| defaultMimeType | Sets the default filter based on this mime type |
Definition at line 419 of file KoFileDialog.cpp.
References d, debugWidgetUtils, defaultFilter, KisMimeDatabase::descriptionForMimeType(), KIS_SAFE_ASSERT_RECOVER, mimeType, suffixes, KisMimeDatabase::suffixesForMimeType(), and warnWidgetUtils.
| void KoFileDialog::setNameFilter | ( | const QString & | filter | ) |
Definition at line 118 of file KoFileDialog.cpp.
References d.
|
staticprivate |
splitNameFilter take a single line of a QDialog name filter and split it into several lines. This is needed because a single line name filter can contain more than one mimetype, making it impossible to figure out the correct extension.
The methods takes care of some duplicated extensions, like jpeg and jpg.
| nameFilter | the namefilter to be split |
| mimeList | a pointer to the list with mimes that shouldn't be added. |
Definition at line 386 of file KoFileDialog.cpp.
References KisMimeDatabase::descriptionForMimeType(), mimeType, and KisMimeDatabase::mimeTypeForSuffix().
| QString KoFileDialog::caption |
Definition at line 57 of file KoFileDialog.cpp.
|
private |
Definition at line 131 of file KoFileDialog.h.
| QString KoFileDialog::defaultDirectory |
Definition at line 58 of file KoFileDialog.cpp.
| QString KoFileDialog::defaultFilter |
Definition at line 63 of file KoFileDialog.cpp.
| QUrl KoFileDialog::defaultUri |
Definition at line 60 of file KoFileDialog.cpp.
| QString KoFileDialog::dialogName |
Definition at line 56 of file KoFileDialog.cpp.
| QScopedPointer<KisPreviewFileDialog> KoFileDialog::fileDialog |
Definition at line 64 of file KoFileDialog.cpp.
| QStringList KoFileDialog::filterList |
Definition at line 61 of file KoFileDialog.cpp.
| QString KoFileDialog::mimeType |
Definition at line 65 of file KoFileDialog.cpp.
| QWidget* KoFileDialog::parent |
Definition at line 54 of file KoFileDialog.cpp.
| QString KoFileDialog::proposedFileName |
Definition at line 59 of file KoFileDialog.cpp.
| QMap<QString, QString> KoFileDialog::suffixes |
Definition at line 62 of file KoFileDialog.cpp.
| KoFileDialog::DialogType KoFileDialog::type |
Definition at line 55 of file KoFileDialog.cpp.