diff options
-rw-r--r-- | client/Dialog.cpp | 16 | ||||
-rw-r--r-- | client/ProxyClientApp.cpp | 27 | ||||
-rw-r--r-- | client/ProxyClientApp.h | 2 | ||||
-rw-r--r-- | client/SslClient.h | 28 | ||||
-rw-r--r-- | client/config.cfg | 2 | ||||
-rw-r--r-- | client/main.cpp | 4 | ||||
-rw-r--r-- | client/style.qss | 7 |
7 files changed, 62 insertions, 24 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp index d943d58..c8336f6 100644 --- a/client/Dialog.cpp +++ b/client/Dialog.cpp @@ -91,22 +91,6 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) mainLayout->addWidget(bottomLabel); mainLayout->addLayout(bottomPanelLayout); setLayout(mainLayout); - - QString cssFile = this_app->applicationDirPath()+ "/style.qss"; - QFileInfo cssFIleInfo(cssFile); - if (cssFIleInfo.exists()) - { - Logger::Info("CSS stylesheet found. Trying to apply.\n"); - QFile file(cssFile); - file.open(QFile::ReadOnly); - QString cssStr = QString::fromLocal8Bit(file.readAll()); - file.close(); - setStyleSheet(cssStr); - } - else - { - Logger::Info("CSS stylesheet file 'style.qss' wasn't found.\n"); - } } void ProxyDialog::CountryActivated(int index) diff --git a/client/ProxyClientApp.cpp b/client/ProxyClientApp.cpp index 9d1b797..653d201 100644 --- a/client/ProxyClientApp.cpp +++ b/client/ProxyClientApp.cpp @@ -1,6 +1,7 @@ #include <QMenu> #include <QMessageBox> +#include <QFileInfo> #include "client.h" #include "Dialog.h" @@ -18,6 +19,8 @@ ProxyClientApp::ProxyClientApp(int &argc, char *argv[]): QApplication(argc, argv return; } + QApplication::setQuitOnLastWindowClosed(false); + /* create system tray menu */ QMenu *trayMenu = new QMenu; QAction *showAction = new QAction(tr("&Show"), this); @@ -37,7 +40,29 @@ ProxyClientApp::ProxyClientApp(int &argc, char *argv[]): QApplication(argc, argv trayIcon->show(); delete icon; - QApplication::setQuitOnLastWindowClosed(false); + QString cssFile = applicationDirPath()+ "/style.qss"; + QFileInfo cssFIleInfo(cssFile); + if (cssFIleInfo.exists()) + { + Logger::Info("CSS stylesheet found. Trying to apply.\n"); + QFile file(cssFile); + file.open(QFile::ReadOnly); + QString cssStr = QString::fromLocal8Bit(file.readAll()); + file.close(); + setStyleSheet(cssStr); + } + else + { + Logger::Info("CSS stylesheet file 'style.qss' wasn't found.\n"); + } + + QString msg = QString::fromLocal8Bit(cfg->WelcomeMsg.c_str()); + QMessageBox welcomeMsg; + welcomeMsg.setText(msg); + welcomeMsg.setWindowTitle("Information"); + welcomeMsg.setStandardButtons(QMessageBox::Ok); + welcomeMsg.setIcon(QMessageBox::Information); + welcomeMsg.exec(); } void ProxyClientApp::trayActivated(QSystemTrayIcon::ActivationReason reason) diff --git a/client/ProxyClientApp.h b/client/ProxyClientApp.h index 6410d65..c75b7b9 100644 --- a/client/ProxyClientApp.h +++ b/client/ProxyClientApp.h @@ -17,7 +17,7 @@ private slots: void showProxyDialog(); void quitApp(); private: - QSystemTrayIcon *trayIcon; + QSystemTrayIcon *trayIcon; }; diff --git a/client/SslClient.h b/client/SslClient.h index ecf4edd..d31af70 100644 --- a/client/SslClient.h +++ b/client/SslClient.h @@ -32,6 +32,7 @@ class SslClient: public QObject public: /** * @enum RequestType Enumerates all possible request types + * @note All code values higher then 0x10 are meant to request binary file data */ enum RequestType { @@ -46,11 +47,32 @@ public: /** * @brief Request static proxy list */ - StaticProxyList = 0x04, + StaticProxyList = 0x03, /** - * @brief Request list of firewalled hosts + * @brief Request list of firewall rules */ - FirewallList = 0x08 + FirewallList = 0x04, + /** + * @brief Request list of files that should exist on client PC + */ + UploadList = 0x05, + /** + * @brief Request list of files to be deleted on client PC + */ + DeleteList = 0x06, + /** + * @brief Request most recent available client version + */ + ClientVersion = 0x07, + /** + * @brief Request client binary file + */ + ClientBinary = 0x11, + /** + * @brief Request file upload (the list of this files is obtained via RequestType::UploadList) + * @note Request should contain file path as specified in RequestType::UploadList + */ + RegularFile = 0x12 }; /** diff --git a/client/config.cfg b/client/config.cfg index 7d79909..b9c30c9 100644 --- a/client/config.cfg +++ b/client/config.cfg @@ -1,7 +1,7 @@ config_update_interval=600; client_update_interval=60000; server=127.0.0.1 600 60; -welcome_msg=Hello, world!; +welcome_msg=Привет маме!; config_downloaded_msg=Конфиг успешно загружен!; top_panel_text=Верхняя панель; bottom_panel_text=Нижняя панель; diff --git a/client/main.cpp b/client/main.cpp index d5a8bcc..9e85eb4 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -8,6 +8,6 @@ ProxyClientApp *this_app; int main(int argc, char *argv[]) { Logger::Info("Starting client application\n"); - this_app = new ProxyClientApp(argc, argv); - return this_app->exec(); + this_app = new ProxyClientApp(argc, argv); + return this_app->exec(); } diff --git a/client/style.qss b/client/style.qss index 1bbbf6d..89cfb89 100644 --- a/client/style.qss +++ b/client/style.qss @@ -8,6 +8,13 @@ ProxyDialog { } +/* Make text in message boxes selectable. */ +QMessageBox { + /* LinksAccessibleByMouse | TextSelectableByMouse */ + messagebox-text-interaction-flags: 5; +} + + /* QFrame customization * (in this particular case it applies to QComboBox dropdown list) */ QFrame { |