[vlc-commits] About: show advanced info on click

Jean-Baptiste Kempf git at videolan.org
Tue Apr 16 03:28:22 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Apr 16 03:26:56 2013 +0200| [fc41a15c950328d25c1a0f2c7ebc1afec85d2ecb] | committer: Jean-Baptiste Kempf

About: show advanced info on click

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc41a15c950328d25c1a0f2c7ebc1afec85d2ecb
---

 modules/gui/qt4/dialogs/help.cpp |   26 +++++++++++++++++++++++++-
 modules/gui/qt4/dialogs/help.hpp |    6 ++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index e6fb217..330a756 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 11b8fe1..02bb40d 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<AboutDialog>;
 
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+    bool b_advanced;
+
 private slots:
     void showLicense();
     void showAuthors();



More information about the vlc-commits mailing list