playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
new StandardPLPanel( this, p_intf, p_playlist, p_playlist->p_root_category );
+ readSettings( "playlist", QSize( 500,500 ) );
}
PlaylistDialog::~PlaylistDialog()
{
+ writeSettings( "playlist" );
}
#include <assert.h>
#include <QPushButton>
-MainInterface::MainInterface( intf_thread_t *_p_intf ) : QMainWindow(),
- p_intf( _p_intf )
+MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
/* All UI stuff */
- QVLCFrame::fixStyle( this );
QWidget *main = new QWidget( this );
setCentralWidget( main );
setWindowTitle( QString::fromUtf8( _("VLC media player") ) );
ui.volLowLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
ui.volHighLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
-
// if( config_GetInt( p_intf, "embedded" ) )
{
videoWidget = new VideoWidget( p_intf );
videoWidget->resize( 1,1 );
ui.vboxLayout->insertWidget( 0, videoWidget );
}
- resize( QSize( 500, 121 ) );
- i_saved_width = width();
- i_saved_height = height();
+
+ readSettings( "MainWindow" , QSize( 500, 131) );
//QVLCMenu::createMenuBar();
#include <QWidget>
#include <QApplication>
+#include <QSettings>
+#include <QMainWindow>
#include <QPlastiqueStyle>
#include <vlc/vlc.h>
QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )
{
fixStyle( this );
- };
+ };
virtual ~QVLCFrame() {};
void toggleVisible()
}
protected:
intf_thread_t *p_intf;
+
+ void readSettings( QString name, QSize defSize )
+ {
+ QSettings settings( "VideoLAN", "VLC" );
+ settings.beginGroup( name );
+ resize( settings.value( "size", defSize ).toSize() );
+ move( settings.value( "pos", QPoint( 0,0 ) ).toPoint() );
+ settings.endGroup();
+ }
+ void writeSettings( QString name )
+ {
+ QSettings settings( "VideoLAN", "VLC" );
+ settings.beginGroup( name );
+ settings.setValue ("size", size() );
+ settings.setValue( "pos", pos() );
+ settings.endGroup();
+ }
};
+
+class QVLCMW : public QMainWindow
+{
+public:
+ QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf )
+ {
+ QVLCFrame::fixStyle( this );
+ }
+ virtual ~QVLCMW() {};
+protected:
+ intf_thread_t *p_intf;
+ QSize mainSize;
+
+ void readSettings( QString name, QSize defSize )
+ {
+ QSettings settings( "VideoLAN", "VLC" );
+ settings.beginGroup( name );
+ mainSize = settings.value( "size", defSize ).toSize();
+ resize( mainSize );
+ move( settings.value( "pos", QPoint( 0,0 ) ).toPoint() );
+ settings.endGroup();
+ }
+ void writeSettings( QString name )
+ {
+ QSettings settings( "VideoLAN", "VLC" );
+ settings.beginGroup( name );
+ settings.setValue ("size", size() );
+ settings.setValue( "pos", pos() );
+ settings.endGroup();
+ }
+};
+
#endif