Notify user in GUI when debug report has been written.

This commit is contained in:
Rene Gollent
2012-11-24 00:53:25 -05:00
parent 5fe3a57c43
commit a540b98527
2 changed files with 24 additions and 0 deletions
@@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <Alert.h>
#include <Button.h> #include <Button.h>
#include <FilePanel.h> #include <FilePanel.h>
#include <FindDirectory.h> #include <FindDirectory.h>
@@ -57,6 +58,7 @@ enum {
enum { enum {
MSG_CHOOSE_DEBUG_REPORT_LOCATION = 'ccrl', MSG_CHOOSE_DEBUG_REPORT_LOCATION = 'ccrl',
MSG_DEBUG_REPORT_SAVED = 'drsa',
MSG_LOCATE_SOURCE_IF_NEEDED = 'lsin' MSG_LOCATE_SOURCE_IF_NEEDED = 'lsin'
}; };
@@ -250,6 +252,17 @@ TeamWindow::MessageReceived(BMessage* message)
} }
break; break;
} }
case MSG_DEBUG_REPORT_SAVED:
{
BString data;
data.SetToFormat("Debug report successfully saved to '%s'",
message->FindString("path"));
BAlert *alert = new BAlert("Report saved", data.String(),
"OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break;
}
case MSG_SHOW_INSPECTOR_WINDOW: case MSG_SHOW_INSPECTOR_WINDOW:
{ {
if (fInspectorWindow) { if (fInspectorWindow) {
@@ -722,6 +735,15 @@ TeamWindow::WatchpointChanged(const Team::WatchpointEvent& event)
} }
void
TeamWindow::DebugReportChanged(const Team::DebugReportEvent& event)
{
BMessage message(MSG_DEBUG_REPORT_SAVED);
message.AddString("path", event.GetReportPath());
PostMessage(&message);
}
void void
TeamWindow::FunctionSourceCodeChanged(Function* function) TeamWindow::FunctionSourceCodeChanged(Function* function)
{ {
@@ -127,6 +127,8 @@ private:
const Team::UserBreakpointEvent& event); const Team::UserBreakpointEvent& event);
virtual void WatchpointChanged( virtual void WatchpointChanged(
const Team::WatchpointEvent& event); const Team::WatchpointEvent& event);
virtual void DebugReportChanged(
const Team::DebugReportEvent& event);
// Function::Listener // Function::Listener
virtual void FunctionSourceCodeChanged(Function* function); virtual void FunctionSourceCodeChanged(Function* function);