From: Jean-Baptiste Kempf Date: Tue, 16 Apr 2013 01:26:56 +0000 (+0200) Subject: About: show advanced info on click X-Git-Tag: 2.1.0-git~644 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fc41a15c950328d25c1a0f2c7ebc1afec85d2ecb;p=vlc About: show advanced info on click --- diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp index e6fb2179b3..330a756b01 100644 --- a/modules/gui/qt4/dialogs/help.cpp +++ b/modules/gui/qt4/dialogs/help.cpp @@ -79,7 +79,7 @@ HelpDialog::~HelpDialog() } AboutDialog::AboutDialog( intf_thread_t *_p_intf) - : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ) + : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ), b_advanced( false ) { /* Build UI */ ui.setupUi( this ); @@ -113,6 +113,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) BUTTONACT(ui.licenseButton, showLicense() ); BUTTONACT(ui.authorsButton, showAuthors() ); BUTTONACT(ui.creditsButton, showCredit() ); + + ui.version->installEventFilter( this ); } void AboutDialog::showLicense() @@ -130,6 +132,28 @@ void AboutDialog::showCredit() ui.stackedWidget->setCurrentWidget( ui.creditPage ); } +bool AboutDialog::eventFilter(QObject *obj, QEvent *event) +{ + if( obj == ui.version ) + { + if (event->type() == QEvent::MouseButtonPress ) + { + if( !b_advanced ) + { + ui.version->setText(qfu( VLC_CompileBy() )+ "@" + qfu( VLC_CompileHost() ) + + __DATE__ + " " +__TIME__); + b_advanced = true; + } + else + { + ui.version->setText(qfu( " " VERSION_MESSAGE ) ); + b_advanced = false; + } + return true; + } + } + return false; +} #ifdef UPDATE_CHECK /***************************************************************************** diff --git a/modules/gui/qt4/dialogs/help.hpp b/modules/gui/qt4/dialogs/help.hpp index 11b8fe1b59..02bb40d704 100644 --- a/modules/gui/qt4/dialogs/help.hpp +++ b/modules/gui/qt4/dialogs/help.hpp @@ -60,6 +60,12 @@ private: public slots: friend class Singleton; +protected: + bool eventFilter(QObject *obj, QEvent *event); + +private: + bool b_advanced; + private slots: void showLicense(); void showAuthors();