summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
authordeva <deva>2010-08-17 11:14:04 +0000
committerdeva <deva>2010-08-17 11:14:04 +0000
commitc788e6a1b174afd154e589a76885731c2fc19723 (patch)
tree761a87ee3941d671dd41d8b6df7a39bd85c993b1 /client/mainwindow.cc
parent2a9d0cf8c52a832c04729a4c65f07e6cd24eb19e (diff)
First shot at a debug console.
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index f7cb173..e8a7f51 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -42,10 +42,25 @@
#include <QAction>
#include <QEvent>
#include <QCloseEvent>
+#include <QLabel>
#include "macrodrawer.h"
#include "macrowindow.h"
+#include "debug.h"
+
+class Dbg : public QLabel {
+public:
+ Dbg() {
+ setText("dbg");
+ }
+
+ void mousePressEvent(QMouseEvent *)
+ {
+ dbg_toggle();
+ }
+};
+
MainWindow::MainWindow(QString cpr, QString templ, QString host,
quint16 port, QString user)
: QMainWindow(0, Qt::WindowContextHelpButtonHint),
@@ -63,6 +78,7 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
QStatusBar *status = statusBar();
status->addPermanentWidget(new QLabel("Pracro v."VERSION));
+ status->addPermanentWidget(new Dbg());
QToolBar *toolbar = addToolBar("controls");
toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
@@ -171,6 +187,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
event->accept();
if(viewer) viewer->close();
+ dbg_free();
} else {
event->ignore();
}