2013-03-07 02:00:59 +00:00
|
|
|
#ifndef FILEDIALOG_HPP
|
|
|
|
#define FILEDIALOG_HPP
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QModelIndex>
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
#include "ui_filedialog.h"
|
2013-03-07 02:00:59 +00:00
|
|
|
|
|
|
|
class DataFilesModel;
|
|
|
|
class PluginsProxyModel;
|
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
namespace ContentSelectorView
|
2013-08-18 22:11:23 +00:00
|
|
|
{
|
2013-10-23 02:52:35 +00:00
|
|
|
class ContentSelector;
|
2013-08-18 22:11:23 +00:00
|
|
|
}
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
namespace CSVDoc
|
2013-03-07 02:00:59 +00:00
|
|
|
{
|
2013-10-23 02:52:35 +00:00
|
|
|
class FileWidget;
|
|
|
|
|
2013-09-29 17:19:07 +00:00
|
|
|
class FileDialog : public QDialog
|
2013-08-18 20:11:29 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-09-23 04:52:53 +00:00
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum DialogType
|
|
|
|
{
|
|
|
|
DialogType_New,
|
|
|
|
DialogType_Open
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
ContentSelectorView::ContentSelector *mSelector;
|
|
|
|
Ui::FileDialog ui;
|
|
|
|
DialogType mDialogType;
|
|
|
|
FileWidget *mFileWidget;
|
2013-09-23 04:52:53 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
public:
|
2013-10-23 02:52:35 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
explicit FileDialog(QWidget *parent = 0);
|
2013-10-23 02:52:35 +00:00
|
|
|
void showDialog (DialogType dialogType);
|
2013-03-07 02:00:59 +00:00
|
|
|
|
2013-09-29 17:19:07 +00:00
|
|
|
void addFiles (const QString &path);
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
QString filename() const;
|
2013-10-02 02:29:45 +00:00
|
|
|
QStringList selectedFilePaths();
|
2013-03-07 02:00:59 +00:00
|
|
|
|
2013-09-29 17:19:07 +00:00
|
|
|
private:
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
void buildNewFileView();
|
|
|
|
void buildOpenFileView();
|
2013-03-07 02:00:59 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
signals:
|
2013-10-23 22:39:17 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
void openFiles();
|
2013-09-23 09:58:11 +00:00
|
|
|
void createNewFile (const boost::filesystem::path& savePath);
|
2013-03-07 02:00:59 +00:00
|
|
|
|
2013-10-23 03:20:21 +00:00
|
|
|
void signalUpdateCreateButton (bool, int);
|
|
|
|
void signalUpdateCreateButtonFlags(int);
|
2013-03-07 02:00:59 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
private slots:
|
2013-09-29 17:19:07 +00:00
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
void slotUpdateCreateButton (int);
|
|
|
|
void slotUpdateCreateButton (const QString &, bool);
|
2013-10-23 22:39:17 +00:00
|
|
|
void slotRejected();
|
2013-08-18 20:11:29 +00:00
|
|
|
};
|
|
|
|
}
|
2013-03-07 02:00:59 +00:00
|
|
|
#endif // FILEDIALOG_HPP
|