Filled up the quitting code path a bit. The TeamDebugger throws up an alert
asking what to do with the debugged team. Killing it is not yet implemented. Then it notifies the application about the quit request. That in turn tears down the TeamDebugger and if no other ones are left, it quits itself. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31201 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <new>
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <AutoLocker.h>
|
||||
@@ -183,6 +184,14 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::DeleteSelf()
|
||||
{
|
||||
Lock();
|
||||
Quit();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::MessageReceived(BMessage* message)
|
||||
{
|
||||
@@ -310,7 +319,50 @@ TeamDebugger::ClearBreakpointRequested(target_addr_t address)
|
||||
bool
|
||||
TeamDebugger::TeamWindowQuitRequested(TeamWindow* window)
|
||||
{
|
||||
// TODO:...
|
||||
// TODO: Is this what shall happen?
|
||||
if (!fTeam->Lock())
|
||||
return true;
|
||||
|
||||
BString name(fTeam->Name());
|
||||
|
||||
fTeam->Unlock();
|
||||
|
||||
BString message;
|
||||
message << "What shall be done about the debugged team '";
|
||||
message << name;
|
||||
message << "'?";
|
||||
|
||||
name.Remove(0, name.FindLast('/') + 1);
|
||||
|
||||
BString killLabel("Kill ");
|
||||
killLabel << name;
|
||||
|
||||
BString resumeLabel("Resume ");
|
||||
resumeLabel << name;
|
||||
|
||||
BAlert* alert = new BAlert("Quit Debugger", message.String(),
|
||||
killLabel.String(), "Cancel", resumeLabel.String());
|
||||
|
||||
switch (alert->Go()) {
|
||||
case 0:
|
||||
// TODO: Implement killing the team.
|
||||
alert = new BAlert("TODO", "That is not nice and I won't do it "
|
||||
"either! Test failed. Nice to know how you think about these "
|
||||
"matters.", "Ugh!");
|
||||
alert->Go();
|
||||
break;
|
||||
case 1:
|
||||
return false;
|
||||
case 2:
|
||||
// Detach from the team and resume and stopped threads. Seems to be
|
||||
// the default action anyways.
|
||||
break;
|
||||
}
|
||||
|
||||
BMessage quitMessage(MSG_DEBUGGER_QUIT_REQUESTED);
|
||||
quitMessage.AddPointer("debugger", this);
|
||||
be_app->PostMessage(&quitMessage);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user