diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2008-12-07 00:18:36 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2008-12-07 00:18:36 +0100 |
commit | c8279e0c4a76db65547e6c711b8e7717e0d28059 (patch) | |
tree | e9e42a5cca514d600094afe8d4c03af2bd82ce23 /src/tabwidget.cpp | |
parent | Fixed crash when closing rekonq with more than one tab (diff) | |
download | rekonq-c8279e0c4a76db65547e6c711b8e7717e0d28059.tar.xz |
No more QmessageBox here..
Diffstat (limited to 'src/tabwidget.cpp')
-rw-r--r-- | src/tabwidget.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index b8e9c748..01f9bd6c 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -31,6 +31,7 @@ // KDE Includes #include <KShortcut> #include <KStandardShortcut> +#include <KMessageBox> // Qt Includes #include <QtGui> @@ -334,6 +335,7 @@ void TabWidget::currentChanged(int index) if (!webView) return; +// FIXME Q_ASSERT( m_lineEdits->count() == count() ); WebView *oldWebView = this->webView(m_lineEdits->currentIndex()); @@ -601,16 +603,12 @@ void TabWidget::closeTab(int index) { if (tab->isModified()) { - QMessageBox closeConfirmation(tab); - closeConfirmation.setWindowFlags(Qt::Sheet); - closeConfirmation.setWindowTitle(i18n("Do you really want to close this page?")); - closeConfirmation.setInformativeText(i18n("You have modified this page and when closing it you would lose the modification.\n" - "Do you really want to close this page?\n")); - closeConfirmation.setIcon(QMessageBox::Question); - closeConfirmation.addButton(QMessageBox::Yes); - closeConfirmation.addButton(QMessageBox::No); - closeConfirmation.setEscapeButton(QMessageBox::No); - if (closeConfirmation.exec() == QMessageBox::No) + int risp = KMessageBox::questionYesNo( this , + i18n("You have modified this page and when closing it you would lose the modification.\n" + "Do you really want to close this page?\n"), + i18n("Do you really want to close this page?"), + KStandardGuiItem::no() ); + if( risp == KMessageBox::No ) return; } hasFocus = tab->hasFocus(); |