Rabbit Remote Control 0.0.30
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 QMap<CConnecter*, QString> m_ConfigureFiles;
66 QVector<CConnecter*> m_Connecters;
67 QAction* m_pActionConnect;
68
69private Q_SLOTS:
70 void slotLoadConnecterMenu();
71 void slotCustomContextMenuRequested(const QPoint &pos);
72Q_SIGNALS:
73 void sigConnecterMenuChanged(QAction* pAction);
74
75public:
76 QAction* m_pActionConnecterMenu;
77
79private Q_SLOTS:
80 void on_actionDisconnect_D_triggered();
81 void slotCloseView(const QWidget* pView);
82 void slotDisconnect();
83 void slotDisconnected();
84 void slotError(const int nError, const QString &szInfo);
95 virtual void slotShowMessageBox(const QString& title, const QString& message,
96 const QMessageBox::Icon& icon);
105 void slotInformation(const QString& szInfo);
106 void slotUpdateName(const QString& szName);
107 void slotUpdateName();
108
109 void on_actionSettings_triggered();
110 void on_actionCurrent_connect_parameters_triggered();
111 void slotShortCut();
112
114private:
115 QPushButton * m_pSignalStatus;
116private Q_SLOTS:
117 void slotSignalConnected();
118 void slotSignalDisconnected();
119 void slotSignalError(const int nError, const QString &szInfo);
120 void slotSignalPushButtonClicked(bool checked);
121
122protected:
123 virtual void keyReleaseEvent(QKeyEvent *event) override;
124 virtual void closeEvent(QCloseEvent *event) override;
125
127private:
128 Ui::MainWindow *ui;
129 CView* m_pView;
130
131 void EnableMenu(bool bEnable);
132
133private Q_SLOTS:
134 void on_actionTabBar_B_toggled(bool bShow);
135 void on_actionMain_menu_bar_M_toggled(bool checked);
136 void on_actionToolBar_T_toggled(bool checked);
137 void on_actionStatus_bar_S_toggled(bool checked);
138
140private:
141 struct _FullState {
142 bool statusbar;
143 bool toolBar;
144 bool menubar;
145 bool dockListConnects;
146 bool dockFavorite;
147 bool dockDebugLog;
148 };
149 struct _FullState m_FullState;
150 CFrmFullScreenToolBar* m_pFullScreenToolBar;
152private Q_SLOTS:
153 void on_actionFull_screen_F_triggered();
154
155private Q_SLOTS:
156 void slotCurrentViewChanged(const QWidget* pView);
158private:
159 RabbitCommon::CRecentMenu* m_pRecentMenu;
160
162private:
163 QDockWidget* m_pDockListConnects;
164private Q_SLOTS:
165 void on_actionOpenListConnections_triggered();
166
168private:
169 QDockWidget* m_pDockFavorite;
170 CFavoriteView* m_pFavoriteView;
171private Q_SLOTS:
172 void on_actionAdd_to_favorite_triggered();
173
174public:
175 CParameterApp m_Parameter;
176
178protected:
179 virtual void dragEnterEvent(QDragEnterEvent *event) override;
180 virtual void dragMoveEvent(QDragMoveEvent *event) override;
181 virtual void dropEvent(QDropEvent *event) override;
182private:
183 QPoint m_DragStartPosition;
184
186private Q_SLOTS:
187 void slotSystemTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
188 void slotSystemTrayIconTypeChanged();
189 void slotEnableSystemTrayIcon();
190
191private:
192 QSharedPointer<QSystemTrayIcon> m_TrayIcon;
193};
194
195#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]