void ShowImageWindow::_LoadSettings() { ShowImageSettings* settings = my_app->Settings(); if (settings->Lock()) { fShowCaption = settings->GetBool("ShowCaption", fShowCaption); fPrintOptions.SetBounds(BRect(0, 0, 1023, 767)); int32 op = settings->GetInt32("PO:Option", fPrintOptions.Option()); fPrintOptions.SetOption((enum PrintOptions::Option)op); float f = settings->GetFloat("PO:ZoomFactor", fPrintOptions.ZoomFactor()); fPrintOptions.SetZoomFactor(f); f = settings->GetFloat("PO:DPI", fPrintOptions.DPI()); fPrintOptions.SetDPI(f); f = settings->GetFloat("PO:Width", fPrintOptions.Width()); fPrintOptions.SetWidth(f); f = settings->GetFloat("PO:Height", fPrintOptions.Height()); fPrintOptions.SetHeight(f); settings->Unlock(); } }
void ShowImageWindow::_ApplySettings() { ShowImageSettings* settings = my_app->Settings(); if (settings->Lock()) { fShowCaption = settings->GetBool("ShowCaption", fShowCaption); fPrintOptions.SetBounds(BRect(0, 0, 1023, 767)); fSlideShowDelay = settings->GetTime("SlideShowDelay", fSlideShowDelay); fPrintOptions.SetOption((enum PrintOptions::Option)settings->GetInt32( "PO:Option", fPrintOptions.Option())); fPrintOptions.SetZoomFactor( settings->GetFloat("PO:ZoomFactor", fPrintOptions.ZoomFactor())); fPrintOptions.SetDPI(settings->GetFloat("PO:DPI", fPrintOptions.DPI())); fPrintOptions.SetWidth( settings->GetFloat("PO:Width", fPrintOptions.Width())); fPrintOptions.SetHeight( settings->GetFloat("PO:Height", fPrintOptions.Height())); fShowToolBar = settings->GetBool("ShowToolBar", fShowToolBar); settings->Unlock(); } }