-/*****************************************************************************
- * InterfaceWindow::_RestoreSettings
- *****************************************************************************/
-void
-InterfaceWindow::_RestoreSettings()
-{
- if ( _LoadSettings( fSettings, "interface_settings", "VideoLAN Client" ) == B_OK )
- {
- BRect mainFrame;
- if ( fSettings->FindRect( "main frame", &mainFrame ) == B_OK )
- {
- // sanity checks: make sure window is not too big/small
- // and that it's not off-screen
- float minWidth, maxWidth, minHeight, maxHeight;
- GetSizeLimits( &minWidth, &maxWidth, &minHeight, &maxHeight );
-
- make_sure_frame_is_within_limits( mainFrame,
- minWidth, minHeight, maxWidth, maxHeight );
- make_sure_frame_is_on_screen( mainFrame );
-
-
- MoveTo( mainFrame.LeftTop() );
- ResizeTo( mainFrame.Width(), mainFrame.Height() );
- }
- if ( fPlaylistWindow->Lock() )
- {
- BRect playlistFrame;
- if (fSettings->FindRect( "playlist frame", &playlistFrame ) == B_OK )
- {
- // sanity checks: make sure window is not too big/small
- // and that it's not off-screen
- float minWidth, maxWidth, minHeight, maxHeight;
- fPlaylistWindow->GetSizeLimits( &minWidth, &maxWidth, &minHeight, &maxHeight );
-
- make_sure_frame_is_within_limits( playlistFrame,
- minWidth, minHeight, maxWidth, maxHeight );
- make_sure_frame_is_on_screen( playlistFrame );
-
- fPlaylistWindow->MoveTo( playlistFrame.LeftTop() );
- fPlaylistWindow->ResizeTo( playlistFrame.Width(), playlistFrame.Height() );
- }
-
- bool showing;
- if ( fSettings->FindBool( "playlist showing", &showing ) == B_OK )
- {
- if ( showing )
- {
- if ( fPlaylistWindow->IsHidden() )
- fPlaylistWindow->Show();
- }
- else
- {
- if ( !fPlaylistWindow->IsHidden() )
- fPlaylistWindow->Hide();
- }
- }
-
- fPlaylistWindow->Unlock();
- }
- }
-}
-
-/*****************************************************************************
- * InterfaceWindow::_StoreSettings
- *****************************************************************************/
-void
-InterfaceWindow::_StoreSettings()
-{
- if ( fSettings->ReplaceRect( "main frame", Frame() ) != B_OK )
- fSettings->AddRect( "main frame", Frame() );
- if ( fPlaylistWindow->Lock() )
- {
- if (fSettings->ReplaceRect( "playlist frame", fPlaylistWindow->Frame() ) != B_OK)
- fSettings->AddRect( "playlist frame", fPlaylistWindow->Frame() );
- if (fSettings->ReplaceBool( "playlist showing", !fPlaylistWindow->IsHidden() ) != B_OK)
- fSettings->AddBool( "playlist showing", !fPlaylistWindow->IsHidden() );
- fPlaylistWindow->Unlock();
- }
- _SaveSettings( fSettings, "interface_settings", "VideoLAN Client" );
-}
-