Reading platforms from database and creating a table to platform dialog.
[emufront] / src / dialogs / dbobjectdialog.h
1 #ifndef DBOBJECTDIALOG_H
2 #define DBOBJECTDIALOG_H
3
4 #include "emufrontdialog.h"
5 #include "namedialog.h"
6 #include "../db/databasemanager.h"
7
8 class QPushButton;
9 class QModelIndex;
10 class QDialogButtonBox;
11 class QTableView;
12
13 class DbObjectDialog : public EmuFrontDialog
14 {
15     Q_OBJECT
16
17     public:
18         DbObjectDialog(QWidget *parent = 0);
19
20     protected slots:
21         void editButtonClicked();
22         void addButtonClicked();
23         void deleteButtonClicked();
24         //void enableEditButton();
25         //void enableDeleteButton();
26         void listObjectClicked(const QModelIndex &);
27     void updateList() const;
28
29     protected:
30         virtual int deleteObject() =0;
31         virtual void addObject() =0;
32         virtual void editObject() =0;
33     NameDialog *nameDialog;
34     DatabaseManager *dbManager;
35     QTableView *objectList;
36
37     private:
38         QDialogButtonBox *buttonBox;
39         QPushButton *editButton;
40         QPushButton *addButton;
41         QPushButton *deleteButton;
42
43         void setButtonsEnabled(bool);
44         void connectSignals();
45         void layout();
46         void disableSelection();
47 };
48
49 #endif