Rename DecorSettingsView to LookAndFeelSettingsView.

This commit is contained in:
Ryan Leavengood 2012-09-02 15:30:02 -04:00
parent fe855cd550
commit 6446fc3582
5 changed files with 41 additions and 38 deletions

View File

@ -21,7 +21,7 @@
#include "AntialiasingSettingsView.h"
#include "APRView.h"
#include "DecorSettingsView.h"
#include "LookAndFeelSettingsView.h"
#include "defs.h"
#include "FontView.h"
@ -54,7 +54,7 @@ APRWindow::APRWindow(BRect frame)
fColorsView = new APRView(B_TRANSLATE("Colors"));
fDecorSettings = new DecorSettingsView(
fLookAndFeelSettings = new LookAndFeelSettingsView(
B_TRANSLATE("Look and feel"));
fAntialiasingSettings = new AntialiasingSettingsView(
@ -62,7 +62,7 @@ APRWindow::APRWindow(BRect frame)
tabView->AddTab(fFontSettings);
tabView->AddTab(fColorsView);
tabView->AddTab(fDecorSettings);
tabView->AddTab(fLookAndFeelSettings);
tabView->AddTab(fAntialiasingSettings);
_UpdateButtons();
@ -92,7 +92,7 @@ APRWindow::MessageReceived(BMessage *message)
fFontSettings->SetDefaults();
fColorsView->SetDefaults();
fAntialiasingSettings->SetDefaults();
fDecorSettings->SetDefaults();
fLookAndFeelSettings->SetDefaults();
_UpdateButtons();
break;
@ -101,7 +101,7 @@ APRWindow::MessageReceived(BMessage *message)
fColorsView->Revert();
fAntialiasingSettings->Revert();
fFontSettings->Revert();
fDecorSettings->Revert();
fLookAndFeelSettings->Revert();
_UpdateButtons();
break;
@ -127,11 +127,11 @@ APRWindow::_IsDefaultable() const
// printf("fonts defaultable: %d\n", fFontSettings->IsDefaultable());
// printf("colors defaultable: %d\n", fColorsView->IsDefaultable());
// printf("AA defaultable: %d\n", fAntialiasingSettings->IsDefaultable());
// printf("decor defaultable: %d\n", fDecorSettings->IsDefaultable());
// printf("decor defaultable: %d\n", fLookAndFeelSettings->IsDefaultable());
return fColorsView->IsDefaultable()
|| fFontSettings->IsDefaultable()
|| fAntialiasingSettings->IsDefaultable()
|| fDecorSettings->IsDefaultable();
|| fLookAndFeelSettings->IsDefaultable();
}
@ -141,9 +141,9 @@ APRWindow::_IsRevertable() const
// printf("fonts revertable: %d\n", fFontSettings->IsRevertable());
// printf("colors revertable: %d\n", fColorsView->IsRevertable());
// printf("AA revertable: %d\n", fAntialiasingSettings->IsRevertable());
// printf("decor revertable: %d\n", fDecorSettings->IsRevertable());
// printf("decor revertable: %d\n", fLookAndFeelSettings->IsRevertable());
return fColorsView->IsRevertable()
|| fFontSettings->IsRevertable()
|| fAntialiasingSettings->IsRevertable()
|| fDecorSettings->IsRevertable();
|| fLookAndFeelSettings->IsRevertable();
}

View File

@ -20,7 +20,7 @@
class APRView;
class AntialiasingSettingsView;
class FontView;
class DecorSettingsView;
class LookAndFeelSettingsView;
class APRWindow : public BWindow {
@ -39,7 +39,7 @@ private:
AntialiasingSettingsView* fAntialiasingSettings;
FontView* fFontSettings;
DecorSettingsView* fDecorSettings;
LookAndFeelSettingsView* fLookAndFeelSettings;
};

View File

@ -9,7 +9,7 @@ Includes [ FGristFiles AntialiasingSettingsView.cpp ]
Preference Appearance :
APRMain.cpp
AntialiasingSettingsView.cpp
DecorSettingsView.cpp
LookAndFeelSettingsView.cpp
FontSelectionView.cpp
FontView.cpp
APRView.cpp
@ -40,7 +40,7 @@ DoCatalogs Appearance :
ColorSet.cpp
ColorWell.cpp
ColorWhichItem.cpp
DecorSettingsView.cpp
LookAndFeelSettingsView.cpp
FontView.cpp
FontSelectionView.cpp
;

View File

@ -5,10 +5,11 @@
* Authors:
* Alexander von Gluck, kallisti5@unixzen.com
* Stephan Aßmus <superstippi@gmx.de>
* Ryan Leavengood <leavengood@gmail.com>
*/
#include "DecorSettingsView.h"
#include "LookAndFeelSettingsView.h"
#include <stdio.h>
#include <stdlib.h>
@ -34,6 +35,7 @@
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DecorSettingsView"
// This was not renamed to keep from breaking translations
static const int32 kMsgSetDecor = 'deco';
@ -46,7 +48,7 @@ static const bool kDefaultDoubleScrollbarArrowsSetting = false;
// #pragma mark -
DecorSettingsView::DecorSettingsView(const char* name)
LookAndFeelSettingsView::LookAndFeelSettingsView(const char* name)
:
BView(name, 0),
fDecorInfoButton(NULL),
@ -85,13 +87,13 @@ DecorSettingsView::DecorSettingsView(const char* name)
}
DecorSettingsView::~DecorSettingsView()
LookAndFeelSettingsView::~LookAndFeelSettingsView()
{
}
void
DecorSettingsView::AttachedToWindow()
LookAndFeelSettingsView::AttachedToWindow()
{
if (Parent() != NULL)
SetViewColor(Parent()->ViewColor());
@ -105,7 +107,7 @@ DecorSettingsView::AttachedToWindow()
void
DecorSettingsView::MessageReceived(BMessage *msg)
LookAndFeelSettingsView::MessageReceived(BMessage *msg)
{
switch (msg->what) {
case kMsgSetDecor:
@ -139,7 +141,7 @@ DecorSettingsView::MessageReceived(BMessage *msg)
BAlert *infoAlert = new BAlert(B_TRANSLATE("About Decorator"),
infoText.String(), B_TRANSLATE("OK"));
infoAlert->SetFlags(infoAlert->Flags() | B_CLOSE_ON_ESCAPE);
infoAlert->Go();
infoAlert->Go();
break;
}
@ -155,7 +157,7 @@ DecorSettingsView::MessageReceived(BMessage *msg)
void
DecorSettingsView::_BuildDecorMenu()
LookAndFeelSettingsView::_BuildDecorMenu()
{
fDecorMenu = new BPopUpMenu(B_TRANSLATE("Choose Decorator"));
@ -184,24 +186,24 @@ DecorSettingsView::_BuildDecorMenu()
void
DecorSettingsView::_SetDecor(const BString& name)
LookAndFeelSettingsView::_SetDecor(const BString& name)
{
_SetDecor(fDecorUtility.FindDecorator(name));
}
}
void
DecorSettingsView::_SetDecor(DecorInfo* decorInfo)
LookAndFeelSettingsView::_SetDecor(DecorInfo* decorInfo)
{
if (fDecorUtility.SetDecorator(decorInfo) == B_OK) {
_AdoptToCurrentDecor();
Window()->PostMessage(kMsgUpdate);
}
}
}
void
DecorSettingsView::_AdoptToCurrentDecor()
LookAndFeelSettingsView::_AdoptToCurrentDecor()
{
fCurrentDecor = fDecorUtility.CurrentDecorator()->Name();
if (fSavedDecor.Length() == 0)
@ -210,7 +212,7 @@ DecorSettingsView::_AdoptToCurrentDecor()
}
void
DecorSettingsView::_AdoptInterfaceToCurrentDecor()
LookAndFeelSettingsView::_AdoptInterfaceToCurrentDecor()
{
BMenuItem* item = fDecorMenu->FindItem(fCurrentDecor);
if (item != NULL)
@ -219,7 +221,7 @@ DecorSettingsView::_AdoptInterfaceToCurrentDecor()
bool
DecorSettingsView::_GetDoubleScrollbarArrowsSetting()
LookAndFeelSettingsView::_GetDoubleScrollbarArrowsSetting()
{
scroll_bar_info info;
get_scroll_bar_info(&info);
@ -229,7 +231,7 @@ DecorSettingsView::_GetDoubleScrollbarArrowsSetting()
void
DecorSettingsView::_SetDoubleScrollbarArrowsSetting(bool value)
LookAndFeelSettingsView::_SetDoubleScrollbarArrowsSetting(bool value)
{
scroll_bar_info info;
get_scroll_bar_info(&info);
@ -242,7 +244,7 @@ DecorSettingsView::_SetDoubleScrollbarArrowsSetting(bool value)
void
DecorSettingsView::SetDefaults()
LookAndFeelSettingsView::SetDefaults()
{
_SetDecor(fDecorUtility.DefaultDecorator());
_SetDoubleScrollbarArrowsSetting(kDefaultDoubleScrollbarArrowsSetting);
@ -252,7 +254,7 @@ DecorSettingsView::SetDefaults()
bool
DecorSettingsView::IsDefaultable()
LookAndFeelSettingsView::IsDefaultable()
{
return fCurrentDecor != fDecorUtility.DefaultDecorator()->Name() ||
fDoubleScrollbarArrowsCheckBox->Value() !=
@ -261,7 +263,7 @@ DecorSettingsView::IsDefaultable()
bool
DecorSettingsView::IsRevertable()
LookAndFeelSettingsView::IsRevertable()
{
return fCurrentDecor != fSavedDecor ||
fDoubleScrollbarArrowsCheckBox->Value() != fSavedDoubleArrowsValue;
@ -269,7 +271,7 @@ DecorSettingsView::IsRevertable()
void
DecorSettingsView::Revert()
LookAndFeelSettingsView::Revert()
{
_SetDecor(fSavedDecor);
_SetDoubleScrollbarArrowsSetting(fSavedDoubleArrowsValue);

View File

@ -5,9 +5,10 @@
* Authors:
* Alexander von Gluck, kallisti5@unixzen.com
* Stephan Aßmus <superstippi@gmx.de>
* Ryan Leavengood <leavengood@gmail.com>
*/
#ifndef DECOR_SETTINGS_VIEW_H
#define DECOR_SETTINGS_VIEW_H
#ifndef LOOK_AND_FEEL_SETTINGS_VIEW_H
#define LOOK_AND_FEEL_SETTINGS_VIEW_H
#include <DecorInfo.h>
@ -21,10 +22,10 @@ class BMenuField;
class BPopUpMenu;
class DecorSettingsView : public BView {
class LookAndFeelSettingsView : public BView {
public:
DecorSettingsView(const char* name);
virtual ~DecorSettingsView();
LookAndFeelSettingsView(const char* name);
virtual ~LookAndFeelSettingsView();
virtual void AttachedToWindow();
virtual void MessageReceived(BMessage* message);
@ -57,4 +58,4 @@ private:
bool fSavedDoubleArrowsValue;
};
#endif // DECOR_SETTINGS_VIEW_H
#endif // LOOK_AND_FEEL_SETTINGS_VIEW_H