diff options
author | Jonathan Bauer | 2011-03-24 11:45:14 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-03-24 11:45:14 +0100 |
commit | 1f53d9073a713d50ecdac289c61a9b7f638efd12 (patch) | |
tree | 0d49e97bf5df9cc3cb771357d72e164887d78e08 /src/fbgui.cpp | |
parent | timestamps for debug console (diff) | |
download | fbgui-1f53d9073a713d50ecdac289c61a9b7f638efd12.tar.gz fbgui-1f53d9073a713d50ecdac289c61a9b7f638efd12.tar.xz fbgui-1f53d9073a713d50ecdac289c61a9b7f638efd12.zip |
serial path configurable
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r-- | src/fbgui.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index df0919b..c0a8839 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -37,7 +37,7 @@ fbgui::fbgui() qxtLog->debug() << "Initializing fbgui..."; } - // base of the gui + // setup base layout of the gui _webView = new QWebView(this); // debug console split or normal browser if (debugMode == 1) @@ -45,6 +45,7 @@ fbgui::fbgui() else { setCentralWidget(_webView); } + createActions(); // initialize javascript interface JavascriptInterface* jsi = new JavascriptInterface(_webView->page()->mainFrame()); @@ -64,7 +65,7 @@ fbgui::fbgui() QObject::connect(dm, SIGNAL(downloadQueueEmpty()), jsi, SLOT(callbackOnFinished())); - createActions(); + // load content _webView->load(QUrl("qrc:/html/loadAbout.html")); watchForTrigger(); @@ -84,38 +85,36 @@ void fbgui::createActions() this->addAction(_quit); connect(_quit, SIGNAL(triggered()), this, SLOT(close())); } - - //------------------------------------------------------------------------------------------- void fbgui::watchForTrigger() { // check if the directory to fileToTriggerURL exists QFileInfo fi(fileToTriggerURL); if (!fi.absoluteDir().exists()){ - qxtLog->debug() << fi.absolutePath() << " does not exists!"; + qxtLog->debug() << "[watcher] " << fi.absolutePath() << " does not exists!"; if (QDir::home().mkdir(fi.absolutePath())) - qxtLog->debug() << "Successfully created " << fi.absolutePath(); + qxtLog->debug() << "[watcher] Successfully created " << fi.absolutePath(); else - qxtLog->debug() << "Failed to create " << fi.absolutePath(); + qxtLog->debug() << "[watcher] Failed to create " << fi.absolutePath(); } else - qxtLog->debug() << fi.absolutePath() << " exists!"; + qxtLog->debug() << "[watcher] " << fi.absolutePath() << " exists!"; // check if fileToTriggerURL already exists if (fi.exists()){ - qxtLog->debug() << fileToTriggerURL << " exists already!"; + qxtLog->debug() << "[watcher] " << fileToTriggerURL << " exists already!"; // try to remove it QFile file(fi.absoluteFilePath()); if (file.remove()) - qxtLog->debug() << "Purged: " << file.fileName(); + qxtLog->debug() << "[watcher] Purged: " << file.fileName(); else{ - qxtLog->debug() << "Could not remove: " << file.fileName(); + qxtLog->debug() << "[watcher] Could not remove: " << file.fileName(); exit(EXIT_FAILURE); } } else { // watch the path where trigger file is expected - qxtLog->debug() << "Watching " << fi.absolutePath() << " for file: " << fi.fileName(); + qxtLog->debug() << "[watcher] Watching " << fi.absolutePath() << " for file: " << fi.fileName(); QStringList pathToWatch(fi.absolutePath()); _watcher = new QFileSystemWatcher(pathToWatch, this); QObject::connect(_watcher, SIGNAL(directoryChanged(const QString&)), this, SLOT(checkForTrigger(const QString&))); |