Tracker: style fixes to SettingsViews classes
This commit is contained in:
@@ -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, ¬ificationMessage);
|
tracker->SendNotices(kVolumesOnDesktopChanged,
|
||||||
|
¬ificationMessage);
|
||||||
|
|
||||||
// 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, ¬ificationMessage);
|
tracker->SendNotices(kVolumesOnDesktopChanged,\
|
||||||
|
¬ificationMessage);
|
||||||
|
|
||||||
// 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;
|
||||||
|
|||||||
@@ -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,120 +54,121 @@ 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();
|
||||||
|
|
||||||
virtual void SetDefaults();
|
virtual void SetDefaults();
|
||||||
virtual bool IsDefaultable() const;
|
virtual bool IsDefaultable() const;
|
||||||
virtual void Revert();
|
virtual void Revert();
|
||||||
virtual void ShowCurrentSettings();
|
virtual void ShowCurrentSettings();
|
||||||
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);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
|
||||||
virtual void SetDefaults();
|
virtual void SetDefaults();
|
||||||
virtual bool IsDefaultable() const;
|
virtual bool IsDefaultable() const;
|
||||||
virtual void Revert();
|
virtual void Revert();
|
||||||
virtual void ShowCurrentSettings();
|
virtual void ShowCurrentSettings();
|
||||||
virtual void RecordRevertSettings();
|
virtual void RecordRevertSettings();
|
||||||
virtual bool IsRevertable() const;
|
virtual bool IsRevertable() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _SendNotices();
|
void _SendNotices();
|
||||||
|
|
||||||
BRadioButton* fShowDisksIconRadioButton;
|
BRadioButton* fShowDisksIconRadioButton;
|
||||||
BRadioButton* fMountVolumesOntoDesktopRadioButton;
|
BRadioButton* fMountVolumesOntoDesktopRadioButton;
|
||||||
BCheckBox* fMountSharedVolumesOntoDesktopCheckBox;
|
BCheckBox* fMountSharedVolumesOntoDesktopCheckBox;
|
||||||
BCheckBox* fIntegrateNonBootBeOSDesktopsCheckBox;
|
BCheckBox* fIntegrateNonBootBeOSDesktopsCheckBox;
|
||||||
BButton* fMountButton;
|
BButton* fMountButton;
|
||||||
|
|
||||||
bool fShowDisksIcon;
|
bool fShowDisksIcon;
|
||||||
bool fMountVolumesOntoDesktop;
|
bool fMountVolumesOntoDesktop;
|
||||||
bool fMountSharedVolumesOntoDesktop;
|
bool fMountSharedVolumesOntoDesktop;
|
||||||
bool fIntegrateNonBootBeOSDesktops;
|
bool fIntegrateNonBootBeOSDesktops;
|
||||||
bool fEjectWhenUnmounting;
|
bool fEjectWhenUnmounting;
|
||||||
|
|
||||||
typedef SettingsView _inherited;
|
typedef SettingsView _inherited;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class WindowsSettingsView : public SettingsView {
|
class WindowsSettingsView : public SettingsView {
|
||||||
public:
|
public:
|
||||||
WindowsSettingsView();
|
WindowsSettingsView();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
|
||||||
virtual void SetDefaults();
|
virtual void SetDefaults();
|
||||||
virtual bool IsDefaultable() const;
|
virtual bool IsDefaultable() const;
|
||||||
virtual void Revert();
|
virtual void Revert();
|
||||||
virtual void ShowCurrentSettings();
|
virtual void ShowCurrentSettings();
|
||||||
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;
|
||||||
BCheckBox* fShowSelectionWhenInactiveCheckBox;
|
BCheckBox* fShowSelectionWhenInactiveCheckBox;
|
||||||
BCheckBox* fOutlineSelectionCheckBox;
|
BCheckBox* fOutlineSelectionCheckBox;
|
||||||
BCheckBox* fSortFolderNamesFirstCheckBox;
|
BCheckBox* fSortFolderNamesFirstCheckBox;
|
||||||
BCheckBox* fTypeAheadFilteringCheckBox;
|
BCheckBox* fTypeAheadFilteringCheckBox;
|
||||||
|
|
||||||
bool fShowFullPathInTitleBar;
|
bool fShowFullPathInTitleBar;
|
||||||
bool fSingleWindowBrowse;
|
bool fSingleWindowBrowse;
|
||||||
bool fShowNavigator;
|
bool fShowNavigator;
|
||||||
bool fTransparentSelection;
|
bool fTransparentSelection;
|
||||||
bool fSortFolderNamesFirst;
|
bool fSortFolderNamesFirst;
|
||||||
bool fTypeAheadFiltering;
|
bool fTypeAheadFiltering;
|
||||||
|
|
||||||
typedef SettingsView _inherited;
|
typedef SettingsView _inherited;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SpaceBarSettingsView : public SettingsView {
|
class SpaceBarSettingsView : public SettingsView {
|
||||||
public:
|
public:
|
||||||
SpaceBarSettingsView();
|
SpaceBarSettingsView();
|
||||||
virtual ~SpaceBarSettingsView();
|
virtual ~SpaceBarSettingsView();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
|
||||||
virtual void SetDefaults();
|
virtual void SetDefaults();
|
||||||
virtual bool IsDefaultable() const;
|
virtual bool IsDefaultable() const;
|
||||||
virtual void Revert();
|
virtual void Revert();
|
||||||
virtual void ShowCurrentSettings();
|
virtual void ShowCurrentSettings();
|
||||||
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;
|
||||||
int32 fCurrentColor;
|
int32 fCurrentColor;
|
||||||
|
|
||||||
bool fSpaceBarShow;
|
bool fSpaceBarShow;
|
||||||
rgb_color fUsedSpaceColor;
|
rgb_color fUsedSpaceColor;
|
||||||
rgb_color fFreeSpaceColor;
|
rgb_color fFreeSpaceColor;
|
||||||
rgb_color fWarningSpaceColor;
|
rgb_color fWarningSpaceColor;
|
||||||
|
|
||||||
typedef SettingsView _inherited;
|
typedef SettingsView _inherited;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
#endif // _SETTINGS_VIEWS
|
|
||||||
|
#endif // _SETTINGS_VIEWS_H
|
||||||
|
|||||||
Reference in New Issue
Block a user