From ce90d2d1645b3ec8436bb639f27aaddf3e16f8eb Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 2 Nov 2011 21:49:24 +0000 Subject: [PATCH] We now save and restore the main splits of the team window. The tab split will be joining them shortly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43134 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../gui/team_window/TeamWindow.cpp | 43 +++++++++++++++++-- .../gui/team_window/TeamWindow.h | 3 ++ 2 files changed, 42 insertions(+), 4 deletions(-) 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 65de8569bc..6366691246 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -339,13 +339,29 @@ status_t TeamWindow::LoadSettings(const GUITeamUISettings* settings) { BVariant value; - status_t result = settings->Value("teamWindowFrame", value); - if (result == B_OK) { + status_t error = settings->Value("teamWindowFrame", value); + if (error == B_OK) { BRect rect = value.ToRect(); ResizeTo(rect.Width(), rect.Height()); MoveTo(rect.left, rect.top); } + error = settings->Value("teamWindowSourceSplit0", value); + if (error == B_OK) + fSourceSplitView->SetItemWeight(0L, value.ToFloat(), false); + + error = settings->Value("teamWindowSourceSplit1", value); + if (error == B_OK) + fSourceSplitView->SetItemWeight(1L, value.ToFloat(), true); + + error = settings->Value("teamWindowFunctionSplit0", value); + if (error == B_OK) + fFunctionSplitView->SetItemWeight(0L, value.ToFloat(), false); + + error = settings->Value("teamWindowFunctionSplit1", value); + if (error == B_OK) + fFunctionSplitView->SetItemWeight(1L, value.ToFloat(), true); + return B_OK; } @@ -353,9 +369,26 @@ TeamWindow::LoadSettings(const GUITeamUISettings* settings) status_t TeamWindow::SaveSettings(GUITeamUISettings* settings) { - status_t error = settings->SetValue("teamWindowFrame", Frame()); + if (!settings->SetValue("teamWindowFrame", Frame())) + return B_NO_MEMORY; - return error; + if (!settings->SetValue("teamWindowSourceSplit0", + fSourceSplitView->ItemWeight(0L))) + return B_NO_MEMORY; + + if (!settings->SetValue("teamWindowSourceSplit1", + fSourceSplitView->ItemWeight(1L))) + return B_NO_MEMORY; + + if (!settings->SetValue("teamWindowFunctionSplit0", + fFunctionSplitView->ItemWeight(0L))) + return B_NO_MEMORY; + + if (!settings->SetValue("teamWindowFunctionSplit1", + fFunctionSplitView->ItemWeight(1L))) + return B_NO_MEMORY; + + return B_OK; } @@ -502,6 +535,7 @@ TeamWindow::_Init() BLayoutBuilder::Group<>(this, B_VERTICAL) .Add(fMenuBar = new BMenuBar("Menu")) .AddSplit(B_VERTICAL, 3.0f) + .GetSplitView(&fFunctionSplitView) .SetInsets(4.0f, 4.0f, 4.0f, 4.0f) .Add(fTabView = new BTabView("tab view"), 0.4f) .AddGroup(B_VERTICAL, 4.0f) @@ -516,6 +550,7 @@ TeamWindow::_Init() "source path", "Source path unavailable."), 4.0f) .AddSplit(B_HORIZONTAL, 3.0f) + .GetSplitView(&fSourceSplitView) .Add(sourceScrollView = new BScrollView("source scroll", NULL, 0, true, true), 3.0f) .Add(fLocalsTabView = new BTabView("locals view")) 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 233c0f6ea4..4066d5142b 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.h @@ -24,6 +24,7 @@ class BButton; class BMenuBar; +class BSplitView; class BStringView; class BTabView; class GUITeamUISettings; @@ -169,6 +170,8 @@ private: BButton* fStepOutButton; BMenuBar* fMenuBar; BStringView* fSourcePathView; + BSplitView* fFunctionSplitView; + BSplitView* fSourceSplitView; InspectorWindow* fInspectorWindow; };