diff --git a/shell/shell.cpp b/shell/shell.cpp --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -544,6 +544,38 @@ bool Shell::queryClose() { + if (m_tabs.count() > 1) + { + const QString dontAskAgainName = "ShowTabWarning"; + KMessageBox::ButtonCode dummy; + if (shouldBeShownYesNo(dontAskAgainName, dummy)) + { + QDialog *dialog = new QDialog(this); + dialog->setWindowTitle(i18n("Confirm quit")); + + QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); + buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), KStandardGuiItem::yes()); + KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), KStandardGuiItem::no()); + + bool checkboxResult = true; + const int result = KMessageBox::createKMessageBox(dialog, buttonBox, QMessageBox::Information, + i18n("You have multiple tabs. Are you sure you want to quit?"), QStringList(), + i18n("Warn me on closing more than one tab"), + &checkboxResult, KMessageBox::Notify); + + if (!checkboxResult) + { + saveDontShowAgainYesNo(dontAskAgainName, dummy); + } + + if (result != QDialogButtonBox::Yes) + { + return false; + } + } + } + for( int i = 0; i < m_tabs.size(); ++i ) { KParts::ReadWritePart* const part = m_tabs[i].part;