void ICQSearchResult::setRequestId(unsigned short id) { m_id = id; setStatus(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (m_id == 0) || (m_id == SEARCH_FAIL)); }
void ICQSearchResult::setText(const QString &text) { lblStatus->setText(text); tblUser->hide(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, true); }
void ICQSearchResult::clear() { setRequestId(SEARCH_DONE, SEARCH_DONE); m_nFound = 0; tblUser->clear(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); }
void ICQSearchResult::setRequestId(unsigned short id1, unsigned short id2) { m_id1 = id1; m_id2 = id2; setStatus(); tblUser->show(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (m_id1 == SEARCH_DONE) && (m_id2 == SEARCH_DONE)); }
void AddResult::finishEnable(bool state) { QWizard *w = NULL; for (QWidget *p = parentWidget(); p; p = p->parentWidget()){ if (p->inherits("QWizard")){ w = static_cast<QWizard*>(p); break; } } if (w == NULL) return; if (state != m_bConnect){ m_bConnect = state; if (m_bConnect){ connect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); }else{ disconnect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); } } w->setFinishEnabled(this, state); }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id1 = SEARCH_DONE; m_id2 = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn("", -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(i18n("Name")); tblUser->setExpandingColumn(COL_NAME); tblUser->setSorting(COL_SCREEN); tblUser->setMenu(MenuSearchResult); tblUser->header()->hide(); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged()), this, SLOT(selectChanged())); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); connect(wizard->finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked())); }
void ICQSearchResult::selectionChanged() { QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (tblUser->selectedItem() != NULL)); }