Пример #1
0
void
ConfigWindow::LoadSettings()
{
	Accounts::Delete();
	Accounts::Create(fAccountsListView,fConfigView);

	// load in general settings
	BMailSettings *settings = new BMailSettings();
	status_t status = SetToGeneralSettings(settings);
	if (status == B_OK)
	{
		// adjust own window frame
		BScreen screen(this);
		BRect screenFrame(screen.Frame().InsetByCopy(0,5));
		BRect frame(settings->ConfigWindowFrame());

		if (screenFrame.Contains(frame.LeftTop()))
			MoveTo(frame.LeftTop());
		else // center on screen
			MoveTo((screenFrame.Width() - frame.Width()) / 2,(screenFrame.Height() - frame.Height()) / 2);
	}
	else
		fprintf(stderr, MDR_DIALECT_CHOICE (
			"Error retrieving general settings: %s\n",
			"一般設定の収得に失敗: %s\n"),
			strerror(status));

	delete settings;
}
Пример #2
0
void
ConfigWindow::LoadSettings()
{
    Accounts::Delete();
    Accounts::Create(fAccountsListView, fConfigView);

    // load in general settings
    BMailSettings settings;
    status_t status = SetToGeneralSettings(&settings);
    if (status == B_OK) {
        // move own window
        MoveTo(settings.ConfigWindowFrame().LeftTop());
    } else {
        fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
                strerror(status));
    }

    BScreen screen(this);
    BRect screenFrame(screen.Frame().InsetByCopy(0, 5));
    if (!screenFrame.Contains(Frame().LeftTop())
            || !screenFrame.Contains(Frame().RightBottom()))
        status = B_ERROR;

    if (status != B_OK) {
        // center window on screen
        MoveTo((screenFrame.Width() - Frame().Width()) / 2,
               (screenFrame.Height() - Frame().Height()) / 2);
    }
}
Пример #3
0
void
ConfigWindow::_LoadSettings()
{
	// load accounts
	for (int i = 0; i < fAccounts.CountItems(); i++)
		delete fAccounts.ItemAt(i);
	fAccounts.MakeEmpty();

	_LoadAccounts();

	// load in general settings
	BMailSettings settings;
	status_t status = _SetToGeneralSettings(&settings);
	if (status == B_OK) {
		// move own window
		MoveTo(settings.ConfigWindowFrame().LeftTop());
	} else {
		fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
			strerror(status));
	}

	BScreen screen(this);
	BRect screenFrame(screen.Frame().InsetByCopy(0, 5));
	if (!screenFrame.Contains(Frame().LeftTop())
		|| !screenFrame.Contains(Frame().RightBottom()))
		status = B_ERROR;

	if (status != B_OK) {
		// center window on screen
		MoveTo((screenFrame.Width() - Frame().Width()) / 2,
			(screenFrame.Height() - Frame().Height()) / 2);
	}
}