bool IconView::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: slotNewItem((QDropEvent*)static_QUType_ptr.get(_o+1),(const QValueList<QIconDragItem>&)*((const QValueList<QIconDragItem>*)static_QUType_ptr.get(_o+2))); break; default: return QIconView::qt_invoke( _id, _o ); } return TRUE; }
KCustomMenuEditor::KCustomMenuEditor(QWidget *parent) : KDialogBase(parent, "custommenueditor", true, i18n("Menu Editor"), Ok|Cancel, Ok, true), m_listView(0) { d = new KCustomMenuEditorPrivate; QHBox *page = makeHBoxMainWidget(); m_listView = new KListView(page); m_listView->addColumn(i18n("Menu")); m_listView->setFullWidth(true); m_listView->setSorting(-1); KButtonBox *buttonBox = new KButtonBox(page, Vertical); buttonBox->addButton(i18n("New..."), this, SLOT(slotNewItem())); d->pbRemove=buttonBox->addButton(i18n("Remove"), this, SLOT(slotRemoveItem())); d->pbMoveUp=buttonBox->addButton(i18n("Move Up"), this, SLOT(slotMoveUp())); d->pbMoveDown=buttonBox->addButton(i18n("Move Down"), this, SLOT(slotMoveDown())); buttonBox->layout(); connect( m_listView, SIGNAL( selectionChanged () ), this, SLOT( refreshButton() ) ); refreshButton(); }
Settings::CategoryPage::CategoryPage( QWidget* parent ) : QWidget( parent ) { QVBoxLayout* lay1 = new QVBoxLayout(this); QHBoxLayout* lay2 = new QHBoxLayout; lay1->addLayout( lay2 ); _categories = new QListWidget( this ); connect( _categories, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(edit(QListWidgetItem*)) ); lay2->addWidget( _categories ); QGridLayout* lay3 = new QGridLayout; lay2->addLayout( lay3 ); int row = 0; // Text _labelLabel = new QLabel( i18n( "Label:" ), this ); lay3->addWidget( _labelLabel, row, 0 ); _text = new KLineEdit( this ); connect( _text, SIGNAL(textChanged(QString)), this, SLOT(slotLabelChanged(QString)) ); lay3->addWidget( _text, row, 1 ); row++; // Positionable _positionableLabel = new QLabel(i18n("Positionable tags:"), this); lay3->addWidget( _positionableLabel, row, 0 ); _positionable = new QCheckBox( i18n("Coordinates can be added to tags in this category"), this); lay3->addWidget( _positionable, row, 1 ); connect( _positionable, SIGNAL(clicked(bool)), this, SLOT(positionableChanged(bool)) ); row++; // Icon _iconLabel = new QLabel( i18n("Icon:" ), this ); lay3->addWidget( _iconLabel, row, 0 ); _icon = new KIconButton( this ); lay3->addWidget( _icon, row, 1 ); _icon->setIconSize(32); _icon->setIcon( QString::fromLatin1( "personsIcon" ) ); connect( _icon, SIGNAL(iconChanged(QString)), this, SLOT(slotIconChanged(QString)) ); row++; // Thumbnail size _thumbnailSizeInCategoryLabel = new QLabel( i18n( "Thumbnail Size: " ), this ); lay3->addWidget( _thumbnailSizeInCategoryLabel, row, 0 ); _thumbnailSizeInCategory = new QSpinBox; _thumbnailSizeInCategory->setRange( 32, 512 ); _thumbnailSizeInCategory->setSingleStep( 32 ); lay3->addWidget( _thumbnailSizeInCategory, row, 1 ); connect( _thumbnailSizeInCategory, SIGNAL(valueChanged(int)), this, SLOT(thumbnailSizeChanged(int)) ); row++; // Preferred View _preferredViewLabel = new QLabel( i18n("Preferred view:"), this ); lay3->addWidget( _preferredViewLabel, row, 0 ); _preferredView = new KComboBox( this ); lay3->addWidget( _preferredView, row, 1 ); QStringList list; list << i18n("List View") << i18n("List View with Custom Thumbnails") << i18n("Icon View") << i18n("Icon View with Custom Thumbnails"); _preferredView->addItems( list ); connect( _preferredView, SIGNAL(activated(int)), this, SLOT(slotPreferredViewChanged(int)) ); QHBoxLayout* lay4 = new QHBoxLayout; lay1->addLayout( lay4 ); KPushButton* newItem = new KPushButton( i18n("New"), this ); connect( newItem, SIGNAL(clicked()), this, SLOT(slotNewItem()) ); _delItem = new KPushButton( i18n("Delete"), this ); connect( _delItem, SIGNAL(clicked()), this, SLOT(slotDeleteCurrent()) ); lay4->addStretch(1); lay4->addWidget( newItem ); lay4->addWidget( _delItem ); _current = 0; // Untagged images _untaggedBox = new UntaggedGroupBox(this); lay1->addWidget(_untaggedBox); }