Пример #1
0
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());
	}
}
Пример #2
0
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);
      }
    }
  }
}
Пример #3
0
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));
  }
}
Пример #4
0
///////////////////////////////////////////////////////////////////////////
// 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&nbsp;&gt;&gt;</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() );
}