Tracker: style fixes to SettingsViews classes

This commit is contained in:
John Scipione
2014-06-20 21:29:36 -04:00
parent b2ee107be9
commit f435b67810
2 changed files with 104 additions and 94 deletions
+20 -11
View File
@@ -83,12 +83,13 @@ send_bool_notices(uint32 what, const char* name, bool value)
} }
// #pragma mark -
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "SettingsView" #define B_TRANSLATION_CONTEXT "SettingsView"
// #pragma mark - SettingsView
SettingsView::SettingsView(const char* name) SettingsView::SettingsView(const char* name)
: :
BGroupView(name) BGroupView(name)
@@ -169,7 +170,7 @@ SettingsView::IsRevertable() const
} }
// #pragma mark - // #pragma mark - DesktopSettingsView
DesktopSettingsView::DesktopSettingsView() DesktopSettingsView::DesktopSettingsView()
@@ -256,7 +257,8 @@ DesktopSettingsView::MessageReceived(BMessage* message)
fMountSharedVolumesOntoDesktopCheckBox->Value() == 1); fMountSharedVolumesOntoDesktopCheckBox->Value() == 1);
// Send the notification message: // Send the notification message:
tracker->SendNotices(kVolumesOnDesktopChanged, &notificationMessage); tracker->SendNotices(kVolumesOnDesktopChanged,
&notificationMessage);
// Tell the settings window the contents have changed: // Tell the settings window the contents have changed:
Window()->PostMessage(kSettingsContentsModified); Window()->PostMessage(kSettingsContentsModified);
@@ -288,7 +290,8 @@ DesktopSettingsView::MessageReceived(BMessage* message)
fMountSharedVolumesOntoDesktopCheckBox->Value() == 1); fMountSharedVolumesOntoDesktopCheckBox->Value() == 1);
// Send the notification message: // Send the notification message:
tracker->SendNotices(kVolumesOnDesktopChanged, &notificationMessage); tracker->SendNotices(kVolumesOnDesktopChanged,\
&notificationMessage);
// Tell the settings window the contents have changed: // Tell the settings window the contents have changed:
Window()->PostMessage(kSettingsContentsModified); Window()->PostMessage(kSettingsContentsModified);
@@ -297,6 +300,7 @@ DesktopSettingsView::MessageReceived(BMessage* message)
default: default:
_inherited::MessageReceived(message); _inherited::MessageReceived(message);
break;
} }
} }
@@ -405,7 +409,7 @@ DesktopSettingsView::IsRevertable() const
} }
// #pragma mark - // #pragma mark - WindowsSettingsView
WindowsSettingsView::WindowsSettingsView() WindowsSettingsView::WindowsSettingsView()
@@ -473,8 +477,9 @@ void
WindowsSettingsView::MessageReceived(BMessage* message) WindowsSettingsView::MessageReceived(BMessage* message)
{ {
TTracker* tracker = dynamic_cast<TTracker*>(be_app); TTracker* tracker = dynamic_cast<TTracker*>(be_app);
if (!tracker) if (tracker == NULL)
return; return;
TrackerSettings settings; TrackerSettings settings;
switch (message->what) { switch (message->what) {
@@ -703,7 +708,7 @@ WindowsSettingsView::IsRevertable() const
} }
// #pragma mark - // #pragma mark - SpaceBarSettingsView
SpaceBarSettingsView::SpaceBarSettingsView() SpaceBarSettingsView::SpaceBarSettingsView()
@@ -791,9 +796,11 @@ SpaceBarSettingsView::MessageReceived(BMessage* message)
case 0: case 0:
fColorControl->SetValue(settings.UsedSpaceColor()); fColorControl->SetValue(settings.UsedSpaceColor());
break; break;
case 1: case 1:
fColorControl->SetValue(settings.FreeSpaceColor()); fColorControl->SetValue(settings.FreeSpaceColor());
break; break;
case 2: case 2:
fColorControl->SetValue(settings.WarningSpaceColor()); fColorControl->SetValue(settings.WarningSpaceColor());
break; break;
@@ -812,9 +819,11 @@ SpaceBarSettingsView::MessageReceived(BMessage* message)
case 0: case 0:
settings.SetUsedSpaceColor(color); settings.SetUsedSpaceColor(color);
break; break;
case 1: case 1:
settings.SetFreeSpaceColor(color); settings.SetFreeSpaceColor(color);
break; break;
case 2: case 2:
settings.SetWarningSpaceColor(color); settings.SetWarningSpaceColor(color);
break; break;
@@ -836,7 +845,7 @@ void
SpaceBarSettingsView::SetDefaults() SpaceBarSettingsView::SetDefaults()
{ {
TTracker* tracker = dynamic_cast<TTracker*>(be_app); TTracker* tracker = dynamic_cast<TTracker*>(be_app);
if (!tracker) if (tracker == NULL)
return; return;
TrackerSettings settings; TrackerSettings settings;
@@ -875,7 +884,7 @@ void
SpaceBarSettingsView::Revert() SpaceBarSettingsView::Revert()
{ {
TTracker* tracker = dynamic_cast<TTracker*>(be_app); TTracker* tracker = dynamic_cast<TTracker*>(be_app);
if (!tracker) if (tracker == NULL)
return; return;
TrackerSettings settings; TrackerSettings settings;
+12 -11
View File
@@ -31,8 +31,8 @@ of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders. names are registered trademarks or trademarks of their respective holders.
All rights reserved. All rights reserved.
*/ */
#ifndef _SETTINGS_VIEWS #ifndef _SETTINGS_VIEWS_H
#define _SETTINGS_VIEWS #define _SETTINGS_VIEWS_H
#include <GroupView.h> #include <GroupView.h>
@@ -54,7 +54,7 @@ class BStringView;
namespace BPrivate { namespace BPrivate {
class SettingsView : public BGroupView { class SettingsView : public BGroupView {
public: public:
SettingsView(const char* name); SettingsView(const char* name);
virtual ~SettingsView(); virtual ~SettingsView();
@@ -65,13 +65,13 @@ class SettingsView : public BGroupView {
virtual void RecordRevertSettings(); virtual void RecordRevertSettings();
virtual bool IsRevertable() const; virtual bool IsRevertable() const;
protected: protected:
typedef BGroupView _inherited; typedef BGroupView _inherited;
}; };
class DesktopSettingsView : public SettingsView { class DesktopSettingsView : public SettingsView {
public: public:
DesktopSettingsView(); DesktopSettingsView();
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
@@ -84,7 +84,7 @@ class DesktopSettingsView : public SettingsView {
virtual void RecordRevertSettings(); virtual void RecordRevertSettings();
virtual bool IsRevertable() const; virtual bool IsRevertable() const;
private: private:
void _SendNotices(); void _SendNotices();
BRadioButton* fShowDisksIconRadioButton; BRadioButton* fShowDisksIconRadioButton;
@@ -104,7 +104,7 @@ class DesktopSettingsView : public SettingsView {
class WindowsSettingsView : public SettingsView { class WindowsSettingsView : public SettingsView {
public: public:
WindowsSettingsView(); WindowsSettingsView();
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
@@ -117,7 +117,7 @@ class WindowsSettingsView : public SettingsView {
virtual void RecordRevertSettings(); virtual void RecordRevertSettings();
virtual bool IsRevertable() const; virtual bool IsRevertable() const;
private: private:
BCheckBox* fShowFullPathInTitleBarCheckBox; BCheckBox* fShowFullPathInTitleBarCheckBox;
BCheckBox* fSingleWindowBrowseCheckBox; BCheckBox* fSingleWindowBrowseCheckBox;
BCheckBox* fShowNavigatorCheckBox; BCheckBox* fShowNavigatorCheckBox;
@@ -138,7 +138,7 @@ class WindowsSettingsView : public SettingsView {
class SpaceBarSettingsView : public SettingsView { class SpaceBarSettingsView : public SettingsView {
public: public:
SpaceBarSettingsView(); SpaceBarSettingsView();
virtual ~SpaceBarSettingsView(); virtual ~SpaceBarSettingsView();
@@ -152,7 +152,7 @@ class SpaceBarSettingsView : public SettingsView {
virtual void RecordRevertSettings(); virtual void RecordRevertSettings();
virtual bool IsRevertable() const; virtual bool IsRevertable() const;
private: private:
BCheckBox* fSpaceBarShowCheckBox; BCheckBox* fSpaceBarShowCheckBox;
BColorControl* fColorControl; BColorControl* fColorControl;
BMenuField* fColorPicker; BMenuField* fColorPicker;
@@ -170,4 +170,5 @@ class SpaceBarSettingsView : public SettingsView {
using namespace BPrivate; using namespace BPrivate;
#endif // _SETTINGS_VIEWS
#endif // _SETTINGS_VIEWS_H