2020-11-23 16:20:25 +03:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
|
2020-12-26 15:03:51 +03:00
|
|
|
#include "vpnprotocol.h"
|
|
|
|
|
|
2020-12-30 17:03:05 +03:00
|
|
|
class Settings;
|
2020-12-26 15:03:51 +03:00
|
|
|
class VpnConnection;
|
|
|
|
|
|
2020-11-23 16:20:25 +03:00
|
|
|
namespace Ui {
|
|
|
|
|
class MainWindow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The MainWindow class - Main application window
|
|
|
|
|
*/
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2020-12-04 00:45:21 +03:00
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
2020-11-23 16:20:25 +03:00
|
|
|
~MainWindow();
|
|
|
|
|
|
2020-12-30 17:03:05 +03:00
|
|
|
enum class Page {Initialization = 0, NewServer = 1, Vpn = 2, Sites = 3, SomeSettings = 4, Share = 5};
|
2020-11-23 16:20:25 +03:00
|
|
|
|
|
|
|
|
private slots:
|
2020-12-30 17:03:05 +03:00
|
|
|
void onBytesChanged(quint64 receivedBytes, quint64 sentBytes);
|
|
|
|
|
void onConnectionStateChanged(VpnProtocol::ConnectionState state);
|
|
|
|
|
void onPushButtonBackFromNewServerClicked(bool clicked);
|
|
|
|
|
void onPushButtonBackFromSettingsClicked(bool clicked);
|
|
|
|
|
void onPushButtonBackFromSitesClicked(bool clicked);
|
2020-12-16 06:02:22 +03:00
|
|
|
void onPushButtonBlockedListClicked(bool clicked);
|
2020-12-26 15:03:51 +03:00
|
|
|
void onPushButtonConnectToggled(bool checked);
|
2020-12-30 17:03:05 +03:00
|
|
|
void onPushButtonNewServerConnectWithNewData(bool clicked);
|
|
|
|
|
void onPushButtonNewServerSetup(bool clicked);
|
2020-12-16 06:02:22 +03:00
|
|
|
void onPushButtonSettingsClicked(bool clicked);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void keyPressEvent(QKeyEvent* event);
|
2020-12-30 17:03:05 +03:00
|
|
|
bool requestOvpnConfig(const QString& hostName, const QString& userName, const QString& password, int port = 22, int timeout = 30);
|
2020-11-23 16:20:25 +03:00
|
|
|
|
|
|
|
|
private:
|
2020-12-30 17:03:05 +03:00
|
|
|
void goToPage(Page page);
|
2020-12-16 06:02:22 +03:00
|
|
|
|
2020-11-23 16:20:25 +03:00
|
|
|
Ui::MainWindow *ui;
|
2020-12-26 15:03:51 +03:00
|
|
|
VpnConnection* m_vpnConnection;
|
2020-12-30 17:03:05 +03:00
|
|
|
Settings* m_settings;
|
2020-11-23 16:20:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|