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 void
TermApp::Quit() TermApp::Quit()
{ {

View File

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