Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43137 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -346,37 +346,10 @@ TeamWindow::LoadSettings(const GUITeamUISettings* settings)
|
|||||||
MoveTo(rect.left, rect.top);
|
MoveTo(rect.left, rect.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = settings->Value("teamWindowSourceSplit0", value);
|
_LoadSplitSettings(fSourceSplitView, "Source", settings);
|
||||||
if (error == B_OK)
|
_LoadSplitSettings(fFunctionSplitView, "Function", settings);
|
||||||
fSourceSplitView->SetItemWeight(0L, value.ToFloat(), false);
|
_LoadSplitSettings(fImageSplitView, "Image", settings);
|
||||||
|
_LoadSplitSettings(fThreadSplitView, "Thread", settings);
|
||||||
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);
|
|
||||||
|
|
||||||
error = settings->Value("teamWindowImageSplit0", value);
|
|
||||||
if (error == B_OK)
|
|
||||||
fImageSplitView->SetItemWeight(0L, value.ToFloat(), false);
|
|
||||||
|
|
||||||
error = settings->Value("teamWindowImageSplit1", value);
|
|
||||||
if (error == B_OK)
|
|
||||||
fImageSplitView->SetItemWeight(1L, value.ToFloat(), true);
|
|
||||||
|
|
||||||
error = settings->Value("teamWindowThreadSplit0", value);
|
|
||||||
if (error == B_OK)
|
|
||||||
fThreadSplitView->SetItemWeight(0L, value.ToFloat(), false);
|
|
||||||
|
|
||||||
error = settings->Value("teamWindowThreadSplit1", value);
|
|
||||||
if (error == B_OK)
|
|
||||||
fThreadSplitView->SetItemWeight(1L, value.ToFloat(), true);
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -388,36 +361,16 @@ TeamWindow::SaveSettings(GUITeamUISettings* settings)
|
|||||||
if (!settings->SetValue("teamWindowFrame", Frame()))
|
if (!settings->SetValue("teamWindowFrame", Frame()))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowSourceSplit0",
|
if (_SaveSplitSettings(fSourceSplitView, "Source", settings) != B_OK)
|
||||||
fSourceSplitView->ItemWeight(0L)))
|
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowSourceSplit1",
|
if (_SaveSplitSettings(fFunctionSplitView, "Function", settings) != B_OK)
|
||||||
fSourceSplitView->ItemWeight(1L)))
|
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowFunctionSplit0",
|
if (_SaveSplitSettings(fImageSplitView, "Image", settings) != B_OK)
|
||||||
fFunctionSplitView->ItemWeight(0L)))
|
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowFunctionSplit1",
|
if (_SaveSplitSettings(fThreadSplitView, "Thead", settings) != B_OK)
|
||||||
fFunctionSplitView->ItemWeight(1L)))
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowImageSplit0",
|
|
||||||
fImageSplitView->ItemWeight(0L)))
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowImageSplit1",
|
|
||||||
fImageSplitView->ItemWeight(1L)))
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowThreadSplit0",
|
|
||||||
fThreadSplitView->ItemWeight(0L)))
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
if (!settings->SetValue("teamWindowThreadSplit1",
|
|
||||||
fThreadSplitView->ItemWeight(1L)))
|
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -1175,3 +1128,42 @@ TeamWindow::_HandleResolveMissingSourceFile(entry_ref& locatedPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TeamWindow::_LoadSplitSettings(BSplitView* view, const char* name,
|
||||||
|
const GUITeamUISettings* settings)
|
||||||
|
{
|
||||||
|
BString settingName;
|
||||||
|
BVariant value;
|
||||||
|
|
||||||
|
settingName.SetToFormat("teamWindow%sSplit0", name);
|
||||||
|
status_t error = settings->Value(settingName.String(), value);
|
||||||
|
if (error == B_OK)
|
||||||
|
view->SetItemWeight(0L, value.ToFloat(), false);
|
||||||
|
|
||||||
|
settingName.SetToFormat("teamWindow%sSplit1", name);
|
||||||
|
error = settings->Value(settingName.String(), value);
|
||||||
|
if (error == B_OK)
|
||||||
|
view->SetItemWeight(1L, value.ToFloat(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
TeamWindow::_SaveSplitSettings(BSplitView* view, const char* name,
|
||||||
|
GUITeamUISettings* settings)
|
||||||
|
{
|
||||||
|
BString settingName;
|
||||||
|
|
||||||
|
settingName.SetToFormat("teamWindow%sSplit0", name);
|
||||||
|
if (!settings->SetValue(settingName.String(),
|
||||||
|
view->ItemWeight(0L)))
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
settingName.SetToFormat("teamWindow%sSplit1", name);
|
||||||
|
if (!settings->SetValue(settingName.String(),
|
||||||
|
view->ItemWeight(1L)))
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|||||||
@@ -143,6 +143,13 @@ private:
|
|||||||
void _HandleResolveMissingSourceFile(entry_ref&
|
void _HandleResolveMissingSourceFile(entry_ref&
|
||||||
locatedPath);
|
locatedPath);
|
||||||
|
|
||||||
|
void _LoadSplitSettings(BSplitView* view,
|
||||||
|
const char* name,
|
||||||
|
const GUITeamUISettings* settings);
|
||||||
|
status_t _SaveSplitSettings(BSplitView* view,
|
||||||
|
const char* name,
|
||||||
|
GUITeamUISettings* settings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
::Team* fTeam;
|
::Team* fTeam;
|
||||||
::Thread* fActiveThread;
|
::Thread* fActiveThread;
|
||||||
|
|||||||
Reference in New Issue
Block a user