Commit 61ea7a5c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Switch the HelpDialog to a QVLCFrame, save size/pos for it. Saze...

Qt4 - Switch the HelpDialog to a QVLCFrame, save size/pos for it. Saze size/pos for updateDialog ( noone care about size...). Switch about to a QVLCDialog to ensure better view. Ensure to destroy the QVLCFrame on quit.
Should close #1374.
parent 3757ba1e
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
HelpDialog *HelpDialog::instance = NULL; HelpDialog *HelpDialog::instance = NULL;
HelpDialog::HelpDialog( QWidget *parent, intf_thread_t *_p_intf ) HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
: QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "Help" ) ); setWindowTitle( qtr( "Help" ) );
setMinimumSize( 250, 300 ); setMinimumSize( 250, 300 );
...@@ -69,20 +69,23 @@ HelpDialog::HelpDialog( QWidget *parent, intf_thread_t *_p_intf ) ...@@ -69,20 +69,23 @@ HelpDialog::HelpDialog( QWidget *parent, intf_thread_t *_p_intf )
layout->addWidget( closeButton, 1, 3 ); layout->addWidget( closeButton, 1, 3 );
BUTTONACT( closeButton, close() ); BUTTONACT( closeButton, close() );
resize( 400, 450 ); readSettings( "Help", QSize( 400, 450 ) );
} }
HelpDialog::~HelpDialog() HelpDialog::~HelpDialog()
{ {
writeSettings( "Help" );
} }
void HelpDialog::close() void HelpDialog::close()
{ {
this->toggleVisible(); toggleVisible();
} }
AboutDialog *AboutDialog::instance = NULL; AboutDialog *AboutDialog::instance = NULL;
AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) AboutDialog::AboutDialog( QWidget *parent, intf_thread_t *_p_intf)
: QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "About" ) ); setWindowTitle( qtr( "About" ) );
resize( 600, 500 ); resize( 600, 500 );
...@@ -170,9 +173,10 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) ...@@ -170,9 +173,10 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
AboutDialog::~AboutDialog() AboutDialog::~AboutDialog()
{ {
} }
void AboutDialog::close() void AboutDialog::close()
{ {
this->toggleVisible(); toggleVisible();
} }
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
...@@ -199,7 +203,6 @@ UpdateDialog *UpdateDialog::instance = NULL; ...@@ -199,7 +203,6 @@ UpdateDialog *UpdateDialog::instance = NULL;
UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
setWindowTitle( qtr( "Update" ) ); setWindowTitle( qtr( "Update" ) );
resize( 120, 80 );
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
...@@ -223,6 +226,8 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -223,6 +226,8 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
p_update = update_New( p_intf ); p_update = update_New( p_intf );
b_checked = false; b_checked = false;
readSettings( "Update", QSize( 120, 80 ) );
/* Check for updates */ /* Check for updates */
UpdateOrDownload(); UpdateOrDownload();
} }
...@@ -230,6 +235,7 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -230,6 +235,7 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
UpdateDialog::~UpdateDialog() UpdateDialog::~UpdateDialog()
{ {
update_Delete( p_update ); update_Delete( p_update );
writeSettings( "Update" );
} }
void UpdateDialog::close() void UpdateDialog::close()
......
...@@ -36,41 +36,46 @@ class QLabel; ...@@ -36,41 +36,46 @@ class QLabel;
class QEvent; class QEvent;
class QPushButton; class QPushButton;
class HelpDialog : public QVLCDialog class HelpDialog : public QVLCFrame
{ {
Q_OBJECT; Q_OBJECT;
public: public:
static HelpDialog * getInstance( intf_thread_t *p_intf ) static HelpDialog * getInstance( intf_thread_t *p_intf )
{ {
if( !instance) if( !instance)
instance = new HelpDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf ); instance = new HelpDialog( p_intf );
return instance; return instance;
} }
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
virtual ~HelpDialog(); virtual ~HelpDialog();
private: private:
HelpDialog( QWidget *, intf_thread_t * ); HelpDialog( intf_thread_t * );
static HelpDialog *instance; static HelpDialog *instance;
public slots: public slots:
void close(); void close();
}; };
class AboutDialog : public QVLCFrame class AboutDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
static AboutDialog * getInstance( intf_thread_t *p_intf ) static AboutDialog * getInstance( intf_thread_t *p_intf )
{ {
if( !instance) if( !instance)
instance = new AboutDialog( p_intf ); instance = new AboutDialog( (QWidget *)p_intf->p_sys->p_mi,
p_intf );
return instance; return instance;
} }
virtual ~AboutDialog();
private: private:
AboutDialog( intf_thread_t * ); AboutDialog( QWidget *, intf_thread_t * );
virtual ~AboutDialog();
static AboutDialog *instance; static AboutDialog *instance;
public slots: public slots:
void close(); void close();
}; };
...@@ -90,12 +95,17 @@ public: ...@@ -90,12 +95,17 @@ public:
instance = new UpdateDialog( p_intf ); instance = new UpdateDialog( p_intf );
return instance; return instance;
} }
virtual ~UpdateDialog(); static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
void updateNotify( bool ); void updateNotify( bool );
private: private:
UpdateDialog( intf_thread_t * ); UpdateDialog( intf_thread_t * );
virtual ~UpdateDialog();
static UpdateDialog *instance; static UpdateDialog *instance;
update_t *p_update; update_t *p_update;
QPushButton *updateButton; QPushButton *updateButton;
QLabel *updateLabel; QLabel *updateLabel;
......
...@@ -78,6 +78,9 @@ DialogsProvider::~DialogsProvider() ...@@ -78,6 +78,9 @@ DialogsProvider::~DialogsProvider()
MessagesDialog::killInstance(); MessagesDialog::killInstance();
ExtendedDialog::killInstance(); ExtendedDialog::killInstance();
BookmarksDialog::killInstance(); BookmarksDialog::killInstance();
HelpDialog::killInstance();
UpdateDialog::killInstance();
fixed_timer->stop(); fixed_timer->stop();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment