Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
filedialog.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17
18#ifndef FILEDIALOG_H
19#define FILEDIALOG_H
20
21#include <QObject>
22
23#include "filetype.h"
24
28class FileDialog : public QObject
29{
30 Q_OBJECT
31public:
41 static QString getOpenFileName( QWidget* parent, FileType fileType, const QString& caption = QString() );
42
52 static QStringList getOpenFileNames( QWidget* parent, FileType fileType, const QString& caption = QString() );
53
62 static QString getSaveFileName( QWidget* parent, FileType fileType, const QString& caption = QString() );
63
72 static QString getLastOpenPath( FileType fileType );
73
81 static void setLastOpenPath( FileType fileType, const QString& openPath );
82
91 static QString getLastSavePath( FileType fileType );
92
100 static void setLastSavePath( FileType fileType, const QString& savePath );
101
102private:
103 static QString openDialogCaption( FileType fileType );
104 static QString saveDialogCaption( FileType fileType );
105 static QString openFileFilters( FileType fileType );
106 static QString saveFileFilters( FileType fileType );
107 static QString getFilterForFile( const QString& fileType, QString filePath );
108 static QString defaultFileName(FileType fileType , QString baseName = QString());
109
110 static bool hasValidSuffix(const QString& filters, const QString& filePath);
111 static QString getDefaultExtensionByFileType(FileType fileType);
112
113 static QString toSettingKey( FileType fileType );
114 static void setLastSavePaths(const QString& filePath);
115};
116
117#endif // FILEDIALOG_H
FileDialog
A wrapper around QFileDialog which remembers selected paths.
Definition: filedialog.h:29
FileDialog::getLastSavePath
static QString getLastSavePath(FileType fileType)
Retrieves the last used save path for a given file type.
Definition: filedialog.cpp:146
FileDialog::getOpenFileNames
static QStringList getOpenFileNames(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select multiple files to open.
Definition: filedialog.cpp:53
FileDialog::setLastSavePath
static void setLastSavePath(FileType fileType, const QString &savePath)
Saves the last used save path for a given file type.
Definition: filedialog.cpp:155
FileDialog::getSaveFileName
static QString getSaveFileName(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select a file save path.
Definition: filedialog.cpp:84
FileDialog::getOpenFileName
static QString getOpenFileName(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select a file to open.
Definition: filedialog.cpp:28
FileDialog::setLastOpenPath
static void setLastOpenPath(FileType fileType, const QString &openPath)
Saves the last opened file of a given type.
Definition: filedialog.cpp:138
FileDialog::getLastOpenPath
static QString getLastOpenPath(FileType fileType)
Retrieves the last opened file of a given type.
Definition: filedialog.cpp:131
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QString
QStringList
QWidget
Generated on Wed May 28 2025 08:41:44 for Pencil2D by doxygen 1.9.6 based on revision a9013b659d3ec6786ea4148c386fe61adad346a2