Example #1
0
//----------------------------------------------------------------------------
// XmlConsole
//----------------------------------------------------------------------------
XmlConsole::XmlConsole(PsiAccount *_pa)
:QWidget()
{
	ui_.setupUi(this);

	pa = _pa;
	pa->dialogRegister(this);
	connect(pa, SIGNAL(updatedAccount()), SLOT(updateCaption()));
	connect(pa->client(), SIGNAL(xmlIncoming(const QString &)), SLOT(client_xmlIncoming(const QString &)));
	connect(pa->client(), SIGNAL(xmlOutgoing(const QString &)), SLOT(client_xmlOutgoing(const QString &)));
	connect(pa->psi(), SIGNAL(accountCountChanged()), this, SLOT(updateCaption()));
	updateCaption();

	prompt = 0;

	ui_.te->setUndoRedoEnabled(false);
	ui_.te->setReadOnly(true);
	ui_.te->setAcceptRichText(false);

	QTextFrameFormat f = ui_.te->document()->rootFrame()->frameFormat();
	f.setBackground(QBrush(Qt::black));
	ui_.te->document()->rootFrame()->setFrameFormat(f);

	connect(ui_.pb_clear, SIGNAL(clicked()), SLOT(clear()));
	connect(ui_.pb_input, SIGNAL(clicked()), SLOT(insertXml()));
	connect(ui_.pb_close, SIGNAL(clicked()), SLOT(close()));
	connect(ui_.pb_dumpRingbuf, SIGNAL(clicked()), SLOT(dumpRingbuf()));
	connect(ui_.ck_enable, SIGNAL(clicked(bool)), ui_.gb_filter, SLOT(setEnabled(bool)));

	resize(560,400);
}
Example #2
0
//----------------------------------------------------------------------------
// XmlConsole
//----------------------------------------------------------------------------
XmlConsole::XmlConsole(PsiAccount *_pa)
:QWidget()
{
#ifdef YAPSI
	setStyle(YaStyle::defaultStyle());
#endif
	ui_.setupUi(this);

	pa = _pa;
	pa->dialogRegister(this);
	connect(pa, SIGNAL(updatedAccount()), SLOT(updateCaption()));
	connect(pa->client(), SIGNAL(xmlIncoming(const QString &)), SLOT(client_xmlIncoming(const QString &)));
	connect(pa->client(), SIGNAL(xmlOutgoing(const QString &)), SLOT(client_xmlOutgoing(const QString &)));
	connect(pa->psi(), SIGNAL(accountCountChanged()), this, SLOT(updateCaption()));
	updateCaption();

	prompt = 0;

	ui_.te->setUndoRedoEnabled(false);
	ui_.te->setReadOnly(true);
	ui_.te->setTextFormat(Qt::PlainText);

	QTextFrameFormat f = ui_.te->document()->rootFrame()->frameFormat();
	f.setBackground(QBrush(Qt::black));
	ui_.te->document()->rootFrame()->setFrameFormat(f);

	connect(ui_.pb_clear, SIGNAL(clicked()), SLOT(clear()));
	connect(ui_.pb_input, SIGNAL(clicked()), SLOT(insertXml()));
	connect(ui_.pb_close, SIGNAL(clicked()), SLOT(close()));
	connect(ui_.pb_dumpRingbuf, SIGNAL(clicked()), SLOT(dumpRingbuf()));
	connect(ui_.ck_enable, SIGNAL(clicked(bool)), ui_.gb_filter, SLOT(setEnabled(bool)));

#ifdef DEFAULT_XMLCONSOLE
	enable();
#endif

#ifdef YAPSI
	YaStyle::makeMeNativeLooking(this);
#endif

	resize(560,400);
}