qse  0.5.4
qsedataexport.h
Go to the documentation of this file.
1 #ifndef QSEDATAEXPORT_H
2 #define QSEDATAEXPORT_H
3 
4 #include <QList>
5 #include <QFlags>
6 #include <QDir>
7 #include <QDirModel>
8 #include "qsedataset.h"
9 
10 #include "ui_qsedataexport.h"
11 
14 
15 class QseDataExport : public QDialog
16 {
17  Q_OBJECT;
18 
19  public:
20  QseDataExport(const QString &id, QseDataSet *data, QList<int> selections, QWidget *parent=0);
21 
22  public:
23  static void exportSelectedData(const QString &id, QseDataSet *data, QList<int> selections);
24 
25  enum Option {
26  NoOptions = 0,
27  SaveHeader = 0x01,
28  BriefHeader = 0x02,
29  SingleFile = 0x04,
32  AutoRename = 0x20
33  };
34  Q_DECLARE_FLAGS(Options, Option);
35 
36  signals:
37  void dataChanged();
38 
39  private slots:
40  void newDirectory();
41  void upDirectory();
42  void homeDirectory();
43  void directoryChanged(const QModelIndex& index);
44  void directoryChanged(const QString& newdir);
45  void scanSelectAll();
46  void scanSelectNone();
47  void scanRevert();
48 
49  void exportPressed();
50  void cancelPressed();
51  void previewPressed();
52  void newOutputPattern(const QString &patt);
53  void saveHeaderOptionChanged(bool opt);
54  void briefHeaderOptionChanged(bool opt);
55  void singleFileOptionChanged(bool opt);
56  void fileHeaderInEachOptionChanged(bool opt);
57  void columnHeaderLineOptionChanged(bool opt);
58  void autoRenameOptionChanged(bool opt);
59 
60  private:
61  void setupConnections();
62  void updateNewDirectory();
63 
64  void readSettings();
65  void writeSettings();
66 
67  QList<int> selectedScans() const;
68  bool checkForOverwriting();
69  QString substituteFilenamePatterns(const QString &patt, int index, const QseDataSet *ds);
70 
71  void autoRenameFiles();
72  void updatePreview();
73  void writePreview();
74 
75  private:
76  Ui::QseDataExport ui;
77  QString m_Identifier;
78  QList<int> m_Selections;
80  int m_Options;
82  QString m_OutputPattern;
83  QDirModel m_DirModel;
84  QPushButton *m_PreviewButton;
87 };
88 
89 Q_DECLARE_OPERATORS_FOR_FLAGS(QseDataExport::Options);
90 
91 #endif
void newOutputPattern(const QString &patt)
void saveHeaderOptionChanged(bool opt)
QseDataExportPreview * m_Preview
Definition: qsedataexport.h:85
void updateNewDirectory()
QseDataExport(const QString &id, QseDataSet *data, QList< int > selections, QWidget *parent=0)
void autoRenameFiles()
void autoRenameOptionChanged(bool opt)
QList< int > m_Selections
Definition: qsedataexport.h:78
Ui::QseDataExport ui
Definition: qsedataexport.h:76
QDirModel m_DirModel
Definition: qsedataexport.h:83
QList< int > selectedScans() const
QseDataSet * m_DataSet
Definition: qsedataexport.h:79
void singleFileOptionChanged(bool opt)
void briefHeaderOptionChanged(bool opt)
QString m_OutputPattern
Definition: qsedataexport.h:82
QString substituteFilenamePatterns(const QString &patt, int index, const QseDataSet *ds)
void dataChanged()
bool checkForOverwriting()
static void exportSelectedData(const QString &id, QseDataSet *data, QList< int > selections)
void directoryChanged(const QModelIndex &index)
void columnHeaderLineOptionChanged(bool opt)
QString m_Identifier
Definition: qsedataexport.h:77
QseDataExportPreviewUI * m_PreviewUI
Definition: qsedataexport.h:86
void fileHeaderInEachOptionChanged(bool opt)
Q_DECLARE_FLAGS(Options, Option)
void setupConnections()
Q_DECLARE_OPERATORS_FOR_FLAGS(QseDataExport::Options)
QPushButton * m_PreviewButton
Definition: qsedataexport.h:84