From 368cb1d14f184bc0ddbdc299e6655195b3a7d288 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Tue, 15 Nov 2011 00:56:47 +0200 Subject: Welcome message. Docs update --- client/ProxyClientApp.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'client/ProxyClientApp.cpp') 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 #include +#include #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) -- cgit v1.2.3