void dlgJabberChatRoomsList::slotQuery()
{
	if(!m_account->isConnected())
	{
		m_account->errorConnectFirst();
		return;
	}

	tblChatRoomsList->setNumRows(0);

	XMPP::JT_DiscoItems *discoTask = new XMPP::JT_DiscoItems(m_account->client()->rootTask());
	connect (discoTask, SIGNAL(finished()), this, SLOT(slotQueryFinished()));

	m_chatServer = leServer->text();
	discoTask->get(leServer->text());
	discoTask->go(true);
}
示例#2
0
CSearchToolWidget::CSearchToolWidget(QTabWidget * parent)
: QWidget(parent)
{
    setupUi(this);
    setObjectName("Search");

    connect(lineInput, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
    connect(&CSearchDB::self(), SIGNAL(sigStatus(const QString&)), labelStatus, SLOT(setText(const QString&)));
    connect(&CSearchDB::self(), SIGNAL(sigFinished()), this, SLOT(slotQueryFinished()));
    connect(&CSearchDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    connect(listResults,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(slotItemClicked(QListWidgetItem*)));

    parent->insertTab(0,this,QIcon(":/icons/iconSearch16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Search"));

    contextMenu = new QMenu(this);
    contextMenu->addAction(QPixmap(":/icons/iconClipboard16x16.png"),tr("Copy Position"),this,SLOT(slotCopyPosition()),Qt::CTRL + Qt::Key_C);
    contextMenu->addAction(QPixmap(":/icons/iconAdd16x16.png"),tr("Add Waypoint ..."),this,SLOT(slotAdd()));
    contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()),Qt::Key_Delete);

    connect(listResults,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));

    comboHost->addItem(tr("OpenRouteService"), CSearchDB::eOpenRouteService);
    //    comboHost->addItem(tr("MapQuest"), CSearchDB::eMapQuest);
    comboHost->addItem(tr("Google"), CSearchDB::eGoogle);

    SETTINGS;
    cfg.beginGroup("search");
    int idx = comboHost->findData(cfg.value("host", CSearchDB::eOpenRouteService));
    if(idx != -1)
    {
        comboHost->setCurrentIndex(idx);
    }

    cfg.endGroup();

    connect(comboHost, SIGNAL(currentIndexChanged(int)), this, SLOT(slotHostChanged(int)));
}