diff options
author | Michael Neves | 2012-01-30 14:43:56 +0100 |
---|---|---|
committer | Michael Neves | 2012-01-30 14:43:56 +0100 |
commit | 6213133b3769b50d3abe5f4df2d42ae17264f99b (patch) | |
tree | cf2e0b1c4913c2b4348e3e05c04877e9b60f0790 /src | |
parent | ssl options to fbgui (diff) | |
download | fbgui-6213133b3769b50d3abe5f4df2d42ae17264f99b.tar.gz fbgui-6213133b3769b50d3abe5f4df2d42ae17264f99b.tar.xz fbgui-6213133b3769b50d3abe5f4df2d42ae17264f99b.zip |
ssl option for fbgui
Diffstat (limited to 'src')
-rw-r--r-- | src/fbgui/fbgui.cpp | 4 | ||||
-rw-r--r-- | src/fbgui/fbgui.h | 2 | ||||
-rw-r--r-- | src/fbgui/main.cpp | 18 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/fbgui/fbgui.cpp b/src/fbgui/fbgui.cpp index 759c747..b37e018 100644 --- a/src/fbgui/fbgui.cpp +++ b/src/fbgui/fbgui.cpp @@ -26,6 +26,7 @@ int updateInterval = -1; QString fileToTriggerURL(""); QString serialLocation(""); QString sessionID(""); +bool sslSupport; int debugMode = -1; //------------------------------------------------------------------------------------------- @@ -54,6 +55,9 @@ void fbgui::init() { // start fbgui LOG4CXX_DEBUG(coreLogger, "Initializing fbgui..."); + if(sslSupport) + LOG4CXX_DEBUG(coreLogger, "SSL enabled."); + _watcher = new QFileSystemWatcher(this); setupLayout(); diff --git a/src/fbgui/fbgui.h b/src/fbgui/fbgui.h index 4891194..3a62579 100644 --- a/src/fbgui/fbgui.h +++ b/src/fbgui/fbgui.h @@ -31,6 +31,7 @@ #define DEFAULT_UPDATE_INTERVAL 1; #define DEFAULT_QRC_HTML_DIR ":/html" #define DEFAULT_FILE_TRIGGER "/tmp/fbgui/trigger" +#define DEFAULT_SSL_SUPPORT false; // Global settings variables extern QString logFilePath; @@ -44,6 +45,7 @@ extern QString downloadPath; extern QUrl baseURL; extern int debugMode; extern int updateInterval; +extern bool sslSupport; class fbgui: public QMainWindow { diff --git a/src/fbgui/main.cpp b/src/fbgui/main.cpp index 6284054..9e29cbd 100644 --- a/src/fbgui/main.cpp +++ b/src/fbgui/main.cpp @@ -37,6 +37,8 @@ void printHelp() { "Activate debug mode. [0,1]") << endl; qout << "-h, --help " << QObject::tr( "Prints this help.") << endl; + qout << "-x, --ssl " << QObject::tr( + "Enables SSL support.") << endl; qout.flush(); exit( EXIT_SUCCESS); } @@ -80,7 +82,7 @@ int main(int argc, char *argv[]) { // parse command line arguments using getopt QMap<QString, QString> clOpts; int longIndex = 0; - static const char *optString = "c:u:d:s:t:D:hl:nS:p:e:"; + static const char *optString = "c:u:d:s:t:D:hl:nS:p:e:x"; static const struct option longOpts[] = { { "config", required_argument, NULL, 'c' }, { "url", required_argument, NULL, 'u' }, { "download", required_argument, NULL, 'd' }, { "serial", required_argument, NULL, @@ -90,7 +92,7 @@ int main(int argc, char *argv[]) { { "nd", no_argument, NULL, 'n' }, { "server", required_argument, NULL, 'S' }, { "autoup", no_argument, NULL, 'a' }, { "socketserverpath", required_argument, NULL, 'p' }, { - "pathtoexe", required_argument, NULL, 'e' } }; + "pathtoexe", required_argument, NULL, 'e' }, { "ssl", no_argument, NULL, 'x' } }; int opt = getopt_long(argc, argv, optString, longOpts, &longIndex); while (opt != -1) { switch (opt) { @@ -133,6 +135,9 @@ int main(int argc, char *argv[]) { case 'e': clOpts.insert("pathtoexe", optarg); break; + case 'x': + clOpts.insert("ssl", "ssl"); + break; } opt = getopt_long(argc, argv, optString, longOpts, &longIndex); } @@ -185,6 +190,14 @@ int main(int argc, char *argv[]) { else baseURL = DEFAULT_URL; + // set SSL support + if (clOpts.contains("ssl")) + sslSupport = true; + else if (confFileSettings.contains("default/ssl_support")) + sslSupport = confFileSettings.value("default/ssl_support").toBool(); + else + sslSupport = DEFAULT_SSL_SUPPORT; + // set directory for downloads if (clOpts.contains("downloadDir")) downloadPath = clOpts.value("downloadDir"); @@ -281,6 +294,7 @@ int main(int argc, char *argv[]) { LOG4CXX_DEBUG(logger, "downloadDir : " << downloadPath); LOG4CXX_DEBUG(logger, "trigger: " << fileToTriggerURL); LOG4CXX_DEBUG(logger, "serialLocation: " << serialLocation); + LOG4CXX_DEBUG(logger, "ssl: " << sslSupport); if (clOpts.contains("nd") || confFileSettings.contains("default/nd")) { LOG4CXX_DEBUG(logger, "*******************************************"); LOG4CXX_DEBUG(logger, "Network Discovery activated:"); |