From a540b9852773e048812d75a9e239bd7b5a43a822 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 24 Nov 2012 00:47:21 -0500 Subject: [PATCH] Notify user in GUI when debug report has been written. --- .../gui/team_window/TeamWindow.cpp | 22 +++++++++++++++++++ .../gui/team_window/TeamWindow.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 869d9ff523..2c8ddf6c25 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -57,6 +58,7 @@ enum { enum { MSG_CHOOSE_DEBUG_REPORT_LOCATION = 'ccrl', + MSG_DEBUG_REPORT_SAVED = 'drsa', MSG_LOCATE_SOURCE_IF_NEEDED = 'lsin' }; @@ -250,6 +252,17 @@ TeamWindow::MessageReceived(BMessage* message) } 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: { 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 TeamWindow::FunctionSourceCodeChanged(Function* function) { diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h index 5821b2c734..2e8e8d487f 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h @@ -127,6 +127,8 @@ private: const Team::UserBreakpointEvent& event); virtual void WatchpointChanged( const Team::WatchpointEvent& event); + virtual void DebugReportChanged( + const Team::DebugReportEvent& event); // Function::Listener virtual void FunctionSourceCodeChanged(Function* function);