diff options
Diffstat (limited to 'client/debug.cc')
-rw-r--r-- | client/debug.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/client/debug.cc b/client/debug.cc index 066b0bc..49f970d 100644 --- a/client/debug.cc +++ b/client/debug.cc @@ -31,16 +31,26 @@ #include <QCloseEvent> #include <QSettings> #include <QAbstractItemView> +#include <QToolBar> +#include <QAction> static const char * const class_str[] = { "debug", "error", "warn", "log" }; DebugWindow::DebugWindow() { - setLayout(new QVBoxLayout()); + QWidget *center = new QWidget(); + setCentralWidget(center); + + center->setLayout(new QVBoxLayout()); lst = new QListWidget(); lst->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - layout()->addWidget(lst); + center->layout()->addWidget(lst); + + QToolBar *toolbar = addToolBar("debug"); + toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + QAction *clear = toolbar->addAction("Clear"); + connect(clear, SIGNAL(triggered()), this, SLOT(clear())); QSettings settings("Aasimon.org", "Pracro"); settings.beginGroup("DebugWindow"); @@ -62,6 +72,11 @@ void DebugWindow::closeEvent(QCloseEvent *event) event->accept(); } +void DebugWindow::clear() +{ + lst->clear(); +} + void DebugWindow::log(const char *func, const char *file, const int line, debug_class cl, const char *ch, QString &msg) { |