Tracker: style fixes to AutoMounterSettings
This commit is contained in:
parent
7ec2c512ff
commit
6290bdf89c
@ -53,12 +53,14 @@ All rights reserved.
|
|||||||
#include <MountServer.h>
|
#include <MountServer.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "AutoMounterSettings"
|
||||||
|
|
||||||
|
|
||||||
const uint32 kAutomountSettingsChanged = 'achg';
|
const uint32 kAutomountSettingsChanged = 'achg';
|
||||||
const uint32 kBootMountSettingsChanged = 'bchg';
|
const uint32 kBootMountSettingsChanged = 'bchg';
|
||||||
const uint32 kEjectWhenUnmountingChanged = 'ejct';
|
const uint32 kEjectWhenUnmountingChanged = 'ejct';
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
|
||||||
#define B_TRANSLATION_CONTEXT "AutoMounterSettings"
|
|
||||||
|
|
||||||
class AutomountSettingsPanel : public BBox {
|
class AutomountSettingsPanel : public BBox {
|
||||||
public:
|
public:
|
||||||
@ -96,8 +98,11 @@ private:
|
|||||||
AutomountSettingsDialog* AutomountSettingsDialog::sOneCopyOnly = NULL;
|
AutomountSettingsDialog* AutomountSettingsDialog::sOneCopyOnly = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - AutomountSettingsPanel
|
||||||
|
|
||||||
|
|
||||||
AutomountSettingsPanel::AutomountSettingsPanel(BMessage* settings,
|
AutomountSettingsPanel::AutomountSettingsPanel(BMessage* settings,
|
||||||
const BMessenger& target)
|
const BMessenger& target)
|
||||||
:
|
:
|
||||||
BBox("", B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, B_NO_BORDER),
|
BBox("", B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, B_NO_BORDER),
|
||||||
fTarget(target)
|
fTarget(target)
|
||||||
@ -164,6 +169,7 @@ AutomountSettingsPanel::AutomountSettingsPanel(BMessage* settings,
|
|||||||
fDone->MakeDefault(true);
|
fDone->MakeDefault(true);
|
||||||
|
|
||||||
// Layout the controls
|
// Layout the controls
|
||||||
|
|
||||||
BGroupView* contentView = new BGroupView(B_VERTICAL, 0);
|
BGroupView* contentView = new BGroupView(B_VERTICAL, 0);
|
||||||
AddChild(contentView);
|
AddChild(contentView);
|
||||||
BLayoutBuilder::Group<>(contentView)
|
BLayoutBuilder::Group<>(contentView)
|
||||||
@ -293,15 +299,15 @@ AutomountSettingsPanel::_SendSettings(bool rescan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - AutomountSettingsDialog
|
||||||
|
|
||||||
|
|
||||||
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
||||||
const BMessenger& target)
|
const BMessenger& target)
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 320, 370), B_TRANSLATE("Disk mount settings"),
|
BWindow(BRect(100, 100, 320, 370), B_TRANSLATE("Disk mount settings"),
|
||||||
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
|
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
|
||||||
| B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
BView* view = new AutomountSettingsPanel(settings, target);
|
BView* view = new AutomountSettingsPanel(settings, target);
|
||||||
@ -323,15 +329,14 @@ void
|
|||||||
AutomountSettingsDialog::RunAutomountSettings(const BMessenger& target)
|
AutomountSettingsDialog::RunAutomountSettings(const BMessenger& target)
|
||||||
{
|
{
|
||||||
// either activate an existing mount settings dialog or create a new one
|
// either activate an existing mount settings dialog or create a new one
|
||||||
if (sOneCopyOnly) {
|
if (sOneCopyOnly != NULL) {
|
||||||
sOneCopyOnly->Activate();
|
sOneCopyOnly->Activate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BMessage message(kGetAutomounterParams);
|
BMessage message(kGetAutomounterParams);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
status_t ret = target.SendMessage(&message, &reply, 2500000);
|
if (target.SendMessage(&message, &reply, 2500000) != B_OK) {
|
||||||
if (ret != B_OK) {
|
|
||||||
BAlert* alert = new BAlert(B_TRANSLATE("Mount server error"),
|
BAlert* alert = new BAlert(B_TRANSLATE("Mount server error"),
|
||||||
B_TRANSLATE("The mount server could not be contacted."),
|
B_TRANSLATE("The mount server could not be contacted."),
|
||||||
B_TRANSLATE("OK"),
|
B_TRANSLATE("OK"),
|
||||||
|
@ -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 AUTOMOUNTER_SETTINGS_H
|
#ifndef _AUTOMOUNTER_SETTINGS_H
|
||||||
#define AUTOMOUNTER_SETTINGS_H
|
#define _AUTOMOUNTER_SETTINGS_H
|
||||||
|
|
||||||
|
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
@ -55,4 +55,5 @@ class AutomountSettingsDialog : public BWindow {
|
|||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
#endif // AUTOMOUNTER_SETTINGS_H
|
|
||||||
|
#endif // _AUTOMOUNTER_SETTINGS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user