1 /****************************************************************************
2 **
3 **  Copyright (C) 2019 Kevin B. Hendricks, Stratford Ontario Canada
4 **
5 **  This file is part of Sigil.
6 **
7 **  Sigil is free software: you can redistribute it and/or modify
8 **  it under the terms of the GNU General Public License as published by
9 **  the Free Software Foundation, either version 3 of the License, or
10 **  (at your option) any later version.
11 **
12 **  Sigil is distributed in the hope that it will be useful,
13 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 **  GNU General Public License for more details.
16 **
17 **  You should have received a copy of the GNU General Public License
18 **  along with Sigil.  If not, see <http://www.gnu.org/licenses/>.
19 **
20 *************************************************************************/
21 
22 #ifndef EMPTYLAYOUT_H
23 #define EMPTYLAYOUT_H
24 
25 #include <QString>
26 #include <QDialog>
27 #include <QWidget>
28 #include <QModelIndex>
29 #include "Misc/TempFolder.h"
30 
31 #include "ui_EmptyLayout.h"
32 
33 class QFileSystemModel;
34 
35 class EmptyLayout : public QDialog, private Ui::EmptyLayout
36 {
37     Q_OBJECT
38 
39 public:
40     EmptyLayout(const QString &version, QWidget *parent = 0);
41 
42     ~EmptyLayout();
43 
44     static QStringList GetPathsToFilesInFolder(const QString&fullfolderpath, const QString &basepath);
45 
GetBookPaths()46     QStringList GetBookPaths() { return m_BookPaths; };
47 
48 public slots:
49     void updateActions();
50 
51 protected slots:
52     void reject();
53 
54 private slots:
55     void deleteCurrent();
56     void addFolder();
57     void addFile(QAction * act);
58     void renameCurrent();
59     void saveData();
60 
61     void loadDesign();
62     void saveDesign();
63     bool cleanEpubRoot();
64 
65  private:
66     void ReadSettings();
67     void WriteSettings();
68     void setupMarkersMenu();
69     QString GetInput(const QString& title, const QString& prompt, const QString& initvalue);
70 
71     QFileSystemModel * m_fsmodel;
72     QMenu* m_filemenu;
73     TempFolder m_TempFolder;
74     QString m_MainFolder;
75     QString m_EpubVersion;
76     QStringList m_BookPaths;
77     bool m_hasOPF;
78     bool m_hasNCX;
79     bool m_hasNAV;
80     QString m_LastDirSaved;
81     QString m_LastFileSaved;
82 };
83 
84 #endif // EMPTYLAYOUT_H
85