┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2016-10-28 13:42:28 +0200
committerKai Uwe Broulik <[email protected]>2016-10-28 13:42:28 +0200
commitbffb1c4d60694a63561e7063b8895d035ba52564 (patch)
tree9296a148f8b9c45548ac39337ffea91fa3d18b64 /src/panels
parent57a19efe93dd1e899c3e2e061ebca84d1e90ce46 (diff)
parent95e1505c9f01bdae2c1157be1bb6fa5b991c8fd4 (diff)
Merge branch 'Applications/16.08'
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/places/placesitemeditdialog.cpp17
-rw-r--r--src/panels/places/placesitemeditdialog.h4
2 files changed, 9 insertions, 12 deletions
diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp
index 7d365310f..ffcac4c8f 100644
--- a/src/panels/places/placesitemeditdialog.cpp
+++ b/src/panels/places/placesitemeditdialog.cpp
@@ -47,7 +47,8 @@ PlacesItemEditDialog::PlacesItemEditDialog(QWidget* parent) :
m_urlEdit(0),
m_textEdit(0),
m_iconButton(0),
- m_appLocal(0)
+ m_appLocal(0),
+ m_buttonBox(nullptr)
{
}
@@ -106,7 +107,7 @@ bool PlacesItemEditDialog::event(QEvent* event)
void PlacesItemEditDialog::slotUrlChanged(const QString& text)
{
- m_okButton->setEnabled(!text.isEmpty());
+ m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
}
PlacesItemEditDialog::~PlacesItemEditDialog()
@@ -115,20 +116,16 @@ PlacesItemEditDialog::~PlacesItemEditDialog()
void PlacesItemEditDialog::initialize()
{
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
- m_okButton = buttonBox->button(QDialogButtonBox::Ok);
- m_okButton->setDefault(true);
- m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, &QDialogButtonBox::accepted, this, &PlacesItemEditDialog::accept);
- connect(buttonBox, &QDialogButtonBox::rejected, this, &PlacesItemEditDialog::reject);
+ m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
+ connect(m_buttonBox, &QDialogButtonBox::accepted, this, &PlacesItemEditDialog::accept);
+ connect(m_buttonBox, &QDialogButtonBox::rejected, this, &PlacesItemEditDialog::reject);
setModal(true);
- m_okButton->setDefault(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QWidget* mainWidget = new QWidget(this);
mainLayout->addWidget(mainWidget);
- mainLayout->addWidget(buttonBox);
+ mainLayout->addWidget(m_buttonBox);
QVBoxLayout* vBox = new QVBoxLayout(mainWidget);
diff --git a/src/panels/places/placesitemeditdialog.h b/src/panels/places/placesitemeditdialog.h
index 8a0dc0471..f2d69781a 100644
--- a/src/panels/places/placesitemeditdialog.h
+++ b/src/panels/places/placesitemeditdialog.h
@@ -31,7 +31,7 @@ class KIconButton;
class KUrlRequester;
class QLineEdit;
class QCheckBox;
-class QPushButton;
+class QDialogButtonBox;
class PlacesItemEditDialog: public QDialog
{
@@ -72,7 +72,7 @@ private:
QLineEdit* m_textEdit;
KIconButton* m_iconButton;
QCheckBox* m_appLocal;
- QPushButton *m_okButton;
+ QDialogButtonBox *m_buttonBox;
};
#endif