setup: fix text field quirks
This commit is contained in:
parent
6f5f666a5f
commit
984ccebb3f
|
@ -175,14 +175,20 @@ namespace SparkleShare {
|
|||
|
||||
Controller.ChangeAddressFieldEvent += delegate (string text,
|
||||
string example_text, FieldState state) {
|
||||
|
||||
Console.WriteLine ("> " + text);
|
||||
Application.Invoke (delegate {
|
||||
AddressEntry.Text = text;
|
||||
AddressEntry.Sensitive = (state == FieldState.Enabled);
|
||||
AddressEntry.ExampleText = example_text;
|
||||
|
||||
if (!string.IsNullOrEmpty (text))
|
||||
if (string.IsNullOrEmpty (example_text))
|
||||
AddressEntry.ExampleText = null;
|
||||
else
|
||||
AddressEntry.ExampleText = example_text;
|
||||
|
||||
if (string.IsNullOrEmpty (text))
|
||||
AddressEntry.ExampleTextActive = true;
|
||||
else
|
||||
AddressEntry.ExampleTextActive = false;
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -192,10 +198,16 @@ namespace SparkleShare {
|
|||
Application.Invoke (delegate {
|
||||
PathEntry.Text = text;
|
||||
PathEntry.Sensitive = (state == FieldState.Enabled);
|
||||
PathEntry.ExampleText = example_text;
|
||||
|
||||
if (!string.IsNullOrEmpty (text))
|
||||
if (string.IsNullOrEmpty (example_text))
|
||||
PathEntry.ExampleText = null;
|
||||
else
|
||||
PathEntry.ExampleText = example_text;
|
||||
|
||||
if (string.IsNullOrEmpty (text))
|
||||
PathEntry.ExampleTextActive = true;
|
||||
else
|
||||
PathEntry.ExampleTextActive = false;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -282,24 +282,6 @@ namespace SparkleShare {
|
|||
if (ChangePathFieldEvent != null)
|
||||
ChangePathFieldEvent ("", "", FieldState.Enabled);
|
||||
}
|
||||
|
||||
// TODO: previous server/folder doesn't work yet
|
||||
|
||||
/*
|
||||
if (!string.IsNullOrEmpty (PreviousServer) && SelectedPlugin.Address == null) {
|
||||
if (ChangeAddressFieldEvent != null) {
|
||||
ChangeAddressFieldEvent (this.previous_server,
|
||||
SelectedPlugin.AddressExample, FieldState.Enabled);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty (PreviousFolder) && SelectedPlugin.Path == null) {
|
||||
if (ChangePathFieldEvent != null) {
|
||||
ChangeAddressFieldEvent (this.previous_folder,
|
||||
SelectedPlugin.PathExample, FieldState.Enabled);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue