Override BApplication::QuitRequested(), so that when the system is shutting

down, we can skip the checks for running processes. At least I found the
alerts seriously annoying in this case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39449 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-16 16:26:28 +00:00
parent 91eec68cf1
commit 490f785868
2 changed files with 26 additions and 6 deletions

View File

@ -138,6 +138,25 @@ TermApp::ReadyToRun()
}
bool
TermApp::QuitRequested()
{
// check whether the system is shutting down
BMessage* message = CurrentMessage();
bool shutdown;
if (message != NULL && message->FindBool("_shutdown_", &shutdown) == B_OK
&& shutdown) {
// The system is shutting down. Quit the window synchronously. This
// skips the checks for running processes and the "Are you sure..."
// alert.
if (fTermWindow->Lock())
fTermWindow->Quit();
}
return BApplication::QuitRequested();
}
void
TermApp::Quit()
{

View File

@ -49,12 +49,13 @@ public:
virtual ~TermApp();
protected:
void ReadyToRun();
void Quit();
void AboutRequested();
void MessageReceived(BMessage* message);
void RefsReceived(BMessage* message);
void ArgvReceived(int32 argc, char** argv);
virtual void ReadyToRun();
virtual bool QuitRequested();
virtual void Quit();
virtual void AboutRequested();
virtual void MessageReceived(BMessage* message);
virtual void RefsReceived(BMessage* message);
virtual void ArgvReceived(int32 argc, char** argv);
private:
status_t _MakeTermWindow(BRect& frame,