summaryrefslogtreecommitdiff
path: root/numberator.h
blob: 930a171c2fa63762420f42cef4d27cbe2527b884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef NUMBERATOR_H
#define NUMBERATOR_H

#include "aboutdialog.h"
#include "sqlitebackend.h"
#include "taglistmodel.h"
#include "tagproptablemodel.h"
#include "tagview.h"

#include <QFileDialog>
#include <QMainWindow>
#include <ui_TagEditDialog.h>

QT_BEGIN_NAMESPACE
namespace Ui {
    class Numberator;
    class TagListDock;
}
QT_END_NAMESPACE

enum ToolType {
    SELECTION_TOOL,
    TAG_TOOL,
    MOVE_TOOL,
    EDIT_TOOL,
    NUM_TOOLS
};

class Numberator : public QMainWindow
{
    Q_OBJECT

public:
    Numberator(QWidget *parent = nullptr);
    ~Numberator();

    void setTool(ToolType tool);

    bool showConfirmDiscardDialog();

public slots:
    bool showSaveDialog(); /* return true if saved successfully (i.e. no error, not cancelled), false otherwise */

private:
    Ui::Numberator *ui;
    Ui::TagListDock *tagsDockUi;
    Ui::TagEditDialog *tagEditUi;

    QSettings settings;
    QFileDialog loadImageDialog,
                saveOpenDialog;
    AboutDialog aboutDialog;

    SQLiteSaveFile proj;
    TagListModel tagListModel;
    TagPropTableModel tagPropTableModel, dialogTagPropTableModel;
    Tag m_tagBeingEdited;

    ToolType m_activeTool = SELECTION_TOOL;
};
#endif // NUMBERATOR_H