bool WatchersDialog::parseWatchers(CvsService_stub* cvsService, const QStringList& files) { setCaption(i18n("CVS Watchers")); DCOPRef job = cvsService->watchers(files); if( !cvsService->ok() ) return false; ProgressDialog dlg(this, "Watchers", job, "watchers", i18n("CVS Watchers")); if( !dlg.execute() ) return false; QString line; int numRows = 0; while( dlg.getLine(line) ) { // parse the output line QStringList list = splitLine(line); // ignore empty lines and unknown files if( list.isEmpty() || list[0] == "?" ) continue; // add a new row to the table table->setNumRows(numRows + 1); table->setText(numRows, 0, list[0]); table->setText(numRows, 1, list[1]); QCheckTableItem* item = new QCheckTableItem(table, ""); item->setChecked(list.contains("edit")); table->setItem(numRows, 2, item); item = new QCheckTableItem(table, ""); item->setChecked(list.contains("unedit")); table->setItem(numRows, 3, item); item = new QCheckTableItem(table, ""); item->setChecked(list.contains("commit")); table->setItem(numRows, 4, item); ++numRows; } return true; }
void AntProjectPart::projectConfigWidget(KDialogBase *dlg) { QVBox *vbox = dlg->addVBoxPage(i18n("Ant Options")); m_antOptionsWidget = new AntOptionsWidget(vbox); m_antOptionsWidget->BuildXML->setURL(m_antOptions.m_buildXML); switch (m_antOptions.m_verbosity) { case AntOptions::Quiet: m_antOptionsWidget->Verbosity->setCurrentItem(0); break; case AntOptions::Verbose: m_antOptionsWidget->Verbosity->setCurrentItem(1); break; default: m_antOptionsWidget->Verbosity->setCurrentItem(2); break; } m_antOptionsWidget->Properties->setNumRows(m_antOptions.m_properties.count()); m_antOptionsWidget->Properties->setNumCols(2); QMap<QString,QString>::Iterator it; int i=0; for (it = m_antOptions.m_properties.begin(); it != m_antOptions.m_properties.end(); ++it) { QCheckTableItem *citem = new QCheckTableItem(m_antOptionsWidget->Properties, it.key()); citem->setChecked(m_antOptions.m_defineProperties[it.key()]); m_antOptionsWidget->Properties->setItem(i,0, citem); QTableItem *item = new QTableItem(m_antOptionsWidget->Properties, QTableItem::WhenCurrent, it.data()); m_antOptionsWidget->Properties->setItem(i,1, item); ++i; } connect(dlg, SIGNAL(okClicked()), this, SLOT(optionsAccepted())); vbox = dlg->addVBoxPage(i18n("Classpath")); m_classPathWidget = new ClassPathWidget(vbox); m_classPathWidget->ClassPath->insertStringList(m_classPath); }