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 @@
HelpDialog *HelpDialog::instance = NULL;
HelpDialog::HelpDialog( QWidget *parent, intf_thread_t *_p_intf )
: QVLCDialog( parent, _p_intf )
HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
setWindowTitle( qtr( "Help" ) );
setMinimumSize( 250, 300 );
......@@ -69,20 +69,23 @@ HelpDialog::HelpDialog( QWidget *parent, intf_thread_t *_p_intf )
layout->addWidget( closeButton, 1, 3 );
BUTTONACT( closeButton, close() );
resize( 400, 450 );
readSettings( "Help", QSize( 400, 450 ) );
}
HelpDialog::~HelpDialog()
{
writeSettings( "Help" );
}
void HelpDialog::close()
{
this->toggleVisible();
toggleVisible();
}
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" ) );
resize( 600, 500 );
......@@ -170,9 +173,10 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
AboutDialog::~AboutDialog()
{
}
void AboutDialog::close()
{
this->toggleVisible();
toggleVisible();
}
#ifdef UPDATE_CHECK
......@@ -199,7 +203,6 @@ UpdateDialog *UpdateDialog::instance = NULL;
UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
setWindowTitle( qtr( "Update" ) );
resize( 120, 80 );
QGridLayout *layout = new QGridLayout( this );
......@@ -223,6 +226,8 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
p_update = update_New( p_intf );
b_checked = false;
readSettings( "Update", QSize( 120, 80 ) );
/* Check for updates */
UpdateOrDownload();
}
......@@ -230,6 +235,7 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
UpdateDialog::~UpdateDialog()
{
update_Delete( p_update );
writeSettings( "Update" );
}
void UpdateDialog::close()
......
......@@ -36,41 +36,46 @@ class QLabel;
class QEvent;
class QPushButton;
class HelpDialog : public QVLCDialog
class HelpDialog : public QVLCFrame
{
Q_OBJECT;
public:
static HelpDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
instance = new HelpDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
instance = new HelpDialog( p_intf );
return instance;
}
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
virtual ~HelpDialog();
private:
HelpDialog( QWidget *, intf_thread_t * );
HelpDialog( intf_thread_t * );
static HelpDialog *instance;
public slots:
void close();
};
class AboutDialog : public QVLCFrame
class AboutDialog : public QVLCDialog
{
Q_OBJECT;
public:
static AboutDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
instance = new AboutDialog( p_intf );
instance = new AboutDialog( (QWidget *)p_intf->p_sys->p_mi,
p_intf );
return instance;
}
virtual ~AboutDialog();
private:
AboutDialog( intf_thread_t * );
AboutDialog( QWidget *, intf_thread_t * );
virtual ~AboutDialog();
static AboutDialog *instance;
public slots:
void close();
};
......@@ -90,12 +95,17 @@ public:
instance = new UpdateDialog( p_intf );
return instance;
}
virtual ~UpdateDialog();
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
void updateNotify( bool );
private:
UpdateDialog( intf_thread_t * );
virtual ~UpdateDialog();
static UpdateDialog *instance;
update_t *p_update;
QPushButton *updateButton;
QLabel *updateLabel;
......
......@@ -78,6 +78,9 @@ DialogsProvider::~DialogsProvider()
MessagesDialog::killInstance();
ExtendedDialog::killInstance();
BookmarksDialog::killInstance();
HelpDialog::killInstance();
UpdateDialog::killInstance();
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