ReplaceDialog::ReplaceDialog( const QList<TReplaceItem> & items, QWidget* parent ) : QDialog( parent ) { m_widget.setupUi( this ); connect(m_widget.buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_widget.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(m_widget.buttonAdd, SIGNAL(clicked(bool)), SLOT(slotAdd())); connect(m_widget.buttonRemove, SIGNAL(clicked(bool)), SLOT(slotRemove())); connect(m_widget.buttonEdit, SIGNAL(clicked(bool)), SLOT(slotEdit())); connect(m_widget.buttonLoadList, SIGNAL(clicked(bool)), SLOT(slotLoadList())); connect(m_widget.buttonSaveList, SIGNAL(clicked(bool)), SLOT(slotSaveList())); connect(m_widget.list, SIGNAL(itemSelectionChanged()), SLOT(slotEnableControls())); this->slotEnableControls(); QList<TReplaceItem>::const_iterator it = items.begin(); while( it != items.end() ) { int row = m_widget.list->rowCount(); m_widget.list->setRowCount( row + 1 ); m_widget.list->setItem( row, 0, this->createTableItem( "", true ) ); m_widget.list->item( row, 0 )->setCheckState( (*it).reg ? Qt::Checked : Qt::Unchecked ); m_widget.list->setItem( row, 1, this->createTableItem( (*it).find ) ); m_widget.list->setItem( row, 2, this->createTableItem( (*it).replace ) ); m_widget.list->setItem( row, 3, this->createTableItem( "", true ) ); m_widget.list->item( row, 3 )->setCheckState( (*it).doProcessTokens ? Qt::Checked : Qt::Unchecked ); ++it; } }
void KRenameWindow::showPage(int index) { if (index >= 0 && index < m_guiMode->numPages) { m_curPage = index; m_stack->setCurrentIndex(m_guiMode->mapIndex[index]); slotEnableControls(); } }
void KRenameWindow::setupGui() { m_buttons->clear(); m_guiMode = &tAdvancedMode; m_buttonFinish = new QPushButton(QIcon::fromTheme(QStringLiteral("dialog-ok")), i18n("&Finish")); m_buttons->setStandardButtons(QDialogButtonBox::Help | QDialogButtonBox::Close); m_buttons->addButton(m_buttonFinish, QDialogButtonBox::AcceptRole); m_buttonClose = m_buttons->button(QDialogButtonBox::Close); m_buttonClose->setShortcut(QKeySequence(QKeySequence::Quit)); KHelpMenu *helpMenu = new KHelpMenu(this); m_buttons->button(QDialogButtonBox::Help)->setMenu(helpMenu->menu()); setupSlots(); slotEnableControls(); }