Removing duplicate stepping police label as suggested by diver, thanks. Fix #6906. Style fixes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39621 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2010-11-24 23:58:19 +00:00
parent 93ca791b70
commit 61707abd33
@@ -1,11 +1,12 @@
/* /*
* Copyright 2009, Haiku, Inc. All Rights Reserved. * Copyright 2009-2010, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Clemens Zeidler, [email protected] * Clemens Zeidler, [email protected]
*/ */
#include "CPUFrequencyView.h" #include "CPUFrequencyView.h"
#include "StatusView.h" #include "StatusView.h"
@@ -34,8 +35,9 @@ const bigtime_t kMilliSecond = 1000;
CPUFrequencyView::CPUFrequencyView(BRect frame, CPUFrequencyView::CPUFrequencyView(BRect frame,
PreferencesStorage<freq_preferences>* storage) PreferencesStorage<freq_preferences>* storage)
: BView(frame, "CPUFrequencyView", B_FOLLOW_NONE, B_WILL_DRAW), :
BView(frame, "CPUFrequencyView", B_FOLLOW_NONE, B_WILL_DRAW),
fStorage(storage) fStorage(storage)
{ {
BGroupLayout* mainLayout = new BGroupLayout(B_VERTICAL); BGroupLayout* mainLayout = new BGroupLayout(B_VERTICAL);
@@ -55,17 +57,15 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
mainLayout->AddView(policyBox); mainLayout->AddView(policyBox);
fPolicyMenu = new BMenu(B_TRANSLATE("Stepping policy: ")); fPolicyMenu = new BMenu(B_TRANSLATE("Stepping policy: "));
BMenuField *menuField = new BMenuField( BMenuField *menuField = new BMenuField("", fPolicyMenu);
B_TRANSLATE("Stepping policy: "), fPolicyMenu);
policyLayout->AddView(menuField); policyLayout->AddView(menuField);
// dynamic stepping // dynamic stepping
BBox *dynamicBox = new BBox(rect, "dynamicBox"); BBox *dynamicBox = new BBox(rect, "dynamicBox");
dynamicBox->SetLabel(B_TRANSLATE("Dynamic stepping")); dynamicBox->SetLabel(B_TRANSLATE("Dynamic stepping"));
BGroupLayout* dynamicLayout = new BGroupLayout(B_VERTICAL); BGroupLayout* dynamicLayout = new BGroupLayout(B_VERTICAL);
dynamicLayout->SetInsets(10, dynamicBox->TopBorderOffset() * 2 + 10, dynamicLayout->SetInsets(10, dynamicBox->TopBorderOffset() * 2 + 10, 10,
10, 10); 10);
dynamicLayout->SetSpacing(10); dynamicLayout->SetSpacing(10);
dynamicBox->SetLayout(dynamicLayout); dynamicBox->SetLayout(dynamicLayout);
mainLayout->AddView(dynamicBox); mainLayout->AddView(dynamicBox);
@@ -74,10 +74,8 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
fColorStepView->SetFrequencys(fDriverInterface.GetCpuFrequencyStates()); fColorStepView->SetFrequencys(fDriverInterface.GetCpuFrequencyStates());
fIntegrationTime = new BTextControl(BRect(0,0,Bounds().Width(),10), fIntegrationTime = new BTextControl(BRect(0,0,Bounds().Width(),10),
"intergal", "intergal", B_TRANSLATE("Integration time [ms]: "), "",
B_TRANSLATE("Integration time [ms]: "), new BMessage(kIntegrationTimeChanged));
"",
new BMessage(kIntegrationTimeChanged));
dynamicLayout->AddView(fColorStepView); dynamicLayout->AddView(fColorStepView);
dynamicLayout->AddView(fIntegrationTime); dynamicLayout->AddView(fIntegrationTime);
@@ -91,13 +89,12 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
statusBox->SetLayout(statusLayout); statusBox->SetLayout(statusLayout);
mainLayout->AddView(statusBox); mainLayout->AddView(statusBox);
fStatusView = new StatusView(BRect(0, 0, 5, 5), false, fStatusView = new StatusView(BRect(0, 0, 5, 5), false, fStorage);
fStorage);
fStatusView->ShowPopUpMenu(false); fStatusView->ShowPopUpMenu(false);
fInstallButton = new BButton("installButton", fInstallButton = new BButton("installButton",
B_TRANSLATE("Install replicant into Deskbar"), B_TRANSLATE("Install replicant into Deskbar"),
new BMessage(kInstallIntoDeskbar)); new BMessage(kInstallIntoDeskbar));
statusLayout->AddView(fStatusView); statusLayout->AddView(fStatusView);
statusLayout->AddView(fInstallButton); statusLayout->AddView(fInstallButton);
@@ -159,8 +156,8 @@ CPUFrequencyView::MessageReceived(BMessage* message)
void void
CPUFrequencyView::AttachedToWindow() CPUFrequencyView::AttachedToWindow()
{ {
fFrequencyMenu = new FrequencyMenu(fPolicyMenu, this, fFrequencyMenu = new FrequencyMenu(fPolicyMenu, this, fStorage,
fStorage, &fDriverInterface); &fDriverInterface);
AddFilter(fFrequencyMenu); AddFilter(fFrequencyMenu);
fColorStepView->SetTarget(this); fColorStepView->SetTarget(this);