Vidalia
0.3.1
src
vidalia
plugin
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
19
QStringList
DebugDialog::outputBuffer
;
20
QStringList
DebugDialog::syntaxBuffer
;
21
QStringList
DebugDialog::exceptBuffer
;
22
23
DebugDialog::DebugDialog
(QWidget *parent)
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
33
DebugDialog::~DebugDialog
() {}
34
35
void
36
DebugDialog::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
45
void
46
DebugDialog::outputDebug
(
const
QString &msg)
47
{
48
outputBuffer
<< msg;
49
}
50
51
void
52
DebugDialog::syntaxDebug
(
const
QString &msg)
53
{
54
syntaxBuffer
<< msg;
55
}
56
57
void
58
DebugDialog::exceptDebug
(
const
QString &msg)
59
{
60
exceptBuffer
<< msg;
61
}
62
63
void
64
DebugDialog::clear
()
65
{
66
outputBuffer
.clear();
67
syntaxBuffer
.clear();
68
exceptBuffer
.clear();
69
}
DebugDialog::outputBuffer
static QStringList outputBuffer
Definition:
DebugDialog.h:41
DebugDialog::ui
Ui::DebugDialog ui
Definition:
DebugDialog.h:45
DebugDialog::syntaxDebug
static void syntaxDebug(const QString &msg)
Definition:
DebugDialog.cpp:52
DebugDialog::exceptDebug
static void exceptDebug(const QString &msg)
Definition:
DebugDialog.cpp:58
DebugDialog::clear
static void clear()
Definition:
DebugDialog.cpp:64
DebugDialog.h
DebugDialog::DebugDialog
DebugDialog(QWidget *parent=0)
Definition:
DebugDialog.cpp:23
DebugDialog::syntaxBuffer
static QStringList syntaxBuffer
Definition:
DebugDialog.h:42
DebugDialog::fillText
void fillText(QTextEdit *tedit, QStringList buffer)
Definition:
DebugDialog.cpp:36
DebugDialog::exceptBuffer
static QStringList exceptBuffer
Definition:
DebugDialog.h:43
DebugDialog::~DebugDialog
~DebugDialog()
Definition:
DebugDialog.cpp:33
DebugDialog::outputDebug
static void outputDebug(const QString &msg)
Definition:
DebugDialog.cpp:46
Generated by
1.8.17