Fixed bugs: dialogs remained disabled (signals were not attached to
[emufront] / src / dialogs / dbobjectdialog.h
index cb24883..38442d0 100644 (file)
@@ -5,17 +5,17 @@
 //
 //
 // EmuFront is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// it under the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation and appearing in the file gpl.txt included in the
+// packaging of this file.
 //
-// Foobar is distributed in the hope that it will be useful,
+// EmuFront is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // GNU General Public License for more details.
 //
 // You should have received a copy of the GNU General Public License
-// along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+// along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
 
 #ifndef DBOBJECTDIALOG_H
 #define DBOBJECTDIALOG_H
@@ -37,43 +37,53 @@ class DbObjectDialog : public EmuFrontDialog
 public:
     DbObjectDialog(QWidget *parent = 0);
     ~DbObjectDialog();
+    virtual void refreshDataModel();
 
-protected slots:
+private slots:
        void editButtonClicked();
        void addButtonClicked();
        void deleteButtonClicked();
        void listObjectClicked(const QModelIndex &);
     void updateData();
+    void updateReject();
     void updateList() const;
-    private slots:
+    void testSlot();
+    void enableUi();
 
 protected:
-       virtual int deleteObject() =0;
     // implementation specific, deletes current data object from memory
-    virtual void deleteCurrentObject();
-       virtual void addObject() =0;
-    virtual bool deleteItem() = 0;
-    virtual void updateDb(const EmuFrontObject*) const = 0;
-    virtual void insertDb(const EmuFrontObject*) const = 0;
-    void editObject();
-    void connectSignals();
-    void activateNameDialog();
+    virtual void deleteCurrentObject() = 0;
+    virtual void cleanUp() = 0;
+    virtual void initEditDialog() = 0;
+    virtual EmuFrontObject* createObject() = 0;
+    virtual void closeEvent(QCloseEvent *);
     void initDataTable();
-    bool confirmDelete(QString name, int numRefs);
+    virtual void connectSignals();
+    virtual void connectNameDialogSignals();
     DataObjectEditDialog *nameDialog;
+    EmuFrontObject *dbObject;
     DatabaseManager *dbManager;
+    QDialogButtonBox *buttonBox;
     QTableView *objectList;
-    EmuFrontObject *dbObject;
+    QList<int> hiddenColumns;
+    void hideColumns();
 
 private:
-       void setButtonsEnabled(bool);
+    bool deleteItem();
+    void addObject();
+    void insertDb(const EmuFrontObject*) const;
+    void updateDb(const EmuFrontObject*) const;
+    void editObject();
+    void activateNameDialog(bool updateData = true);
+    bool confirmDelete(QString name, int numRefs);
+    void setButtonsEnabled(bool);
+    void setUIEnabled(bool);
     void layout();
     void disableSelection();
-    QDialogButtonBox *buttonBox;
+    void createEditDialog();
     QPushButton *editButton;
     QPushButton *addButton;
     QPushButton *deleteButton;
-
 };
 
 #endif