Vidalia 0.3.1
DebugDialog.cpp
Go to the documentation of this file.
1/*
2** This file is part of Vidalia, and is subject to the license terms in the
3** LICENSE file, found in the top level directory of this distribution. If you
4** did not receive the LICENSE file with this file, you may obtain it from the
5** Vidalia source package distributed by the Vidalia Project at
6** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7** including this file, may be copied, modified, propagated, or distributed
8** except according to the terms described in the LICENSE file.
9*/
10
11/*
12** \file DebugDialog.cpp
13** \brief Simple dialog to see exceptions, syntaxis problems, and general
14** output for pluging
15*/
16
17#include "DebugDialog.h"
18
22
24 : QDialog(parent)
25{
26 ui.setupUi(this);
27
28 fillText(ui.tedOutput, outputBuffer);
29 fillText(ui.tedSyntax, syntaxBuffer);
30 fillText(ui.tedExceptions, exceptBuffer);
31}
32
34
35void
36DebugDialog::fillText(QTextEdit *tedit, QStringList buffer)
37{
38 foreach(QString line, buffer) {
39 tedit->setPlainText(QString("%1\n%2")
40 .arg(tedit->toPlainText())
41 .arg(line));
42 }
43}
44
45void
46DebugDialog::outputDebug(const QString &msg)
47{
48 outputBuffer << msg;
49}
50
51void
52DebugDialog::syntaxDebug(const QString &msg)
53{
54 syntaxBuffer << msg;
55}
56
57void
58DebugDialog::exceptDebug(const QString &msg)
59{
60 exceptBuffer << msg;
61}
62
63void
65{
66 outputBuffer.clear();
67 syntaxBuffer.clear();
68 exceptBuffer.clear();
69}
static QStringList exceptBuffer
Definition: DebugDialog.h:43
Ui::DebugDialog ui
Definition: DebugDialog.h:45
static QStringList outputBuffer
Definition: DebugDialog.h:41
void fillText(QTextEdit *tedit, QStringList buffer)
Definition: DebugDialog.cpp:36
static void clear()
Definition: DebugDialog.cpp:64
static void outputDebug(const QString &msg)
Definition: DebugDialog.cpp:46
static QStringList syntaxBuffer
Definition: DebugDialog.h:42
static void exceptDebug(const QString &msg)
Definition: DebugDialog.cpp:58
DebugDialog(QWidget *parent=0)
Definition: DebugDialog.cpp:23
static void syntaxDebug(const QString &msg)
Definition: DebugDialog.cpp:52