Esempio n. 1
0
//
// Get selected channels from channel list view and set them
// to the slider's channel list. Used for both level & submaster modes.
//
void VCDockSliderProperties::extractChannels()
{
  QCheckListItem* item = NULL;
  t_channel ch = 0;
  
  //
  // Clear channel list
  //
  m_slider->channels()->clear();
  
  //
  // Then, add the new submaster channels
  //
  QListViewItemIterator it(m_channelList);
  while (it.current())
    {
      item = static_cast<QCheckListItem*> (it.current());
      
      ch = static_cast<t_channel> 
	(item->text(KColumnDMXChannel).toInt() - 1);
      
      if (item->isOn() && 
	  m_slider->channels()->find(ch) == m_slider->channels()->end())
	{
	  m_slider->channels()->append(ch);
	}
      
      ++it;
    }
}
Esempio n. 2
0
    void editDynamicPlaylist( QWidget* parent, DynamicMode* mode )
    {
        DEBUG_BLOCK
        KDialogBase* dialog = basicDialog( parent );
        NewDynamic*  nd     = static_cast<NewDynamic*>(dialog->mainWidget());

        nd->m_name->setText( mode->title() );
        nd->m_cycleTracks->setChecked( mode->cycleTracks() );
        nd->m_markHistory->setChecked( mode->markHistory() );
        nd->m_upcomingIntSpinBox->setValue( mode->upcomingCount() );
        nd->m_previousIntSpinBox->setValue( mode->previousCount() );
        nd->m_appendCountIntSpinBox->setValue( mode->appendCount() );

        if( mode->appendType() == DynamicMode::CUSTOM )
        {
            //check items in the custom playlist
            nd->m_mixLabel->setText( i18n("Edit Dynamic Playlist") );
            QStringList items = mode->items();
            foreach( items )
            {
                QCheckListItem* current = static_cast<QCheckListItem*>( nd->selectPlaylist->findItem((*it),0) );
                if( current )
                    current->setOn(true);
            }
        }
Esempio n. 3
0
 void EntryWidgetKeyword::slotKeywordRenamed( QListViewItem * item, const QString & text, int /*col*/ )
 {
     KeywordListViewItem *kwlvi = dynamic_cast<KeywordListViewItem*>( item );
     if ( text.isEmpty() )
     {
         item->setText( 0, m_beforeRenaming );
         kwlvi->setOn( FALSE );
     }
     else if ( text != m_beforeRenaming )
     {
         if ( m_availableKeywords.contains( text ) )
         {
             item->setText( 0, m_beforeRenaming );
             KMessageBox::error( this, QString( i18n( "The keyword '%1' does already exist in the list of keywords.\nThe old name has been restored." ) ).arg( text ), i18n( "Renaming keyword failed" ) );
         }
         else
         {
             m_availableKeywords.remove( m_beforeRenaming );
             m_availableKeywords.append( text );
             if ( kwlvi->isGlobal() )
             {
                 m_globalKeywords.remove( m_beforeRenaming );
                 m_globalKeywords.append( text );
             }
             else
             {
                 m_fileKeywords.remove( m_beforeRenaming );
                 m_fileKeywords.append( text );
             }
             QCheckListItem *checkedItem = dynamic_cast<QCheckListItem*>( item );
             if ( checkedItem != NULL )
                 checkedItem->setOn( TRUE );
         }
     }
 }
Esempio n. 4
0
void ResourceKABCConfig::loadSettings(KRES::Resource *resource)
{
    ResourceKABC *res = static_cast<ResourceKABC *>(resource);
    if(res)
    {
        mAlarm->setChecked(res->alarm());
        QString days;
        mAlarmTimeEdit->setText(days.setNum(res->alarmDays()));

        mAlarmTimeEdit->setEnabled(res->alarm());
        mALabel->setEnabled(res->alarm());

        const QStringList categories = res->categories();
        QListViewItemIterator it(mCategoryView);
        while(it.current())
        {
            if(categories.contains(it.current()->text(0)))
            {
                QCheckListItem *item = static_cast<QCheckListItem *>(it.current());
                item->setOn(true);
            }
            ++it;
        }

        mUseCategories->setChecked(res->useCategories());
    }
    else
    {
        kdDebug(5700) << "ERROR: ResourceKABCConfig::loadSettings(): no ResourceKABC, cast failed" << endl;
    }
}
void KMail::ManageSieveScriptsDialog::slotRefresh()
{
    killAllJobs();
    mUrls.clear();
    mListView->clear();

    KMail::AccountManager *am = kmkernel->acctMgr();
    assert(am);
    QCheckListItem *last = 0;
    for(KMAccount *a = am->first() ; a ; a = am->next())
    {
        last = new QCheckListItem(mListView, last, a->name(), QCheckListItem::Controller);
        last->setPixmap(0, SmallIcon("server"));
        if(ImapAccountBase *iab = dynamic_cast<ImapAccountBase *>(a))
        {
            const KURL u = ::findUrlForAccount(iab);
            if(u.isEmpty())
                continue;
            SieveJob *job = SieveJob::list(u);
            connect(job, SIGNAL(item(KMail::SieveJob *, const QString &, bool)),
                    this, SLOT(slotItem(KMail::SieveJob *, const QString &, bool)));
            connect(job, SIGNAL(result(KMail::SieveJob *, bool, const QString &, bool)),
                    this, SLOT(slotResult(KMail::SieveJob *, bool, const QString &, bool)));
            mJobs.insert(job, last);
            mUrls.insert(last, u);
        }
        else
        {
            QListViewItem *item = new QListViewItem(last, i18n("No Sieve URL configured"));
            item->setEnabled(false);
            last->setOpen(true);
        }
    }
Esempio n. 6
0
void MainWindow::loadPackageList( OPackageList *packages, bool clearList )
{
    if ( clearList )
        m_packageList.clear();

    if ( packages )
    {
        for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt )
        {
            OPackage *package = packageIt.current();
            QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(),
                                                    QCheckListItem::CheckBox );
            m_packageList.insertItem( item );

            // If a different version of package is available, show update available icon
            // Otherwise, show installed icon
            if ( !package->versionInstalled().isNull() )
            {
                if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 )
                    item->setPixmap( 0, m_iconUpdated );
                else
                    item->setPixmap( 0, m_iconInstalled );
            }
            else
                item->setPixmap( 0, m_iconNull );
        }
    }
}
bool PreferencesDialog::isStudyLanguageSelectionValid() const {
    int checkedLangCount = 0;
    for( QCheckListItem* item = (QCheckListItem*)studyLanguagesListView->firstChild(); item; item = (QCheckListItem*)item->nextSibling() ) {
        if( item->isOn() )
            checkedLangCount++;
    }
    return( checkedLangCount >= 2 );
}
Esempio n. 8
0
QStringList CheckedListView::checked() const
{
    QStringList strs;
    for ( QCheckListItem *i = (QCheckListItem *) firstChild();
	  i; i = (QCheckListItem *)i->nextSibling() )
	if ( i->isOn() )
	    strs += i->text( 0 );
    return strs;
}
Esempio n. 9
0
//
// Initialize the channel list view for level & submaster modes
//
void VCDockSliderProperties::fillChannelList()
{
  QString s;
  t_channel ch;
  t_channel channels;
  QCheckListItem* item = NULL;

  //
  // Fill the list view with available channels. Put only
  // those channels that are occupied by existing devices.
  //
  for (t_device_id i = 0; i < KDeviceArraySize; i++)
    {
      Device* d = _app->doc()->device(i);
      if (!d)
	{
	  continue;
	}
      else
	{
	  channels = (t_channel) d->deviceClass()->channels()->count();

	  for (ch = 0; ch < channels; ch++)
	    {
	      // DMX Channel
	      s.sprintf("%.3d", d->address() + ch + 1);
	      item = new QCheckListItem(m_channelList, s, 
					QCheckListItem::CheckBox);
	      
	      // Device name
	      item->setText(KColumnDevice, d->name());

	      // Device channel
	      s.sprintf("%.3d:" + 
			d->deviceClass()->channels()->at(ch)->name(), ch + 1);
	      item->setText(KColumnDeviceChannel, s);
	    }
	}
    }

  //
  // Check those channels that are found from slider's channel list
  //
  QValueList <t_channel>::iterator it;
  for (it = m_slider->channels()->begin();
       it != m_slider->channels()->end(); ++it)
    {
      s.sprintf("%.3d", (*it) + 1);
      item = static_cast<QCheckListItem*> (m_channelList
					   ->findItem(s, KColumnDMXChannel));
      if (item)
	{
	  item->setOn(true);
	}
    }
}
Esempio n. 10
0
void KPrPgConfDia::deselectAllSlides()
{
    QListViewItem *item = slides->firstChild();
    while( item )
    {
        QCheckListItem *checkItem = dynamic_cast<QCheckListItem*>( item );
        if( checkItem ) checkItem->setOn( false );
        item = item->nextSibling();
    }
}
Esempio n. 11
0
void SensorsConfig::invertSelect()
{
  for (QListViewItemIterator it(m_sensorView); it.current(); ++it) {
    QCheckListItem *item = static_cast<QCheckListItem *>(it.current());
    if (item->isOn())
      item->setOn(false);
    else
      item->setOn(true);
  }
}
Esempio n. 12
0
void OListEditForm::addCheckItem( bool isActive, const QString &str )
{
    QCheckListItem *item = NULL;
    QListViewItem *lastItem = m_listView->lastItem();
    if( lastItem )
        item = new QCheckListItem( m_listView, lastItem, str, QCheckListItem::CheckBox );
    else
        item = new QCheckListItem( m_listView, str, QCheckListItem::CheckBox );

    if( item )
        item->setOn( isActive );
}
Esempio n. 13
0
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
	: KDialogBase( parent, "Linker Options Dialog", true, "Linker Options", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
{
	m_pLinkerOptions = linkingOptions;
	m_pWidget = new LinkerOptionsWidget(this);
	
	ProjectInfo * pi = ProjectManager::self()->currentProject();
	assert(pi);
	
	
	//BEGIN Update gplink options
	m_pWidget->m_pHexFormat->setCurrentItem( m_pLinkerOptions->hexFormat() );
	m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
	m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
	m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
	m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
	//END Update gplink options
	
	
	
	//BEGIN Update library widgets
	const KURL::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
	const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
	
	KURL::List::const_iterator end = availableInternal.end();
	for ( KURL::List::const_iterator it = availableInternal.begin(); it != end; ++it )
	{
		QString relativeURL = KURL::relativeURL( pi->url(), *it );
		QCheckListItem * item = new QCheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, QCheckListItem::CheckBox );
		item->setOn( linkedInternal.contains(relativeURL) );
	}
	
	m_pExternalLibraryRequester = new KURLRequester( 0l );
	m_pExternalLibraryRequester->fileDialog()->setURL( "/usr/share/sdcc/lib" );
	
	delete m_pWidget->m_pExternalLibraries;
	m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
	m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
	(dynamic_cast<QGridLayout*>(m_pWidget->layout()))->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 );
	
#if defined(KDE_MAKE_VERSION)
# if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
	m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
# endif
#endif
	m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
	//END Update library widgets
	
	
	setMainWidget( m_pWidget );
	setInitialSize( m_pWidget->rect().size() );
}
Esempio n. 14
0
QCheckListItem* VCSliderProperties::levelFixtureNode(t_fixture_id id)
{
	QCheckListItem* item = NULL;

	for (item = static_cast<QCheckListItem*> (m_levelList->firstChild());
	     item != NULL;
	     item = static_cast<QCheckListItem*> (item->nextSibling()))
	{
		if (item->text(KColumnID).toInt() == id)
			return item;
	}

	return NULL;
}
Esempio n. 15
0
QStringList OListEditForm::activeItemLabels() const
{
    QStringList activeItemLabelList;
    for( QCheckListItem *item = (QCheckListItem*)m_listView->firstChild();
         item;
         item = (QCheckListItem*)item->nextSibling() )
    {
        if( item->isOn() )
        {
            activeItemLabelList << item->text( 0 );
        }
    }
    return activeItemLabelList;
}
Esempio n. 16
0
QCheckListItem* VCSliderProperties::levelChannelNode(QCheckListItem* parent,
						     t_channel ch)
{
	QCheckListItem* item = NULL;

	for (item = static_cast<QCheckListItem*> (parent->firstChild());
	     item != NULL;
	     item = static_cast<QCheckListItem*> (item->nextSibling()))
	{
		if (item->text(KColumnID).toInt() == ch)
			return item;
	}

	return NULL;
}
Esempio n. 17
0
QValueList<bool> KPrPgConfDia::getSelectedSlides() const
{
    QValueList<bool> selectedSlides;

    QListViewItem *item = slides->firstChild();
    while( item )
    {
        QCheckListItem *checkItem = dynamic_cast<QCheckListItem*>( item );
        bool selected = false;
        if( checkItem ) selected = checkItem->isOn();
        item = item->nextSibling();
        selectedSlides.append( selected );
    }
    return selectedSlides;
}
Esempio n. 18
0
void KPluginSelectionWidget::executed(QListViewItem *item)
{
    kdDebug(702) << k_funcinfo << endl;
    if(item == 0)
        return;

    // Why not a dynamic_cast? - Martijn
    // because this is what the Qt API suggests; and since gcc 3.x I don't
    // trust dynamic_cast anymore - mkretz
    if(item->rtti() != 1) // check for a QCheckListItem
        return;

    QCheckListItem *citem = static_cast< QCheckListItem * >(item);
    bool checked = citem->isOn();
    // kdDebug( 702 ) << "it's a " << ( checked ? "checked" : "unchecked" )
    //    << " QCheckListItem" << endl;

    KPluginInfo *info = d->pluginInfoMap[citem];
    Q_ASSERT(!info->isHidden());

    if(info->isPluginEnabled() != checked)
    {
        kdDebug(702) << "Item changed state, emitting changed()" << endl;

        if(!d->plugincheckedchanged[info])
        {
            ++d->changed;
            if(d->changed == 1)
                emit changed(true);
        }
        d->plugincheckedchanged[info] = true;

        checkDependencies(info);
    }
    else
    {
        if(d->plugincheckedchanged[info])
        {
            --d->changed;
            if(d->changed == 0)
                emit changed(false);
        }
        d->plugincheckedchanged[info] = false;
        // FIXME: plugins that depend on this plugin need to be disabled, too
    }

    updateConfigPage(info, checked);
}
Esempio n. 19
0
void MainWindow::slotDownload()
{
    // Retrieve list of packages selected for download (if any)
    QStringList workingPackages;

    for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild());
          item != 0 ;
          item = static_cast<QCheckListItem *>(item->nextSibling()) )
    {
        if ( item->isOn() )
            workingPackages.append( item->text() );
    }

    if ( workingPackages.isEmpty() )
    {
        QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) );
        return;
    }
    else
    {
        // Download selected packages
        m_config.setGroup( "settings" );
        QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" );

        bool ok = false;
        QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this );
        if ( ok && !text.isEmpty() )
            workingDir = text;   // user entered something and pressed ok
        else
            return; // user entered nothing or pressed cancel

        // Store download directory in config file
        m_config.writeEntry( "DownloadDir", workingDir );

        // Get starting directory
        QDir::setCurrent( workingDir );

        // Create package manager output widget
        InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ),
                                          OPackage::Download, workingPackages );
        connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );

        // Display widget
        m_widgetStack.addWidget( dlg, 3 );
        m_widgetStack.raiseWidget( dlg );
    }
}
Esempio n. 20
0
	const QStringList & Clean::getCleanlist()
	{
		QStringList templist;

		QCheckListItem *item = (QCheckListItem *)listview->firstChild();
		int i = m_extlist.count() - 1;
		while ( item )
		{
			if ( item->isOn() && item->text(0).endsWith(m_extlist[i]) )
				templist.append(m_extlist[i]);

			item = (QCheckListItem *)item->nextSibling();
			--i;
		}

		m_extlist = templist;
		return m_extlist;
	}
Esempio n. 21
0
void CheckedListView::setChecked( const QStringList &checked )
{
    // iterate over all items
    bool showingChecked = FALSE;
    for ( QCheckListItem *i = (QCheckListItem *) firstChild();
	  i; i = (QCheckListItem *)i->nextSibling() )
	// see if the item should be checked by searching the
	// checked list
	if ( checked.find( i->text( 0 ) ) != checked.end() ) {
	   i->setOn( TRUE );
	   // make sure it is showing at least one checked item
	   if ( !showingChecked ) {
	       ensureItemVisible( i );
	       showingChecked = TRUE;
	   }
	}
       else
	   i->setOn( FALSE );
}
Esempio n. 22
0
void LinkerOptionsDlg::accept()
{
	hide();
	
	QStringList linkedInternal;
	for ( QListViewItemIterator internalIt( m_pWidget->m_pInternalLibraries ); internalIt.current(); ++internalIt )
	{
		QCheckListItem * item = static_cast<QCheckListItem*>(internalIt.current());
		if ( item->isOn() )
			linkedInternal << item->text();
	}
	m_pLinkerOptions->setLinkedInternal( linkedInternal );
	
	m_pLinkerOptions->setLinkedExternal( m_pWidget->m_pExternalLibraries->items() );
	m_pLinkerOptions->setHexFormat( (LinkerOptions::HexFormat::type) m_pWidget->m_pHexFormat->currentItem() );
	m_pLinkerOptions->setOutputMapFile( m_pWidget->m_pOutputMap->isChecked() );
	m_pLinkerOptions->setLibraryDir( m_pWidget->m_pLibraryDir->text() );
	m_pLinkerOptions->setLinkerScript( m_pWidget->m_pLinkerScript->text() );
	m_pLinkerOptions->setLinkerOther( m_pWidget->m_pOther->text() );
}
Esempio n. 23
0
void VCSliderProperties::levelUpdateFixtureNode(t_fixture_id id)
{
	Fixture* fxi = NULL;
	QCheckListItem* item = NULL;
	QString str;

	fxi = _app->doc()->fixture(id);
	Q_ASSERT(fxi != NULL);

	item = levelFixtureNode(id);
	if (item == NULL)
		item = new QCheckListItem(m_levelList, fxi->name(),
					  QCheckListItem::CheckBoxController);

	item->setText(KColumnType, fxi->type());
	str.setNum(id);
	item->setText(KColumnID, str);

	levelUpdateChannels(item, fxi);
}
Esempio n. 24
0
void MainWindow::searchForPackage( const QString &text )
{
    if ( !text.isEmpty() )
    {
        // look through package list for text startng at current position
        QCheckListItem *start = static_cast<QCheckListItem *>(m_packageList.currentItem());
        if ( start == 0 )
            start = static_cast<QCheckListItem *>(m_packageList.firstChild());

//        for ( QCheckListItem *item = static_cast<QCheckListItem *>(start->nextSibling()); item != 0 ;
        for ( QCheckListItem *item = static_cast<QCheckListItem *>(start); item != 0 ;
              item = static_cast<QCheckListItem *>(item->nextSibling()) )
        {
            if ( item->text().lower().find( text ) != -1 )
            {
                m_packageList.ensureItemVisible( item );
                m_packageList.setCurrentItem( item );
                break;
            }
        }
    }
}
Esempio n. 25
0
void KPluginSelectionWidget::init(const QValueList< KPluginInfo * > &plugininfos, const QString &category)
{
    // setup Widgets
    (new QVBoxLayout(this, 0, KDialog::spacingHint()))->setAutoAdd(true);
    KListView *listview = new KListView(this);
    d->tooltip = new KPluginListViewToolTip(listview->viewport(), listview);
    connect(listview, SIGNAL(pressed(QListViewItem *)), this, SLOT(executed(QListViewItem *)));
    connect(listview, SIGNAL(spacePressed(QListViewItem *)), this, SLOT(executed(QListViewItem *)));
    connect(listview, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(executed(QListViewItem *)));
    connect(listview, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(executed(QListViewItem *)));
    listview->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
    listview->setAcceptDrops(false);
    listview->setFullWidth(true);
    listview->setSelectionModeExt(KListView::Single);
    listview->setAllColumnsShowFocus(true);
    listview->addColumn(i18n("Name"));
    for(QValueList< KPluginInfo * >::ConstIterator it = plugininfos.begin(); it != plugininfos.end(); ++it)
    {
        d->plugincheckedchanged[*it] = false;
        if(!(*it)->isHidden() && (category.isNull() || (*it)->category() == category))
        {
            QCheckListItem *item = new KPluginInfoLVI(*it, listview);
            if(!(*it)->icon().isEmpty())
                item->setPixmap(0, SmallIcon((*it)->icon(), IconSize(KIcon::Small)));
            item->setOn((*it)->isPluginEnabled());
            d->pluginInfoMap.insert(item, *it);
        }
    }

    // widgetstack
    d->widgetstack = d->kps->widgetStack();
    load();
    // select and highlight the first item in the plugin list
    if(listview->firstChild())
        listview->setSelected(listview->firstChild(), true);
}
Esempio n. 26
0
void VCSliderProperties::levelUpdateChannelNode(QCheckListItem* parent,
						Fixture* fxi,
						t_channel ch)
{
	QCheckListItem* item = NULL;
	QLCChannel* channel = NULL;
	QString str;

	Q_ASSERT(parent != NULL);

	channel = fxi->channel(ch);
	Q_ASSERT(channel != NULL);

	item = levelChannelNode(parent, ch);
	if (item == NULL)
		item = new QCheckListItem(parent, channel->name(),
					  QCheckListItem::CheckBox);

	item->setText(KColumnType, channel->group());
	str.setNum(ch);
	item->setText(KColumnID, str);

	levelUpdateCapabilities(item, channel);
}
Esempio n. 27
0
	Clean::Clean(QWidget *parent, const QString & filename, const QStringList & extlist) : 
		KDialogBase( KDialogBase::Plain, i18n("Delete Files"), Ok | Cancel, Ok, parent, 0, true, true),
		m_extlist(extlist)
	{
		// Layout
		QVBoxLayout *vbox = new QVBoxLayout(plainPage(), 6,6 );
		
		// label widgets
		QWidget *labelwidget = new QWidget(plainPage());
		QHBoxLayout *labellayout = new QHBoxLayout(labelwidget);
		
		// line 1: picture and label
		QLabel *picture =  new QLabel("", labelwidget);
		picture->setPixmap( KGlobal::instance()->iconLoader()->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium) );
		QLabel *label =  new QLabel(i18n( "Do you really want to delete these files?" ), labelwidget);
		labellayout->addWidget(picture);
		labellayout->addSpacing(20);
		labellayout->addWidget(label);
		
		// line 2: listview
		listview = new KListView(plainPage());
		listview->addColumn(i18n("Files"));
		listview->setSorting(-1);
		
		// insert items into listview
		QString base = QFileInfo(filename).baseName(true);
		for (uint i=0; i <  m_extlist.count(); ++i)
		{
			QCheckListItem *item = new QCheckListItem(listview, base + m_extlist[i], QCheckListItem::CheckBox);
			item->setOn(true);
			listview->insertItem(item);
		}

		vbox->addWidget(labelwidget,0,Qt::AlignHCenter);
		vbox->addWidget(listview);
	}
Esempio n. 28
0
void VCSliderProperties::levelSelectChannelsByGroup(QString group)
{
	QCheckListItem* fxiNode = NULL;
	QCheckListItem* chNode = NULL;

	for (fxiNode = static_cast<QCheckListItem*> (m_levelList->firstChild());
	     fxiNode != NULL;
	     fxiNode = static_cast<QCheckListItem*> (fxiNode->nextSibling()))
	{
		for (chNode = static_cast<QCheckListItem*> (fxiNode->firstChild());
		     chNode != NULL;
		     chNode = static_cast<QCheckListItem*> (chNode->nextSibling()))
		{
			if (chNode->text(KColumnType) == group)
				chNode->setOn(true);
			else
				chNode->setOn(false);
		}
	}
}
Esempio n. 29
0
void EvaQunMemberPicker::updateBuddyListView()
{
	//if(!mQun) return;
	lvBuddyList->clear();
	
	QTextCodec *codec = QTextCodec::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){
		QString g = codec->toUnicode(groupIter->c_str());
		QCheckListItem *item = new QCheckListItem(lvBuddyList, g, QCheckListItem::CheckBox);
		item->setState(QCheckListItem::Off);
		groups[i++] = item;
	}
	
	//QunInfo info = mQun->getDetails();
	
	std::map<unsigned int, QQFriend>::iterator iter;
	std::map<unsigned int, QQFriend> list = (EvaMain::user->getFriendList()).getAllFriendsMap();
	for(iter = list.begin(); iter != list.end(); ++iter){
	
		int id = iter->second.getQQ();
		QString nick = EvaTextFilter::filter(codec->toUnicode(iter->second.getNick().c_str()));
		
		int groupIndex = iter->second.getGroupIndex();
		QCheckListItem *group = groups[groupIndex];
		if(!group) continue;
		
		short faceID = (iter->second.getFace())/3 + 1;
		if(faceID<1) faceID = 1;
		QCheckListItem *item = new QCheckListItem(group, nick + "(" + QString::number(id) + ")", QCheckListItem::CheckBox);

		QPixmap *pic = EvaMain::images->getFace(faceID, true);
		if(pic) {
			QImage img(pic->convertToImage().smoothScale(16, 16));
			item->setPixmap(0, QPixmap(img));
		}else{
			fprintf(stderr, "EvaQunMemberPicker::updateBuddyListView (id:%d, faceID:%d, %s) --  NULL QPixmap pointer, ignored!\n", id, faceID, nick.ascii());
		}
		if(mQun && mQun->hasMember(id))
			item->setState(QCheckListItem::On);
		else
			item->setState(QCheckListItem::Off);
			
		buddyList[id] = item;
	}
}
Esempio n. 30
0
void KPrPgConfDia::setupPageSlides()
{
    QFrame* slidesPage = addPage( i18n("&Slides") );
    QWhatsThis::add( slidesPage, i18n("<p>This dialog allows you to configure which slides "
				      "are used in the presentation. Slides that are not "
				      "selected will not be displayed during the slide "
				      "show.</p>") );
    QGridLayout *slidesLayout = new QGridLayout( slidesPage,7 , 2, 0, KDialog::spacingHint());


    QButtonGroup *group=new QVButtonGroup( slidesPage );
    group->setRadioButtonExclusive( true );

    m_customSlide = new QRadioButton( i18n( "Custom slide show" ), group, "customslide" );

    connect( m_customSlide, SIGNAL( clicked () ), this, SLOT( radioButtonClicked() ) );

    QHBox *box = new QHBox( group );

    m_labelCustomSlide = new QLabel( i18n( "Custom slide:" ),box );

    m_customSlideCombobox = new QComboBox( box );
    m_customSlideCombobox->insertStringList( m_doc->presentationList() );

    m_selectedSlide = new QRadioButton( i18n( "Selected pages:" ), group, "selectedslide" );
    slidesLayout->addMultiCellWidget( group, 0,2,0,1 );
    connect( m_selectedSlide, SIGNAL( clicked () ), this, SLOT( radioButtonClicked() ) );

    slides = new QListView( slidesPage );
    slidesLayout->addMultiCellWidget( slides, 3, 3, 0, 1 );
    slidesLayout->setRowStretch( 3, 10 );
    slides->addColumn( i18n("Slide") );
    slides->setSorting( -1 );
    slides->header()->hide();

    for ( int i = m_doc->getPageNums() - 1; i >= 0; --i )
    {
        KPrPage *page=m_doc->pageList().at( i );
        QCheckListItem* item = new QCheckListItem( slides,
                                                   page->pageTitle(),
                                                   QCheckListItem::CheckBox );
        item->setOn( page->isSlideSelected() );
    }

    QHBox* buttonGroup = new QHBox( slidesPage );
    buttonGroup->setSpacing( KDialog::spacingHint() );

    QPushButton* selectAllButton = new QPushButton( i18n( "Select &All" ), buttonGroup );
    connect( selectAllButton, SIGNAL( clicked() ), this, SLOT( selectAllSlides() ) );

    QPushButton* deselectAllButton = new QPushButton( i18n( "&Deselect All" ), buttonGroup );
    connect( deselectAllButton, SIGNAL( clicked() ), this, SLOT( deselectAllSlides() ) );

    QWidget* spacer = new QWidget( buttonGroup );

    spacer->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
    slidesLayout->addMultiCellWidget( buttonGroup, 4, 4, 0, 1 );

    if ( !m_doc->presentationName().isEmpty() )
    {
        m_customSlide->setChecked( true );
        m_customSlideCombobox->setCurrentText( m_doc->presentationName() );
    }
    else
        m_selectedSlide->setChecked( true );

    if ( m_customSlideCombobox->count()==0 )
    {
        m_customSlide->setEnabled( false );
        m_labelCustomSlide->setEnabled( false );
        m_customSlideCombobox->setEnabled( false );
    }
    radioButtonClicked();
}