[vlc-devel] commit: Remember the QFileDialog states. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sun Jul 27 03:17:54 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Jul 26 18:19:55 2008 -0700| [185b2a6c6bd8c66c573fe081eec88c37fee75ad7]

Remember the QFileDialog states.

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

 modules/gui/qt4/components/open_panels.cpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 5270983..88294c5 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * open.cpp : Panels for the open dialogs
  ****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
  * Copyright (C) 2007 Société des arts technologiques
  * Copyright (C) 2007 Savoir-faire Linux
  *
@@ -44,6 +44,7 @@
 #include <QDirModel>
 #include <QScrollArea>
 #include <QUrl>
+#include <QSettings>
 
 /**************************************************************************
  * Open Files and subtitles                                               *
@@ -74,6 +75,11 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     dialogBox->setFileMode( QFileDialog::ExistingFiles );
     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
+#if HAS_QT43
+    QSettings settings( "vlc", "vlc-qt-interface" );
+    dialogBox->restoreState(
+            settings.value( "file-dialog-state" ).toByteArray() );
+#endif
     dialogBox->setViewMode( config_GetInt( p_intf, "qt-open-detail" ) ?
             QFileDialog::Detail : QFileDialog::List );
 
@@ -138,6 +144,10 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
 FileOpenPanel::~FileOpenPanel()
 {
+#if HAS_QT43
+    QSettings settings( "vlc", "vlc-qt-interface" );
+    settings.setValue( "file-dialog-state", dialogBox->saveState() );
+#endif
 }
 
 /* Show a fileBrowser to select a subtitle */




More information about the vlc-devel mailing list