[PATCH] Warning on close
Doug Hanley
hanleyman at adelphia.net
Sat Jun 15 06:55:12 BST 2002
On Friday 14 June 2002 08:58 pm, Waldo Bastian wrote:
> On Friday 14 June 2002 05:25 pm, Doug Hanley wrote:
> > Hey,
> >
> > How does this look for a warning on close patch?
>
> I think it should be moved into the following if:
> > if ( static_cast<KonquerorApplication *>(kapp)->closedByUser() )
>
> No need to generate this warning on logout IMO.
>
Ok, how's this?
-- Doug
Index: konq_mainwindow.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.cc,v
retrieving revision 1.1013
diff -u -3 -p -r1.1013 konq_mainwindow.cc
--- konq_mainwindow.cc 14 Jun 2002 04:46:41 -0000 1.1013
+++ konq_mainwindow.cc 15 Jun 2002 05:43:53 -0000
@@ -3826,13 +3839,24 @@ void KonqMainWindow::updateBookmarkBar()
void KonqMainWindow::closeEvent( QCloseEvent *e )
{
kdDebug(1202) << "KonqMainWindow::closeEvent begin" << endl;
+
// This breaks session management (the window is withdrawn in kwin)
// so let's do this only when closed by the user.
if ( static_cast<KonquerorApplication *>(kapp)->closedByUser() )
{
+ if ( viewManager()->docContainer() &&
viewManager()->docContainer()->frameType()=="Tabs" )
+ {
+ if ( KMessageBox::warningYesNo( 0L, "You have multiple tabs open in
this window, are you sure you wish to close it?", "Confirmation" ) ==
KMessageBox::No )
+ {
+ e->ignore();
+ return;
+ }
+ }
+
hide();
qApp->flushX();
}
+
KParts::MainWindow::closeEvent( e );
kdDebug(1202) << "KonqMainWindow::closeEvent end" << endl;
}
More information about the kfm-devel
mailing list