void Zone::getSelectedZonelist(TDEListView *listView) { _remotezonelist.clear(); /* loop through all entries */ TQListViewItem *root = listView->firstChild(); while (root) { if (root->firstChild()) { root = root->firstChild(); continue; } TQCheckListItem *cl = (TQCheckListItem*) root; if (cl->isOn()) { _remotezonelist.append(cl->text(2)); } if (root->nextSibling()) { root = root->nextSibling(); continue; } root = root->parent(); if (root) root = root->nextSibling(); } }
void KSim::MonitorPrefs::saveConfig(KSim::Config *config) { TQCheckListItem *item; TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo((*it)); item = static_cast<TQCheckListItem *>(findItem(info.name(), 0)); config->setEnabledMonitor(info.libName(), item->isOn()); config->setMonitorCommand(info.libName(), item->text(2)); config->setMonitorLocation(info.libName(), itemIndex(item)); } }
void KSim::MonitorPrefs::readConfig(KSim::Config *config) { int location; TQCheckListItem *origItem; TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo((*it)); location = config->monitorLocation(info.libName()); origItem = static_cast<TQCheckListItem *>(findItem(info.name(), 0)); origItem->setOn(config->enabledMonitor(info.libName())); origItem->setText(2, config->monitorCommand(info.libName())); if (TQListViewItem *item = itemAtIndex(location)) { if (location) { origItem->moveItem(item->itemAbove()); } else { origItem->moveItem(firstChild()); firstChild()->moveItem(origItem); } } } }
void Zone::readZoneList(TDEListView *listView ) { const KTimezones::ZoneMap zones = m_zoneDb.allZones(); TQMap<TQString, TQListViewItem*> KontinentMap; listView->setRootIsDecorated(true); for (KTimezones::ZoneMap::ConstIterator it = zones.begin(); it != zones.end(); ++it) { const KTimezone *zone = it.data(); TQString tzName = zone->name(); TQString comment = zone->comment(); if (!comment.isEmpty()) comment = i18n(comment.utf8()); const TQStringList KontCity = TQStringList::split("/", i18n(tzName.utf8()).replace("_", " ")); TQListViewItem* Kontinent = KontinentMap[KontCity[0]]; if (!Kontinent) { KontinentMap[KontCity[0]] = new TQListViewItem(listView, KontCity[0]); Kontinent = KontinentMap[KontCity[0]]; Kontinent->setExpandable(true); } TQCheckListItem *li = new TQCheckListItem(Kontinent, KontCity[1], TQCheckListItem::CheckBox); li->setText(1, comment); li->setText(2, tzName); /* store complete path in ListView */ if (_remotezonelist.findIndex(tzName) != -1) li->setOn(true); // locate the flag from /l10n/%1/flag.png // if not available select default "C" flag TQString flag = locate( "locale", TQString("l10n/%1/flag.png").arg(zone->countryCode().lower()) ); if (!TQFile::exists(flag)) flag = locate( "locale", "l10n/C/flag.png" ); if (TQFile::exists(flag)) li->setPixmap(0, TQPixmap(flag)); } }
/////////////////////////////////////////////////////////////////////////// // KateMailDialog implementation /////////////////////////////////////////////////////////////////////////// KateMailDialog::KateMailDialog( TQWidget *parent, KateMainWindow *mainwin ) : KDialogBase( parent, "kate mail dialog", true, i18n("Email Files"), Ok|Cancel|User1, Ok, false, KGuiItem( i18n("&Show All Documents >>") ) ), mainWindow( mainwin ) { setButtonGuiItem( KDialogBase::Ok, KGuiItem( i18n("&Mail..."), "mail-send") ); mw = makeVBoxMainWidget(); mw->installEventFilter( this ); lInfo = new TQLabel( i18n( "<p>Press <strong>Mail...</strong> to email the current document." "<p>To select more documents to send, press <strong>Show All Documents >></strong>."), mw ); // TODO avoid untill needed - later list = new TDEListView( mw ); list->addColumn( i18n("Name") ); list->addColumn( i18n("URL") ); Kate::Document *currentDoc = mainWindow->viewManager()->activeView()->getDoc(); uint n = KateDocManager::self()->documents(); uint i = 0; TQCheckListItem *item; while ( i < n ) { Kate::Document *doc = KateDocManager::self()->document( i ); if ( doc ) { item = new KateDocCheckItem( list, doc->docName(), doc ); item->setText( 1, doc->url().prettyURL() ); if ( doc == currentDoc ) { item->setOn( true ); item->setSelected( true ); } } i++; } list->hide(); connect( this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(slotShowButton()) ); mw->setMinimumSize( lInfo->sizeHint() ); }
void EvaQunMemberPicker::updateBuddyListView() { //if(!mQun) return; lvBuddyList->clear(); TQTextCodec *codec = TQTextCodec::codecForName("GB18030"); std::list<std::string> names = EvaMain::user->getGroupNames(); std::list<std::string>::iterator groupIter; int i=0; for(groupIter = names.begin(); groupIter!= names.end(); ++groupIter){ TQString g = codec->toUnicode(groupIter->c_str()); TQCheckListItem *item = new TQCheckListItem(lvBuddyList, g, TQCheckListItem::CheckBox); item->setState(TQCheckListItem::Off); groups[i++] = item; } //QunInfo info = mQun->getDetails(); std::map<unsigned int, TQQFriend>::iterator iter; std::map<unsigned int, TQQFriend> list = (EvaMain::user->getFriendList()).getAllFriendsMap(); for(iter = list.begin(); iter != list.end(); ++iter){ int id = iter->second.getQQ(); TQString nick = EvaTextFilter::filter(codec->toUnicode(iter->second.getNick().c_str())); int groupIndex = iter->second.getGroupIndex(); TQCheckListItem *group = groups[groupIndex]; if(!group) continue; short faceID = (iter->second.getFace())/3 + 1; if(faceID<1) faceID = 1; TQCheckListItem *item = new TQCheckListItem(group, nick + "(" + TQString::number(id) + ")", TQCheckListItem::CheckBox); TQPixmap *pic = EvaMain::images->getFace(faceID, true); if(pic) { TQImage img(pic->convertToImage().smoothScale(16, 16)); item->setPixmap(0, TQPixmap(img)); }else{ fprintf(stderr, "EvaQunMemberPicker::updateBuddyListView (id:%d, faceID:%d, %s) -- NULL TQPixmap pointer, ignored!\n", id, faceID, nick.ascii()); } if(mQun && mQun->hasMember(id)) item->setState(TQCheckListItem::On); else item->setState(TQCheckListItem::Off); buddyList[id] = item; } }
void EvaQunMemberPicker::slotClicked(TQListViewItem *item) { if(!item) return; TQCheckListItem *chkItem = dynamic_cast<TQCheckListItem *>(item); if(!chkItem) return; unsigned int id; TQString txt; TQString strID; bool ok; TQString nick; TQPixmap face; TQCheckListItem *child = dynamic_cast<TQCheckListItem *>(chkItem->firstChild()); if(!child){ txt = chkItem->text(0); int index = txt.findRev("("); nick = txt.left( index ); strID = txt.mid(index+1, txt.length() - index - 1 - 1); id = strID.toUInt(&ok); if(!ok) return; face = *(chkItem->pixmap(0)); emit memberClicked(id, chkItem->isOn()); } while(child){ child->setOn(chkItem->isOn()); txt = child->text(0); int index = txt.findRev("("); nick = txt.left( index ); strID = txt.mid(index+1, txt.length() - index - 1 - 1); id = strID.toUInt(&ok); if(!ok) return; face = *(child->pixmap(0)); emit memberClicked(id, child->isOn()); child = dynamic_cast<TQCheckListItem *>(child->nextSibling()); } }
CpuConfig::CpuConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { TQVBoxLayout * mainLayout = new TQVBoxLayout( this ); mainLayout->setSpacing( 6 ); m_listView = new TDEListView(this); m_listView->addColumn(i18n("Available CPUs")); m_listView->addColumn(i18n("Chart Format")); m_listView->setAllColumnsShowFocus(true); m_listView->setSelectionMode(TQListView::Single); connect( m_listView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), TQT_SLOT( modify( TQListViewItem * ) ) ); mainLayout->addWidget( m_listView ); TQHBoxLayout * layout = new TQHBoxLayout; layout->setSpacing( 6 ); TQSpacerItem * spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout->addItem(spacer); m_modify = new TQPushButton( this ); m_modify->setText( i18n( "Modify..." ) ); connect( m_modify, TQT_SIGNAL( clicked() ), TQT_SLOT( modify() ) ); layout->addWidget( m_modify ); mainLayout->addLayout( layout ); m_legendBox = new TQGroupBox(this); m_legendBox->setColumnLayout(0, Qt::Vertical); m_legendBox->setTitle(i18n("Chart Legend")); m_legendBox->layout()->setSpacing(0); m_legendBox->layout()->setMargin(0); m_legendLayout = new TQVBoxLayout(m_legendBox->layout()); m_legendLayout->setAlignment(TQt::AlignTop); m_legendLayout->setSpacing(6); m_legendLayout->setMargin(11); m_totalNiceLabel = new TQLabel(i18n("%T - Total CPU time (sys + user + nice)"), m_legendBox); m_legendLayout->addWidget(m_totalNiceLabel); m_totalLabel = new TQLabel(i18n("%t - Total CPU time (sys + user)"), m_legendBox); m_legendLayout->addWidget(m_totalLabel); m_sysLabel = new TQLabel(i18n("%s - Total sys time"), m_legendBox); m_legendLayout->addWidget(m_sysLabel); m_userLabel = new TQLabel(i18n("%u - Total user time"), m_legendBox); m_legendLayout->addWidget(m_userLabel); m_niceLabel = new TQLabel(i18n("%n - Total nice time"), m_legendBox); m_legendLayout->addWidget(m_niceLabel); mainLayout->addWidget( m_legendBox ); for (uint i = 0; i < addCpus(); ++i) { TQCheckListItem *item = new TQCheckListItem(m_listView, i18n("cpu %1").arg(i), TQCheckListItem::CheckBox); item->setText(1, "%T"); } }