Rabbit Remote Control 0.0.33
Loading...
Searching...
No Matches
mainwindow.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef MAINWINDOW_H
4#define MAINWINDOW_H
5
6#include <QMainWindow>
7#include <QKeyEvent>
8#include <QTabWidget>
9#include <QActionGroup>
10#include <QToolButton>
11#include <QSpinBox>
12#include <QDockWidget>
13#include <QSystemTrayIcon>
14
15#include "ViewTable.h"
16#include "Client.h"
17#include "RabbitRecentMenu.h"
18#include "ParameterApp.h"
19#include "FavoriteView.h"
20
21QT_BEGIN_NAMESPACE
22namespace Ui { class MainWindow; }
23QT_END_NAMESPACE
24
26
31class MainWindow : public QMainWindow, CClient::Handle
32{
33 Q_OBJECT
34
35public:
36 explicit MainWindow(QWidget *parent = nullptr);
37 virtual ~MainWindow() override;
38
39Q_SIGNALS:
40 void sigFullScreen();
41 void sigShowNormal();
42
43private Q_SLOTS:
44 void on_actionExit_E_triggered();
45 void on_actionAbout_triggered();
46 void on_actionUpdate_triggered();
47
48 void on_actionSend_ctl_alt_del_triggered();
49
51 void slotUpdateParameters(CConnecter* pConnecter);
52 void on_actionClone_triggered();
53 void on_actionOpenRRCFile_triggered();
54 void slotOpenFile(const QString& szFile, bool bOpenSettings = false);
55 void slotConnect();
56 void slotConnected();
57private:
58 int Connect(CConnecter* p, bool set, QString szFile = QString());
59 int LoadConnectLasterClose();
60 int SaveConnectLasterClose();
61public:
62 virtual int onProcess(const QString &id, CPluginClient *pPlug) override;
63private:
64 CClient m_Client;
65 QVector<CConnecter*> m_Connecters;
66 QAction* m_pActionConnect;
67
68private Q_SLOTS:
69 void slotLoadConnecterMenu();
70 void slotCustomContextMenuRequested(const QPoint &pos);
71Q_SIGNALS:
72 void sigConnecterMenuChanged(QAction* pAction);
73
74public:
75 QAction* m_pActionConnecterMenu;
76
78private Q_SLOTS:
79 void on_actionDisconnect_D_triggered();
80 void slotCloseView(const QWidget* pView);
81 void slotDisconnect();
82 void slotDisconnected();
83 void slotError(const int nError, const QString &szInfo);
94 virtual void slotShowMessageBox(const QString& title, const QString& message,
95 const QMessageBox::Icon& icon);
104 void slotInformation(const QString& szInfo);
105 void slotUpdateName(const QString& szName);
106 void slotUpdateName();
107
108 void on_actionSettings_triggered();
109 void slotShortCut();
110
112private:
113 QPushButton * m_pSignalStatus;
114private Q_SLOTS:
115 void slotSignalConnected();
116 void slotSignalDisconnected();
117 void slotSignalError(const int nError, const QString &szInfo);
118 void slotSignalPushButtonClicked(bool checked);
119
120protected:
121 virtual void keyReleaseEvent(QKeyEvent *event) override;
122 virtual void closeEvent(QCloseEvent *event) override;
123
125private:
126 Ui::MainWindow *ui;
127 CView* m_pView;
128
129 void EnableMenu(bool bEnable);
130
131private Q_SLOTS:
132 void on_actionTabBar_B_toggled(bool bShow);
133 void on_actionMain_menu_bar_M_toggled(bool checked);
134 void on_actionToolBar_T_toggled(bool checked);
135 void on_actionStatus_bar_S_toggled(bool checked);
136
138private:
139 struct _FullState {
140 bool statusbar;
141 bool toolBar;
142 bool menubar;
143 bool dockListConnects;
144 bool dockFavorite;
145 bool dockDebugLog;
146 };
147 struct _FullState m_FullState;
148 CFrmFullScreenToolBar* m_pFullScreenToolBar;
150private Q_SLOTS:
151 void on_actionFull_screen_F_triggered();
152
153private Q_SLOTS:
154 void slotCurrentViewChanged(const QWidget* pView);
156private:
157 RabbitCommon::CRecentMenu* m_pRecentMenu;
158
160private:
161 QDockWidget* m_pDockListConnects;
162private Q_SLOTS:
163 void on_actionOpenListRecentConnections_triggered();
164
166private:
167 QDockWidget* m_pDockFavorite;
168 CFavoriteView* m_pFavoriteView;
169private Q_SLOTS:
170 void on_actionAdd_to_favorite_triggered();
171
172public:
173 CParameterApp m_Parameter;
174
176protected:
177 virtual void dragEnterEvent(QDragEnterEvent *event) override;
178 virtual void dragMoveEvent(QDragMoveEvent *event) override;
179 virtual void dropEvent(QDropEvent *event) override;
180private:
181 QPoint m_DragStartPosition;
182
184private Q_SLOTS:
185 void slotSystemTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
186 void slotSystemTrayIconTypeChanged();
187 void slotEnableSystemTrayIcon();
188
189private:
190 QSharedPointer<QSystemTrayIcon> m_TrayIcon;
191};
192
193#endif // MAINWINDOW_H
The Handle CConnecter class.
Definition Client.h:151
manage plugins and connecter
Definition Client.h:49
Connecter interface.
Definition Connecter.h:62
The plugin interface.
The CView class.
Definition View.h:25
The MainWindow class.
Definition mainwindow.h:32
virtual int onProcess(const QString &id, CPluginClient *pPlug) override
Process plugins.
void slotInformation(const QString &szInfo)
Show information.
int Connect(CConnecter *p, bool set, QString szFile=QString())
Connect.
void slotConnected()
[MainWindow slotConnected]
virtual void slotShowMessageBox(const QString &title, const QString &message, const QMessageBox::Icon &icon)
Use message box display information.
void slotCloseView(const QWidget *pView)
[MainWindow slotConnected]