Hide passwords in text fields.
[dcpomatic.git] / src / wx / wx_util.cc
index 747d1df04c269290fc350d6cdf474dda61f0d2c9..bfc7c30690936ec405cd0833c6719030d1403d62 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -25,6 +25,7 @@
 #include "wx_util.h"
 #include "file_picker_ctrl.h"
 #include "static_text.h"
+#include "password_entry.h"
 #include "lib/config.h"
 #include "lib/job_manager.h"
 #include "lib/util.h"
@@ -292,6 +293,14 @@ checked_set (wxTextCtrl* widget, string value)
        }
 }
 
+void
+checked_set (PasswordEntry* entry, string value)
+{
+       if (entry->get() != value) {
+               entry->set(value);
+       }
+}
+
 void
 checked_set (wxTextCtrl* widget, wxString value)
 {