Commit 62f327db authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, help/update: code simplification

parent 25bf26b9
......@@ -57,12 +57,14 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
setMinimumSize( 350, 300 );
QVBoxLayout *layout = new QVBoxLayout( this );
QTextBrowser *helpBrowser = new QTextBrowser( this );
helpBrowser->setOpenExternalLinks( true );
helpBrowser->setHtml( qtr(I_LONGHELP) );
QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this );
QDialogButtonBox *closeButtonBox = new QDialogButtonBox( this );
closeButtonBox->addButton(
new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
new QPushButton( qtr("&Close") ), QDialogButtonBox::RejectRole );
closeButtonBox->setFocus();
layout->addWidget( helpBrowser );
......@@ -77,11 +79,6 @@ HelpDialog::~HelpDialog()
writeSettings( "Help" );
}
void HelpDialog::close()
{
toggleVisible();
}
AboutDialog::AboutDialog( intf_thread_t *_p_intf)
: QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
{
......@@ -92,8 +89,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
setWindowTitle( qtr( "About" ) );
setWindowRole( "vlc-about" );
resize( 600, 500 );
setMinimumSize( 600, 500 );
resize( 600, 500 );
setWindowModality( Qt::WindowModal );
CONNECT( ui.closeButtonBox, rejected(), this, close() );
......@@ -133,15 +130,6 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
ui.authorsEdit->setText( qfu( psz_authors ) );
}
AboutDialog::~AboutDialog()
{
}
void AboutDialog::close()
{
toggleVisible();
}
#ifdef UPDATE_CHECK
/*****************************************************************************
......@@ -203,11 +191,6 @@ UpdateDialog::~UpdateDialog()
writeSettings( "Update" );
}
void UpdateDialog::close()
{
toggleVisible();
}
/* Check for updates */
void UpdateDialog::UpdateOrDownload()
{
......@@ -283,4 +266,3 @@ void UpdateDialog::updateNotify( bool b_result )
}
#endif
......@@ -25,7 +25,7 @@
#define QVLC_HELP_DIALOG_H_ 1
#ifdef HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#include "qt4.hpp"
......@@ -35,12 +35,7 @@
#include "ui/about.h"
#include "ui/update.h"
class QPushButton;
class QTextBrowser;
class QLabel;
class QEvent;
class QPushButton;
class QTextEdit;
class HelpDialog : public QVLCFrame, public Singleton<HelpDialog>
{
......@@ -50,23 +45,20 @@ private:
virtual ~HelpDialog();
public slots:
void close();
virtual void close() { toggleVisible(); }
friend class Singleton<HelpDialog>;
};
class AboutDialog : public QVLCDialog, public Singleton<AboutDialog>
{
Q_OBJECT
private:
AboutDialog( intf_thread_t * );
virtual ~AboutDialog();
Ui::aboutWidget ui;
public slots:
void close();
virtual void close() { toggleVisible(); }
friend class Singleton<AboutDialog>;
};
......@@ -92,7 +84,8 @@ private:
bool b_checked;
private slots:
void close();
virtual void close() { toggleVisible(); }
void UpdateOrDownload();
friend class Singleton<UpdateDialog>;
......
......@@ -188,9 +188,7 @@ protected:
class QVLCMW : public QMainWindow
{
public:
QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf )
{ }
virtual ~QVLCMW() {};
QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf ){}
void toggleVisible()
{
if( isVisible() ) hide();
......
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