[vlc-devel] [PATCH 14/14] Qt: ask user to store the password

Thomas Guillem thomas at gllm.fr
Wed Jan 6 17:21:05 CET 2016


---
 modules/gui/qt4/dialogs/external.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/gui/qt4/dialogs/external.cpp b/modules/gui/qt4/dialogs/external.cpp
index 6a5d94f..46e207c 100644
--- a/modules/gui/qt4/dialogs/external.cpp
+++ b/modules/gui/qt4/dialogs/external.cpp
@@ -29,6 +29,7 @@
 #include <vlc_dialog.h>
 
 #include <QDialog>
+#include <QCheckBox>
 #include <QDialogButtonBox>
 #include <QLabel>
 #include <QLineEdit>
@@ -118,6 +119,11 @@ void DialogHandler::requestLogin (void *value)
     grid->addWidget (new QLabel (qtr("Password")), 2, 0);
     grid->addWidget (passLine, 2, 1);
 
+    QCheckBox *checkbox = new QCheckBox;
+    checkbox->setChecked (getSettings()->value ("store_password").toBool ());
+    grid->addWidget (new QLabel (qtr("Store the Password")), 3, 0);
+    grid->addWidget (checkbox, 3, 1);
+
     panel->setLayout (grid);
     layout->addWidget (panel);
 
@@ -139,9 +145,14 @@ void DialogHandler::requestLogin (void *value)
     {
         *data->username = strdup (qtu(userLine->text ()));
         *data->password = strdup (qtu(passLine->text ()));
+        data->store = checkbox->isChecked ();
+        getSettings()->setValue ("store_password", data->store);
     }
     else
+    {
         *data->username = *data->password = NULL;
+        data->store = false;
+    }
 
     delete dialog;
 }
-- 
2.1.4



More information about the vlc-devel mailing list