]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwidgets: save embedded playlist size on exit.
authorGildas Bazin <gbazin@videolan.org>
Wed, 7 Dec 2005 23:14:43 +0000 (23:14 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 7 Dec 2005 23:14:43 +0000 (23:14 +0000)
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.hpp

index 6c29628c5c2b7f0b121b53e7b2658926d292c141..08209a77abfa7e11dbe2a36f0764952367f6e198 100644 (file)
@@ -127,13 +127,28 @@ public:
 #else
                           wxCLIP_CHILDREN | wxSP_3DSASH ),
 #endif
-        p_intf(_p_intf), i_sash_position(150), i_width(-1),
-        b_video(0), i_delay(0)
+        p_intf(_p_intf), b_video(0), i_delay(0)
     {
         SetSashSize( 0 );
+
+        wxSize size = wxSize(-1, 150);
+        wxPoint p = wxPoint(0,0);
+        bool b_dummy;
+        WindowSettings *ws = p_intf->p_sys->p_window_settings;
+        ws->GetSettings( WindowSettings::ID_SMALL_PLAYLIST, b_dummy, p, size );
+
+        i_width = size.GetWidth();
+        i_sash_position = size.GetHeight();
+        b_show_on_start = !!p.x;
     }
 
-    virtual ~Splitter() {};
+    virtual ~Splitter()
+    {
+        WindowSettings *ws = p_intf->p_sys->p_window_settings;
+        ws->SetSettings( WindowSettings::ID_SMALL_PLAYLIST, true,
+                         wxPoint(!!GetWindow2(),0),
+                         wxSize(i_width, i_sash_position) );
+    };
 
     virtual bool Split( wxWindow* window1, wxWindow* window2 )
     {
@@ -151,6 +166,8 @@ public:
         return wxSplitterWindow::Unsplit( window );
     }
 
+    bool ShowOnStart() { return b_show_on_start; }
+
 private:
     DECLARE_EVENT_TABLE()
 
@@ -222,6 +239,7 @@ private:
     int i_width;
     vlc_bool_t b_video;
     mtime_t i_delay;
+    vlc_bool_t b_show_on_start;
 };
 
 BEGIN_EVENT_TABLE(Splitter, wxSplitterWindow)
@@ -446,6 +464,9 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
     if( config_GetInt( p_intf, "wx-extended" ) ) OnExtended( dummy );
 
     SetIntfMinSize();
+
+    /* Show embedded playlist if requested */
+    if( splitter->ShowOnStart() ) OnSmallPlaylist( dummy );
 }
 
 Interface::~Interface()
@@ -1165,11 +1186,9 @@ void Interface::TogglePlayButton( int i_playing_status )
 static int DoInteract( intf_thread_t *, interaction_dialog_t *, int )
 {
     fprintf( stderr, "Doing interaction \n" );
+    return VLC_SUCCESS;
 }
 
-
-
-
 #if wxUSE_DRAG_AND_DROP
 /*****************************************************************************
  * Definition of DragAndDrop class.
index 6476041fc2abb56c95c665659c04305b09665188..5ddacccd0bdab79610d546f808f54f8e3161c5b7 100644 (file)
@@ -191,6 +191,7 @@ namespace wxvlc
             ID_FILE_INFO,
             ID_BOOKMARKS,
             ID_VIDEO,
+            ID_SMALL_PLAYLIST,
             ID_MAX,
         };