[vlc-commits] Qt: remember last selected transcode profile

Francois Cartegnie git at videolan.org
Thu Jan 15 12:05:37 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 15 12:04:06 2015 +0100| [5f4c3c100a30ffe8bf7f2d911e31fa06975c1bc4] | committer: Francois Cartegnie

Qt: remember last selected transcode profile

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

 modules/gui/qt4/components/sout/profile_selector.cpp |   18 ++++++++++++++++++
 modules/gui/qt4/components/sout/profile_selector.hpp |    1 +
 2 files changed, 19 insertions(+)

diff --git a/modules/gui/qt4/components/sout/profile_selector.cpp b/modules/gui/qt4/components/sout/profile_selector.cpp
index 0321010..48bda5b 100644
--- a/modules/gui/qt4/components/sout/profile_selector.cpp
+++ b/modules/gui/qt4/components/sout/profile_selector.cpp
@@ -80,6 +80,19 @@ VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent )
     updateOptions( 0 );
 }
 
+VLCProfileSelector::~VLCProfileSelector()
+{
+    QSettings settings(
+#ifdef _WIN32
+            QSettings::IniFormat,
+#else
+            QSettings::NativeFormat,
+#endif
+            QSettings::UserScope, "vlc", "vlc-qt-interface" );
+    ;
+    settings.setValue( "codecs-profiles-selected", profileBox->currentText() );
+}
+
 inline void VLCProfileSelector::fillProfilesCombo()
 {
     QSettings settings(
@@ -108,6 +121,11 @@ inline void VLCProfileSelector::fillProfilesCombo()
         }
     }
     settings.endArray();
+
+    profileBox->setCurrentIndex(
+        profileBox->findText(
+            settings.value( "codecs-profiles-selected" ).toString() ));
+
 }
 
 void VLCProfileSelector::newProfile()
diff --git a/modules/gui/qt4/components/sout/profile_selector.hpp b/modules/gui/qt4/components/sout/profile_selector.hpp
index 1b732b1..8e7228b 100644
--- a/modules/gui/qt4/components/sout/profile_selector.hpp
+++ b/modules/gui/qt4/components/sout/profile_selector.hpp
@@ -41,6 +41,7 @@ class VLCProfileSelector : public QWidget
 
 public:
     VLCProfileSelector( QWidget *_parent );
+    ~VLCProfileSelector();
     QString getMux() { return mux; }
     QString getTranscode() { return transcode; }
 private:



More information about the vlc-commits mailing list