Moving things from the application specific DatabaseWindow to generic LMainWindow (Leon framework)

To achieve flexibility the getDatabase call on the context which was application specific to
has been replaced with a type based object registry.
This commit is contained in:
eelke 2019-01-05 09:49:12 +01:00
parent 4a78330153
commit fd603a7434
5 changed files with 137 additions and 99 deletions

View file

@ -51,16 +51,33 @@ public:
LMainWindow(QWidget *parent = nullptr);
void initModuleMenus();
void setTabCaptionForWidget(QWidget *widget, const QString &caption, const QString &hint);
void setTabIcon(QWidget *widget, const QString &iconname);
/// Called when a newly created page is added to the QTabWidget
void addPage(PluginContentWidget* page, QString caption);
protected:
QTabWidget *m_tabWidget = nullptr;
QToolBar *m_mainToolBar = nullptr;
// Standard menu's
QMenu *m_fileMenu = nullptr;
// Standard actions
QAction *m_closeAction = nullptr;
DatabaseWindow_details::DatabaseWindowContentContext *m_context;
void addModuleMenuActions();
private:
QMenu *m_fileMenu = nullptr;
private:
void createActions();
void addMenuAction(const MenuAction &ma);
private slots:
void actionClose_triggered();
};
@ -79,19 +96,8 @@ public:
void newCodeGenPage(QString query, std::shared_ptr<const Pgsql::Result> dbres);
void setTabCaptionForWidget(QWidget *widget, const QString &caption, const QString &hint);
void setTabIcon(QWidget *widget, const QString &iconname);
/// Called when a newly created page is added to the QTabWidget
void addPage(PluginContentWidget* page, QString caption);
private:
QTabWidget *m_tabWidget = nullptr;
QToolBar *m_mainToolBar = nullptr;
// Standard actions
QAction *m_closeAction = nullptr;
ConnectionConfig m_config;
std::shared_ptr<OpenDatabase> m_database;
@ -143,7 +149,6 @@ private:
QFutureWatcher<LoadCatalog::Result> loadWatcher;
void createActions();
QueryTab *GetActiveQueryTab();
void closeEvent(QCloseEvent *event);
@ -165,7 +170,6 @@ private slots:
void on_actionLoad_SQL_triggered();
void on_actionSave_SQL_triggered();
void on_actionExport_data_triggered();
void actionClose_triggered();
void on_actionAbout_triggered();
void on_actionSave_SQL_as_triggered();
void on_actionSave_copy_of_SQL_as_triggered();