Пример #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);
}
Пример #2
0
void AccountsComboBox::setController(PsiCon* controller)
{
	if (controller_) {
		disconnect(controller_, SIGNAL(accountCountChanged()), this, SLOT(updateAccounts()));
		disconnect(controller_, SIGNAL(accountActivityChanged()), this, SLOT(updateAccounts()));
	}

	controller_ = controller;

	if (controller_) {
		connect(controller_, SIGNAL(accountCountChanged()), this, SLOT(updateAccounts()));
		connect(controller_, SIGNAL(accountActivityChanged()), this, SLOT(updateAccounts()));
	}

	if (controller_->contactList()->haveEnabledAccounts()) {
		setAccount(controller_->contactList()->enabledAccounts().first());
	}

	updateAccounts();
}
Пример #3
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);
}
Пример #4
0
/**
 * Constructs new PsiContactList. \param psi will not be PsiContactList's parent though.
 */
PsiContactList::PsiContactList(PsiCon* psi)
	: QObject()
	, psi_(psi)
#ifdef YAPSI_ACTIVEX_SERVER
	, onlineAccount_(0)
#endif
	, showAgents_(false)
	, showHidden_(false)
	, showSelf_(false)
	, showOffline_(false)
	, accountsLoaded_(false)
{
#ifdef YAPSI
	updateErrorMessageTimer_ = new QTimer(this);
	updateErrorMessageTimer_->setInterval(100);
	updateErrorMessageTimer_->setSingleShot(true);
	connect(updateErrorMessageTimer_, SIGNAL(timeout()), SLOT(updateErrorMessage()));

	connect(this, SIGNAL(accountCountChanged()), updateErrorMessageTimer_, SLOT(start()));
#endif
}