[vlc-commits] Qt: ask user to store the password

Thomas Guillem git at videolan.org
Thu Jan 7 20:12:44 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jan  6 17:19:06 2016 +0100| [d633465c8d3aba9408bf40aff981d4f9ce47da26] | committer: Thomas Guillem

Qt: ask user to store the password

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

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

diff --git a/modules/gui/qt4/dialogs/external.cpp b/modules/gui/qt4/dialogs/external.cpp
index 6a5d94f..7da64b8 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,15 @@ void DialogHandler::requestLogin (void *value)
     grid->addWidget (new QLabel (qtr("Password")), 2, 0);
     grid->addWidget (passLine, 2, 1);
 
+    QCheckBox *checkbox = NULL;
+    if (data->store != NULL)
+    {
+        checkbox = new QCheckBox;
+        checkbox->setChecked (getSettings()->value ("store_password", true).toBool ());
+        grid->addWidget (new QLabel (qtr("Store the Password")), 3, 0);
+        grid->addWidget (checkbox, 3, 1);
+    }
+
     panel->setLayout (grid);
     layout->addWidget (panel);
 
@@ -139,9 +149,18 @@ void DialogHandler::requestLogin (void *value)
     {
         *data->username = strdup (qtu(userLine->text ()));
         *data->password = strdup (qtu(passLine->text ()));
+        if (data->store != NULL)
+        {
+            *data->store = checkbox->isChecked ();
+            getSettings()->setValue ("store_password", *data->store);
+        }
     }
     else
+    {
         *data->username = *data->password = NULL;
+        if (data->store != NULL)
+            *data->store = false;
+    }
 
     delete dialog;
 }



More information about the vlc-commits mailing list