diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index 2428432ea6..ae3adc5187 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -39,6 +39,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui inspector_window ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui model ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui team_window ] ; +SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui team_settings_window ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui teams_window ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui utility_windows ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) user_interface gui util ] ; @@ -288,6 +289,9 @@ Application Debugger : ThreadListView.cpp VariablesView.cpp + # user_interface/gui/team_settings_window + TeamSettingsWindow.cpp + # user_interface/gui/util ActionMenuItem.cpp GuiSettingsUtils.cpp @@ -295,7 +299,6 @@ Application Debugger : TargetAddressTableColumn.cpp # user_interface/gui/utility_windows - BreakConditionConfigWindow.cpp BreakpointEditWindow.cpp ExpressionPromptWindow.cpp StartTeamWindow.cpp diff --git a/src/apps/debugger/MessageCodes.h b/src/apps/debugger/MessageCodes.h index dd457a6a3e..da21be5302 100644 --- a/src/apps/debugger/MessageCodes.h +++ b/src/apps/debugger/MessageCodes.h @@ -63,10 +63,10 @@ enum { MSG_TEAM_DEBUGGER_QUIT = 'dbqt', MSG_TEAM_RESTART_REQUESTED = 'trrq', - MSG_SHOW_TEAMS_WINDOW = 'stsw', - MSG_TEAMS_WINDOW_CLOSED = 'tswc', - MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW = 'sbcc', - MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED = 'bccw', + MSG_SHOW_TEAMS_WINDOW = 'stew', + MSG_TEAMS_WINDOW_CLOSED = 'tewc', + MSG_SHOW_TEAM_SETTINGS_WINDOW = 'stsw', + MSG_TEAM_SETTINGS_WINDOW_CLOSED = 'tswc', MSG_SHOW_BREAKPOINT_EDIT_WINDOW = 'sbew', MSG_BREAKPOINT_EDIT_WINDOW_CLOSED = 'bewc', MSG_SHOW_START_TEAM_WINDOW = 'sstw', diff --git a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp similarity index 90% rename from src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp rename to src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp index f750f82bea..d616b4e3cb 100644 --- a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.cpp @@ -1,8 +1,8 @@ /* - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2015, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ -#include "BreakConditionConfigWindow.h" +#include "TeamSettingsWindow.h" #include #include @@ -44,10 +44,10 @@ static int SortStringItems(const void* a, const void* b) } -BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team, +TeamSettingsWindow::TeamSettingsWindow(::Team* team, UserInterfaceListener* listener, BHandler* target) : - BWindow(BRect(), "Configure break conditions", B_FLOATING_WINDOW, + BWindow(BRect(), "Team settings", B_FLOATING_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE), fTeam(team), fListener(listener), @@ -71,18 +71,18 @@ BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team, } -BreakConditionConfigWindow::~BreakConditionConfigWindow() +TeamSettingsWindow::~TeamSettingsWindow() { fTeam->RemoveListener(this); - BMessenger(fTarget).SendMessage(MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED); + BMessenger(fTarget).SendMessage(MSG_TEAM_SETTINGS_WINDOW_CLOSED); } -BreakConditionConfigWindow* -BreakConditionConfigWindow::Create(::Team* team, +TeamSettingsWindow* +TeamSettingsWindow::Create(::Team* team, UserInterfaceListener* listener, BHandler* target) { - BreakConditionConfigWindow* self = new BreakConditionConfigWindow( + TeamSettingsWindow* self = new TeamSettingsWindow( team, listener, target); try { @@ -97,7 +97,7 @@ BreakConditionConfigWindow::Create(::Team* team, } void -BreakConditionConfigWindow::MessageReceived(BMessage* message) +TeamSettingsWindow::MessageReceived(BMessage* message) { switch (message->what) { case MSG_STOP_ON_THROWN_EXCEPTION_CHANGED: @@ -232,7 +232,7 @@ BreakConditionConfigWindow::MessageReceived(BMessage* message) void -BreakConditionConfigWindow::Show() +TeamSettingsWindow::Show() { CenterOnScreen(); BWindow::Show(); @@ -240,7 +240,7 @@ BreakConditionConfigWindow::Show() void -BreakConditionConfigWindow::StopOnImageLoadSettingsChanged( +TeamSettingsWindow::StopOnImageLoadSettingsChanged( const Team::ImageLoadEvent& event) { BMessage message(MSG_STOP_IMAGE_SETTINGS_CHANGED); @@ -251,7 +251,7 @@ BreakConditionConfigWindow::StopOnImageLoadSettingsChanged( void -BreakConditionConfigWindow::StopOnImageLoadNameAdded( +TeamSettingsWindow::StopOnImageLoadNameAdded( const Team::ImageLoadNameEvent& event) { BMessage message(MSG_STOP_IMAGE_NAME_ADDED); @@ -261,7 +261,7 @@ BreakConditionConfigWindow::StopOnImageLoadNameAdded( void -BreakConditionConfigWindow::StopOnImageLoadNameRemoved( +TeamSettingsWindow::StopOnImageLoadNameRemoved( const Team::ImageLoadNameEvent& event) { BMessage message(MSG_STOP_IMAGE_NAME_REMOVED); @@ -271,7 +271,7 @@ BreakConditionConfigWindow::StopOnImageLoadNameRemoved( void -BreakConditionConfigWindow::_Init() +TeamSettingsWindow::_Init() { fExceptionSettingsBox = new BBox("exceptionBox"); fExceptionSettingsBox->SetLabel("Exceptions"); @@ -365,7 +365,7 @@ BreakConditionConfigWindow::_Init() void -BreakConditionConfigWindow::_UpdateThrownBreakpoints(bool enable) +TeamSettingsWindow::_UpdateThrownBreakpoints(bool enable) { AutoLocker< ::Team> teamLocker(fTeam); for (ImageList::ConstIterator it = fTeam->Images().GetIterator(); @@ -386,7 +386,7 @@ BreakConditionConfigWindow::_UpdateThrownBreakpoints(bool enable) status_t -BreakConditionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info, +TeamSettingsWindow::_FindExceptionFunction(ImageDebugInfo* info, target_addr_t& _foundAddress) const { if (info != NULL) { @@ -406,7 +406,7 @@ BreakConditionConfigWindow::_FindExceptionFunction(ImageDebugInfo* info, void -BreakConditionConfigWindow::_UpdateExceptionState() +TeamSettingsWindow::_UpdateExceptionState() { // check if the exception breakpoints are already installed for (ImageList::ConstIterator it = fTeam->Images().GetIterator(); @@ -427,7 +427,7 @@ BreakConditionConfigWindow::_UpdateExceptionState() void -BreakConditionConfigWindow::_UpdateStopImageState() +TeamSettingsWindow::_UpdateStopImageState() { bool previousStop = fStopOnLoadEnabled; bool previousCustomImages = fUseCustomImages && fStopOnLoadEnabled; @@ -458,7 +458,7 @@ BreakConditionConfigWindow::_UpdateStopImageState() void -BreakConditionConfigWindow::_UpdateStopImageButtons(bool previousStop, +TeamSettingsWindow::_UpdateStopImageButtons(bool previousStop, bool previousCustomImages) { fStopImageConstraints->SetEnabled(fStopOnLoadEnabled); diff --git a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h similarity index 82% rename from src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h rename to src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h index 1e07c09f27..ec754a4344 100644 --- a/src/apps/debugger/user_interface/gui/utility_windows/BreakConditionConfigWindow.h +++ b/src/apps/debugger/user_interface/gui/team_settings_window/TeamSettingsWindow.h @@ -1,9 +1,9 @@ /* - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2015, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ -#ifndef BREAK_CONDITION_CONFIG_WINDOW_H -#define BREAK_CONDITION_CONFIG_WINDOW_H +#ifndef TEAM_SETTINGS_WINDOW_H +#define TEAM_SETTINGS_WINDOW_H #include @@ -23,15 +23,15 @@ class ImageDebugInfo; class UserInterfaceListener; -class BreakConditionConfigWindow : public BWindow, private Team::Listener { +class TeamSettingsWindow : public BWindow, private Team::Listener { public: - BreakConditionConfigWindow(::Team* team, + TeamSettingsWindow(::Team* team, UserInterfaceListener* listener, BHandler* target); - ~BreakConditionConfigWindow(); + ~TeamSettingsWindow(); - static BreakConditionConfigWindow* Create(::Team* team, + static TeamSettingsWindow* Create(::Team* team, UserInterfaceListener* listener, BHandler* target); // throws @@ -84,4 +84,4 @@ private: }; -#endif // BREAK_CONDITION_CONFIG_WINDOW_H +#endif // TEAM_SETTINGS_WINDOW_H diff --git a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp index acd7888256..b6088ad0bd 100644 --- a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2011-2013, Rene Gollent, rene@gollent.com. + * Copyright 2011-2015, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -29,7 +29,6 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener) BGroupView(B_HORIZONTAL, 4.0f), fTeam(team), fListView(NULL), - fConfigureExceptionsButton(NULL), fToggleBreakpointButton(NULL), fEditBreakpointButton(NULL), fRemoveBreakpointButton(NULL), @@ -113,7 +112,6 @@ BreakpointsView::MessageReceived(BMessage* message) void BreakpointsView::AttachedToWindow() { - fConfigureExceptionsButton->SetTarget(Window()); fEditBreakpointButton->SetTarget(this); fToggleBreakpointButton->SetTarget(this); fRemoveBreakpointButton->SetTarget(this); @@ -162,15 +160,11 @@ BreakpointsView::_Init() .AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING) .SetInsets(B_USE_SMALL_SPACING) .AddGlue() - .Add(fConfigureExceptionsButton = new BButton( - "Configure break conditions" B_UTF8_ELLIPSIS)) .Add(fRemoveBreakpointButton = new BButton("Remove")) .Add(fEditBreakpointButton = new BButton("Edit" B_UTF8_ELLIPSIS)) .Add(fToggleBreakpointButton = new BButton("Toggle")) .End(); - fConfigureExceptionsButton->SetMessage( - new BMessage(MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW)); fToggleBreakpointButton->SetMessage(new BMessage(MSG_ENABLE_BREAKPOINT)); fRemoveBreakpointButton->SetMessage(new BMessage(MSG_CLEAR_BREAKPOINT)); fEditBreakpointButton->SetMessage( diff --git a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h index 4946b46a72..15681d8daa 100644 --- a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h +++ b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h @@ -55,7 +55,6 @@ private: Team* fTeam; BreakpointListView* fListView; BreakpointProxyList fSelectedBreakpoints; - BButton* fConfigureExceptionsButton; BButton* fToggleBreakpointButton; BButton* fEditBreakpointButton; BButton* fRemoveBreakpointButton; 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 769d155248..4a29f226e2 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2010-2014, Rene Gollent, rene@gollent.com. + * Copyright 2010-2015, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -33,7 +33,6 @@ #include #include -#include "BreakConditionConfigWindow.h" #include "Breakpoint.h" #include "BreakpointEditWindow.h" #include "ConsoleOutputView.h" @@ -53,6 +52,7 @@ #include "RegistersView.h" #include "StackTrace.h" #include "StackTraceView.h" +#include "TeamSettingsWindow.h" #include "Tracing.h" #include "TypeComponentPath.h" #include "UiUtils.h" @@ -138,7 +138,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener) fImageSplitView(NULL), fThreadSplitView(NULL), fConsoleSplitView(NULL), - fBreakConditionConfigWindow(NULL), + fTeamSettingsWindow(NULL), fBreakpointEditWindow(NULL), fInspectorWindow(NULL), fExpressionPromptWindow(NULL), @@ -397,28 +397,28 @@ TeamWindow::MessageReceived(BMessage* message) } break; } - case MSG_SHOW_BREAK_CONDITION_CONFIG_WINDOW: + case MSG_SHOW_TEAM_SETTINGS_WINDOW: { - if (fBreakConditionConfigWindow != NULL) { - AutoLocker lock(fBreakConditionConfigWindow); + if (fTeamSettingsWindow != NULL) { + AutoLocker lock(fTeamSettingsWindow); if (lock.IsLocked()) - fBreakConditionConfigWindow->Activate(true); + fTeamSettingsWindow->Activate(true); } else { try { - fBreakConditionConfigWindow - = BreakConditionConfigWindow::Create( + fTeamSettingsWindow + = TeamSettingsWindow::Create( fTeam, fListener, this); - if (fBreakConditionConfigWindow != NULL) - fBreakConditionConfigWindow->Show(); + if (fTeamSettingsWindow != NULL) + fTeamSettingsWindow->Show(); } catch (...) { // TODO: notify user } } break; } - case MSG_BREAK_CONDITION_CONFIG_WINDOW_CLOSED: + case MSG_TEAM_SETTINGS_WINDOW_CLOSED: { - fBreakConditionConfigWindow = NULL; + fTeamSettingsWindow = NULL; break; } case MSG_SHOW_BREAKPOINT_EDIT_WINDOW: @@ -1100,6 +1100,11 @@ TeamWindow::_Init() 'W'); menu->AddItem(item); item->SetTarget(this); + menu->AddSeparatorItem(); + item = new BMenuItem("Settings" B_UTF8_ELLIPSIS, new BMessage( + MSG_SHOW_TEAM_SETTINGS_WINDOW)); + menu->AddItem(item); + item->SetTarget(this); menu = new BMenu("Edit"); fMenuBar->AddItem(menu); item = new BMenuItem("Copy", new BMessage(B_COPY), 'C'); 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 d9f5dfa7e9..a75ed2c182 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2010-2014, Rene Gollent, rene@gollent.com. + * Copyright 2010-2015, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ #ifndef TEAM_WINDOW_H @@ -32,7 +32,6 @@ class BStringList; class BStringView; class BTabView; class ConsoleOutputView; -class BreakConditionConfigWindow; class BreakpointEditWindow; class ExpressionPromptWindow; class Image; @@ -41,6 +40,7 @@ class RegistersView; class SourceCode; class SourceLanguage; class StackFrame; +class TeamSettingsWindow; class Type; class UserBreakpoint; class UserInterfaceListener; @@ -227,7 +227,7 @@ private: BSplitView* fImageSplitView; BSplitView* fThreadSplitView; BSplitView* fConsoleSplitView; - BreakConditionConfigWindow* fBreakConditionConfigWindow; + TeamSettingsWindow* fTeamSettingsWindow; BreakpointEditWindow* fBreakpointEditWindow; InspectorWindow* fInspectorWindow; ExpressionPromptWindow* fExpressionPromptWindow;