2013-08-21 18:16:26 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QSettings>
|
|
|
|
#include "backend.h"
|
|
|
|
#include "settings.h"
|
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
class DocumentTab
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool Quit() = 0;
|
|
|
|
virtual void OnModified(bool modified) = 0;
|
|
|
|
};
|
|
|
|
|
2013-08-21 18:16:26 +00:00
|
|
|
class MyTabWidget : public QTabWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MyTabWidget();
|
2014-04-07 09:28:04 +00:00
|
|
|
bool CloseTab(int index);
|
2013-08-21 18:16:26 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnCloseTab(int index);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MainWindow(Backend *backend);
|
|
|
|
void center();
|
|
|
|
void ReadSettings();
|
|
|
|
void WriteSettings();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
protected:
|
|
|
|
void AddTab(QWidget *tab, const QString& title);
|
|
|
|
bool Quit();
|
|
|
|
|
2013-08-21 18:16:26 +00:00
|
|
|
private slots:
|
|
|
|
void OnQuit();
|
|
|
|
void OnAbout();
|
2014-02-09 01:17:14 +00:00
|
|
|
void OnAboutQt();
|
2013-08-21 18:16:26 +00:00
|
|
|
void OnLoadDesc();
|
|
|
|
void OnNewRegTab();
|
2014-04-07 09:28:04 +00:00
|
|
|
void OnNewRegEdit();
|
|
|
|
void OnTabModified(bool modified);
|
2013-08-21 18:16:26 +00:00
|
|
|
|
|
|
|
private:
|
2014-04-07 09:28:04 +00:00
|
|
|
MyTabWidget *m_tab;
|
2013-08-21 18:16:26 +00:00
|
|
|
Backend *m_backend;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|