]> git.sesse.net Git - vlc/commitdiff
About: show advanced info on click
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 16 Apr 2013 01:26:56 +0000 (03:26 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 16 Apr 2013 01:26:56 +0000 (03:26 +0200)
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.hpp

index e6fb2179b39aa3f270946f9b17592b95f3265c06..330a756b01a73dcb89d6722d30874823dc32cf56 100644 (file)
@@ -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
 
 /*****************************************************************************
index 11b8fe1b59c83d666b0eeb42128364943c31ba83..02bb40d7044d01678dd3257cbb21457536162f6e 100644 (file)
@@ -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();