The E-mail window's frame is no longer stored.
* This is part of a clean up of BMailSettings; storing the window position might be implemented again later -- it just doesn't belong there. * Changed the logic when the daemon is set to auto start. It's now always started if at least a single account exists.
This commit is contained in:
parent
4a8448ce34
commit
19d947eb7f
@ -409,22 +409,12 @@ ConfigWindow::_LoadSettings()
|
|||||||
// load in general settings
|
// load in general settings
|
||||||
BMailSettings settings;
|
BMailSettings settings;
|
||||||
status_t status = _SetToGeneralSettings(&settings);
|
status_t status = _SetToGeneralSettings(&settings);
|
||||||
if (status == B_OK) {
|
if (status != B_OK) {
|
||||||
// move own window
|
|
||||||
MoveTo(settings.ConfigWindowFrame().LeftTop());
|
|
||||||
} else {
|
|
||||||
fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
|
fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
|
||||||
strerror(status));
|
strerror(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
BScreen screen(this);
|
CenterOnScreen();
|
||||||
BRect screenFrame(screen.Frame().InsetByCopy(0, 5));
|
|
||||||
if (!screenFrame.Contains(Frame().LeftTop())
|
|
||||||
|| !screenFrame.Contains(Frame().RightBottom()))
|
|
||||||
status = B_ERROR;
|
|
||||||
|
|
||||||
if (status != B_OK)
|
|
||||||
CenterOnScreen();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -466,9 +456,8 @@ ConfigWindow::_SaveSettings()
|
|||||||
}
|
}
|
||||||
fToDeleteAccounts.MakeEmpty();
|
fToDeleteAccounts.MakeEmpty();
|
||||||
|
|
||||||
/*** save general settings ***/
|
// Apply and save general settings
|
||||||
|
|
||||||
// apply and save general settings
|
|
||||||
BMailSettings settings;
|
BMailSettings settings;
|
||||||
if (fSaveSettings) {
|
if (fSaveSettings) {
|
||||||
// figure out time interval
|
// figure out time interval
|
||||||
@ -477,21 +466,17 @@ ConfigWindow::_SaveSettings()
|
|||||||
bigtime_t interval = bigtime_t(60000000L * floatInterval);
|
bigtime_t interval = bigtime_t(60000000L * floatInterval);
|
||||||
|
|
||||||
settings.SetAutoCheckInterval(interval);
|
settings.SetAutoCheckInterval(interval);
|
||||||
settings.SetDaemonAutoStarts(interval != 0);
|
settings.SetDaemonAutoStarts(!fAccounts.IsEmpty());
|
||||||
|
|
||||||
// status mode (alway, fetching/retrieving, ...)
|
// status mode (alway, fetching/retrieving, ...)
|
||||||
int32 index = fStatusModeField->Menu()->IndexOf(
|
int32 index = fStatusModeField->Menu()->IndexOf(
|
||||||
fStatusModeField->Menu()->FindMarked());
|
fStatusModeField->Menu()->FindMarked());
|
||||||
settings.SetShowStatusWindow(index);
|
settings.SetShowStatusWindow(index);
|
||||||
} else {
|
|
||||||
// restore status window look
|
settings.Save();
|
||||||
settings.SetStatusWindowLook(settings.StatusWindowLook());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.SetConfigWindowFrame(Frame());
|
// Save accounts
|
||||||
settings.Save();
|
|
||||||
|
|
||||||
/*** save accounts ***/
|
|
||||||
|
|
||||||
if (fSaveSettings) {
|
if (fSaveSettings) {
|
||||||
for (int i = 0; i < fAccounts.CountItems(); i++)
|
for (int i = 0; i < fAccounts.CountItems(); i++)
|
||||||
@ -703,8 +688,7 @@ ConfigWindow::_SetToGeneralSettings(BMailSettings* settings)
|
|||||||
|
|
||||||
// retrieval frequency
|
// retrieval frequency
|
||||||
uint32 interval = uint32(settings->AutoCheckInterval() / 60000000L);
|
uint32 interval = uint32(settings->AutoCheckInterval() / 60000000L);
|
||||||
fCheckMailCheckBox->SetValue(settings->DaemonAutoStarts()
|
fCheckMailCheckBox->SetValue(interval != 0 ? B_CONTROL_ON : B_CONTROL_OFF);
|
||||||
&& interval != 0 ? B_CONTROL_ON : B_CONTROL_OFF);
|
|
||||||
|
|
||||||
if (interval == 0)
|
if (interval == 0)
|
||||||
interval = 5;
|
interval = 5;
|
||||||
@ -733,9 +717,6 @@ ConfigWindow::_RevertToLastSettings()
|
|||||||
// revert general settings
|
// revert general settings
|
||||||
BMailSettings settings;
|
BMailSettings settings;
|
||||||
|
|
||||||
// restore status window look
|
|
||||||
settings.SetStatusWindowLook(settings.StatusWindowLook());
|
|
||||||
|
|
||||||
status_t status = _SetToGeneralSettings(&settings);
|
status_t status = _SetToGeneralSettings(&settings);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
char text[256];
|
char text[256];
|
||||||
|
Loading…
Reference in New Issue
Block a user