use KMessageBox for Multiple Layout warning

work/spdx
Michail Vourlakos 4 years ago
parent dcdc239fc4
commit e1cf44240e

@ -41,6 +41,7 @@
#include <QMessageBox>
// KDE
#include <KMessageBox>
#include <KLocalizedString>
#include <KNotification>
@ -210,14 +211,22 @@ void Manager::loadLayoutOnStartup(QString layoutName)
//! Latte didn't close correctly, maybe a crash
if (layouts.size() > 0) {
QMessageBox *msg = new QMessageBox();
msg->setAttribute(Qt::WA_DeleteOnClose);
msg->setIcon(QMessageBox::Warning);
msg->setWindowTitle(i18n("Multiple Layouts Warning"));
msg->setText(i18n("Latte did not close properly in the previous session. The following layout(s) <b>[%0]</b> were updated for consistency!!!").arg(layouts.join(",")));
msg->setStandardButtons(QMessageBox::Ok);
msg->open();
QDialog* dialog = new QDialog(nullptr);
dialog->setObjectName("sorry");
dialog->setAttribute(Qt::WA_DeleteOnClose);
auto buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok);
KMessageBox::createKMessageBox(dialog,
buttonbox,
QMessageBox::Warning,
i18n("<b>Multiple Layouts based on Activities</b> mode did not close properly during the last session.<br/><br/>The following layout(s) <b>[ %0 ]</b> had to be updated for consistency!").arg(layouts.join(",")),
QStringList(),
QString(),
0,
KMessageBox::NoExec,
QString());
dialog->show();
}
m_synchronizer->switchToLayout(layoutName);

Loading…
Cancel
Save