diff options
author | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-11-15 00:56:47 +0200 |
---|---|---|
committer | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-11-15 00:56:47 +0200 |
commit | 368cb1d14f184bc0ddbdc299e6655195b3a7d288 (patch) | |
tree | 693df1b371e1d90a1f2af97c58e9cb095c3312d7 /client/ProxyClientApp.cpp | |
parent | b8a4ef60a8fdde02460d329c8b5caac414c38ebd (diff) |
Welcome message. Docs update
Diffstat (limited to 'client/ProxyClientApp.cpp')
-rw-r--r-- | client/ProxyClientApp.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
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) |