diff --git a/debuggers/common/dialogs/processselection.h b/debuggers/common/dialogs/processselection.h --- a/debuggers/common/dialogs/processselection.h +++ b/debuggers/common/dialogs/processselection.h @@ -42,7 +42,7 @@ private: KSysGuardProcessList* m_processList; - QPushButton* m_okButton; + QPushButton* m_attachButton; }; } // end of namespace KDevMI diff --git a/debuggers/common/dialogs/processselection.cpp b/debuggers/common/dialogs/processselection.cpp --- a/debuggers/common/dialogs/processselection.cpp +++ b/debuggers/common/dialogs/processselection.cpp @@ -46,7 +46,7 @@ QVBoxLayout* mainLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->addWidget(m_processList); - QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); + QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); mainLayout->addWidget(buttonBox); connect(m_processList->treeView()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged())); @@ -56,11 +56,13 @@ m_processList->filterLineEdit()->setFocus(); //m_processList->setPidFilter(qApp->pid()); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - m_okButton = buttonBox->button(QDialogButtonBox::Ok); - m_okButton->setDefault(true); - m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - m_okButton->setEnabled(false); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + m_attachButton = buttonBox->button(QDialogButtonBox::Ok); + m_attachButton->setDefault(true); + m_attachButton->setText(i18n("Attach")); + m_attachButton->setShortcut(Qt::CTRL | Qt::Key_Return); + m_attachButton->setEnabled(false); KConfigGroup config = KSharedConfig::openConfig()->group("GdbProcessSelectionDialog"); m_processList->filterLineEdit()->setText(config.readEntry("filterText", QString())); @@ -93,5 +95,5 @@ void ProcessSelectionDialog::selectionChanged() { - m_okButton->setEnabled(true); + m_attachButton->setEnabled(true); }