mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-11 13:57:43 +03:00
details:add Ok,Cancel buttons
--delete details window properly after has been used from the user
This commit is contained in:
parent
835c24cbcb
commit
04305205ca
@ -41,8 +41,11 @@ DetailsDialog::DetailsDialog(SettingsDialog *parent, Controller::Layouts *contro
|
||||
//! we must create handlers after creating/adjusting the ui
|
||||
m_handler = new Handler::DetailsHandler(this);
|
||||
|
||||
connect(m_ui->buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked,
|
||||
this, &DetailsDialog::on_apply);
|
||||
connect(m_ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked,
|
||||
this, &DetailsDialog::on_ok);
|
||||
|
||||
connect(m_ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked,
|
||||
this, &DetailsDialog::on_cancel);
|
||||
|
||||
connect(m_ui->buttonBox->button(QDialogButtonBox::Reset), &QPushButton::clicked,
|
||||
this, &DetailsDialog::on_reset);
|
||||
@ -72,10 +75,17 @@ void DetailsDialog::accept()
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
void DetailsDialog::on_apply()
|
||||
void DetailsDialog::on_ok()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
m_layoutsController->setLayoutProperties(m_handler->currentData());
|
||||
close();
|
||||
}
|
||||
|
||||
void DetailsDialog::on_cancel()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
close();
|
||||
}
|
||||
|
||||
void DetailsDialog::on_reset()
|
||||
|
@ -64,7 +64,8 @@ public:
|
||||
private slots:
|
||||
void accept() override;
|
||||
|
||||
void on_apply();
|
||||
void on_ok();
|
||||
void on_cancel();
|
||||
void on_reset();
|
||||
|
||||
private:
|
||||
|
@ -549,7 +549,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Reset</set>
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -665,6 +665,8 @@ void TabLayouts::on_details_action()
|
||||
auto detailsDlg = new Settings::Dialog::DetailsDialog(m_parentDialog, m_layoutsController);
|
||||
|
||||
detailsDlg->exec();
|
||||
|
||||
detailsDlg->deleteLater();
|
||||
}
|
||||
|
||||
void TabLayouts::on_layoutFilesDropped(const QStringList &paths)
|
||||
|
Loading…
x
Reference in New Issue
Block a user