DatabaseWindow now provides some functionality to its child components through the IDatabaseWindow interface.
This way children do not need to include the full header to get access to some utility functions for changing the titles and icons of tabpages (and in fact do not need to know that there are tabs, could be something else)
This commit is contained in:
parent
6d4df99100
commit
1a2ec6a224
6 changed files with 84 additions and 135 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "OpenDatabase.h"
|
||||
#include "Pgsql_Connection.h"
|
||||
#include "ControllableTask.h"
|
||||
#include "IDatabaseWindow.h"
|
||||
#include <QFutureWatcher>
|
||||
#include <QMainWindow>
|
||||
#include <memory>
|
||||
|
|
@ -24,11 +25,10 @@ class QMenu;
|
|||
class QTabWidget;
|
||||
class QToolBar;
|
||||
|
||||
|
||||
/** This is the class for windows that handle tasks for a specific database/catalog
|
||||
*
|
||||
*/
|
||||
class DatabaseWindow : public QMainWindow {
|
||||
class DatabaseWindow : public QMainWindow, public IDatabaseWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DatabaseWindow(MasterController *master, QWidget *parent);
|
||||
|
|
@ -136,6 +136,13 @@ private slots:
|
|||
void on_actionSaveSqlAs_triggered();
|
||||
void on_actionSaveCopyOfSqlAs_triggered();
|
||||
void on_actionShowConnectionManager_triggered();
|
||||
|
||||
// IDatabaseWindow interface
|
||||
public:
|
||||
virtual void setTitleForWidget(QWidget *widget, QString title, QString hint) override;
|
||||
virtual void setIconForWidget(QWidget *widget, QIcon icon) override;
|
||||
virtual std::shared_ptr<OpenDatabase> openDatabase() override;
|
||||
virtual void showStatusBarMessage(QString message) override;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue