2019-01-05 11:12:47 +01:00
|
|
|
|
#ifndef LMAINWINDOW_H
|
|
|
|
|
|
#define LMAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
|
|
|
|
|
|
|
class IPluginContentWidgetContext;
|
2019-01-31 19:31:17 +01:00
|
|
|
|
class StaticAction;
|
2019-01-05 11:12:47 +01:00
|
|
|
|
class PluginContentWidget;
|
|
|
|
|
|
|
|
|
|
|
|
namespace LMainWindow_details {
|
|
|
|
|
|
class LMainWindowContentContext;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class LMainWindow : public QMainWindow {
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
LMainWindow(QWidget *parent = nullptr);
|
|
|
|
|
|
~LMainWindow();
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
IPluginContentWidgetContext* context();
|
|
|
|
|
|
protected:
|
|
|
|
|
|
QTabWidget *m_tabWidget = nullptr;
|
|
|
|
|
|
QToolBar *m_mainToolBar = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
// Standard menu's
|
|
|
|
|
|
QMenu *m_fileMenu = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
// Standard actions
|
|
|
|
|
|
QAction *m_closeAction = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void addModuleMenuActions();
|
|
|
|
|
|
|
2019-01-05 19:58:23 +01:00
|
|
|
|
void addModuleWidgetActionsForPage(PluginContentWidget *page);
|
|
|
|
|
|
void removeModuleWidgetActionsForPage(PluginContentWidget *page);
|
2019-01-05 11:12:47 +01:00
|
|
|
|
private:
|
|
|
|
|
|
LMainWindow_details::LMainWindowContentContext *m_context;
|
|
|
|
|
|
PluginContentWidget *m_previousPage = nullptr; ///< tracks which pages buttons were previously being displayed
|
|
|
|
|
|
|
|
|
|
|
|
void createActions();
|
2019-01-31 19:31:17 +01:00
|
|
|
|
void addMenuAction(const StaticAction &ma);
|
2019-01-05 11:12:47 +01:00
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void actionClose_triggered();
|
|
|
|
|
|
void tabWidget_tabCloseRequested(int index);
|
|
|
|
|
|
void tabWidget_currentChanged(int index);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LMAINWINDOW_H
|