3
using System.Threading;
4
using MonoDevelop.Core;
6
namespace MonoDevelop.VersionControl.Subversion.Gui
8
public partial class UserPasswordDialog : Gtk.Dialog
10
public UserPasswordDialog (string user, string realm, bool mayRemember, bool showPassword)
13
if (user != null && user.Length > 0) {
14
entryUser.Text = user;
15
entryPwd.HasFocus = true;
18
labelRealm.Text = GettextCatalog.GetString ("Authentication realm: ") + realm;
20
checkSavePwd.Visible = false;
23
entryPwd.Visible = labelPwd.Visible = false;
27
get { return entryUser.Text; }
30
public string Password {
31
get { return entryPwd.Text; }
34
public bool SavePassword {
35
get { return checkSavePwd.Visible && checkSavePwd.Active; }
39
internal static bool Show (string realm, bool may_save, out LibSvnClient.svn_auth_cred_username_t data)
41
data = new LibSvnClient.svn_auth_cred_username_t ();
43
string pwd, user = "";
44
bool ret = Show (false, realm, may_save, ref user, out pwd, out save);
50
internal static bool Show (string user_name, string realm, bool may_save, out LibSvnClient.svn_auth_cred_simple_t data)
52
data = new LibSvnClient.svn_auth_cred_simple_t ();
55
bool ret = Show (true, realm, may_save, ref user_name, out pwd, out save);
56
data.username = user_name;
62
internal static bool Show (bool showPwd, string realm, bool may_save, ref string user_name, out string password, out int save)
64
string pwd = "", user = user_name;
68
object monitor = new Object ();
70
EventHandler del = delegate {
72
UserPasswordDialog dlg = new UserPasswordDialog (user, realm, may_save, showPwd);
73
res = (dlg.Run () == (int) Gtk.ResponseType.Ok);
75
s = dlg.SavePassword ? 1 : 0;
82
System.Threading.Monitor.Pulse (monitor);
87
if (GLib.MainContext.Depth > 0) {
88
// Already in GUI thread
93
Gtk.Application.Invoke (del);
94
System.Threading.Monitor.Wait (monitor);