From c788e6a1b174afd154e589a76885731c2fc19723 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 17 Aug 2010 11:14:04 +0000 Subject: First shot at a debug console. --- client/mainwindow.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'client/mainwindow.cc') 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 #include #include +#include #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(); } -- cgit v1.2.3