summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-16 14:27:21 +0100
committerJonathan Bauer2011-03-16 14:27:21 +0100
commit17fdd39dc2901a6b558f384621b6140c52e0525d (patch)
tree3d74201071bb960bc29483d7e1336614ae79c15b /src
parentoops (diff)
downloadfbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.tar.gz
fbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.tar.xz
fbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.zip
fix
Diffstat (limited to 'src')
-rw-r--r--src/downloadManager.cpp2
-rw-r--r--src/fbgui.cpp23
-rw-r--r--src/fbgui.h6
3 files changed, 14 insertions, 17 deletions
diff --git a/src/downloadManager.cpp b/src/downloadManager.cpp
index 039809a..83f02be 100644
--- a/src/downloadManager.cpp
+++ b/src/downloadManager.cpp
@@ -1,4 +1,5 @@
#include "downloadManager.h"
+#include "fbgui.h"
#include <QFileInfo>
#include <QByteArray>
@@ -6,6 +7,7 @@ int downloadManager::downloaded = 0;
// ----------------------------------------------------------------------------------------
downloadManager::downloadManager()
{
+ //fbgui::log(QString("testing @ DM init"));
qnam = new QNetworkAccessManager();
dip = false;
downloadDir = QDir(downloadPath);
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index d062529..5b15666 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -15,23 +15,12 @@ QString downloadPath(binPath + "/downloads");
QUrl baseURL(DEFAULT_URL);
bool debug = false;
int updateInterval = DEFAULT_UPDATE_INTERVAL;
+
//-------------------------------------------------------------------------------------------
fbgui::fbgui()
{
/* debug console test */
- if (debug){
- logView = new logViewer(this);
- }
- /*
- logView = new QTextEdit(this);
- logView->resize(QSize(640, 480));
- QPalette qp;
- qp.setColor(QPalette::Base, Qt::black);
- logView->setPalette(qp);
- logView->setTextColor(Qt::green);
- logView->setVisible(false);
- logView->setPlainText("empty console.");
- */
+ if (debug) logView = new logViewer(this);
/* initialize "browser" */
checkHost();
@@ -61,8 +50,8 @@ fbgui::fbgui()
}
//-------------------------------------------------------------------------------------------
void fbgui::keyPressEvent(QKeyEvent *event){
- /* test */
- if (event->key() == Qt::Key_F4){
+ /* F4 toggles debug console */
+ if (debug && event->key() == Qt::Key_F4){
if (!logView->isVisible()){
logView->append(QString("check passed."));
logView->raise();
@@ -75,6 +64,10 @@ void fbgui::keyPressEvent(QKeyEvent *event){
}
}
//-------------------------------------------------------------------------------------------
+void fbgui::log(QString text){
+ this->logView->append(text);
+}
+//-------------------------------------------------------------------------------------------
void fbgui::checkHost() const
{
QHostInfo hostInfo = QHostInfo::fromName(baseURL.host());
diff --git a/src/fbgui.h b/src/fbgui.h
index 0bbe8ba..f747fd3 100644
--- a/src/fbgui.h
+++ b/src/fbgui.h
@@ -40,11 +40,13 @@ class fbgui : public QMainWindow
public:
fbgui();
+ /* public log access */
+ void log(QString text);
private:
- QWebView *webView;
- logViewer *logView;
void checkHost() const;
+ logViewer *logView;
+ QWebView *webView;
protected: