[vlc-devel] commit: Qt: Close #2906 (Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Jul 2 01:04:26 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jul  2 00:09:41 2009 +0200| [90a0990fc5a4028e2ce1178ba1d9b03a8e001463] | committer: Jean-Baptiste Kempf 

Qt: Close #2906
(cherry picked from commit 3617f5b4acea90331c5a7f1a773317957b3b9464)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/dialogs/extended.cpp |    5 +++++
 modules/gui/qt4/dialogs/extended.hpp |    1 +
 modules/gui/qt4/dialogs_provider.cpp |   12 ++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp
index 26b2a10..ffc34f0 100644
--- a/modules/gui/qt4/dialogs/extended.cpp
+++ b/modules/gui/qt4/dialogs/extended.cpp
@@ -113,6 +113,11 @@ void ExtendedDialog::showTab( int i )
     show();
 }
 
+int ExtendedDialog::currentTab()
+{
+    return mainTabW->currentIndex();
+}
+
 void ExtendedDialog::changedItem( int i_status )
 {
     if( i_status != END_S ) return;
diff --git a/modules/gui/qt4/dialogs/extended.hpp b/modules/gui/qt4/dialogs/extended.hpp
index da5e29a..04977ab 100644
--- a/modules/gui/qt4/dialogs/extended.hpp
+++ b/modules/gui/qt4/dialogs/extended.hpp
@@ -46,6 +46,7 @@ public:
         instance = NULL;
     }
     void showTab( int i );
+    int currentTab();
 private:
     ExtendedDialog( intf_thread_t * );
     virtual ~ExtendedDialog();
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 993434a..184aeaa 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -180,12 +180,20 @@ void DialogsProvider::prefsDialog()
 
 void DialogsProvider::extendedDialog()
 {
-    ExtendedDialog::getInstance( p_intf )->showTab( 0 );
+    if( !ExtendedDialog::getInstance( p_intf )->isVisible() || /* Hidden */
+        ExtendedDialog::getInstance( p_intf )->currentTab() != 0 )  /* wrong tab */
+        ExtendedDialog::getInstance( p_intf )->showTab( 0 );
+    else
+        ExtendedDialog::getInstance( p_intf )->hide();
 }
 
 void DialogsProvider::synchroDialog()
 {
-    ExtendedDialog::getInstance( p_intf )->showTab( 2 );
+    if( !ExtendedDialog::getInstance( p_intf )->isVisible() || /* Hidden */
+        ExtendedDialog::getInstance( p_intf )->currentTab() != 2 )  /* wrong tab */
+        ExtendedDialog::getInstance( p_intf )->showTab( 2 );
+    else
+        ExtendedDialog::getInstance( p_intf )->hide();
 }
 
 void DialogsProvider::messagesDialog()




More information about the vlc-devel mailing list