summaryrefslogtreecommitdiffstats
path: root/src/fbgui.cpp
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/fbgui.cpp
parentoops (diff)
downloadfbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.tar.gz
fbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.tar.xz
fbgui-17fdd39dc2901a6b558f384621b6140c52e0525d.zip
fix
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r--src/fbgui.cpp23
1 files changed, 8 insertions, 15 deletions
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());