setup: don't clear the Path field when switching plugins and remember own server Address
This commit is contained in:
parent
001abbe5ce
commit
51b5e738ee
|
@ -101,6 +101,10 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string saved_address = "";
|
||||||
|
private string saved_remote_path = "";
|
||||||
|
|
||||||
|
|
||||||
public SparkleSetupController ()
|
public SparkleSetupController ()
|
||||||
{
|
{
|
||||||
TutorialPageNumber = 1;
|
TutorialPageNumber = 1;
|
||||||
|
@ -230,10 +234,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
} else if (SelectedPlugin.AddressExample != null) {
|
} else if (SelectedPlugin.AddressExample != null) {
|
||||||
if (ChangeAddressFieldEvent != null)
|
if (ChangeAddressFieldEvent != null)
|
||||||
ChangeAddressFieldEvent ("", SelectedPlugin.AddressExample, FieldState.Enabled);
|
ChangeAddressFieldEvent (this.saved_address, SelectedPlugin.AddressExample, FieldState.Enabled);
|
||||||
} else {
|
} else {
|
||||||
if (ChangeAddressFieldEvent != null)
|
if (ChangeAddressFieldEvent != null)
|
||||||
ChangeAddressFieldEvent ("", "", FieldState.Enabled);
|
ChangeAddressFieldEvent (this.saved_address, "", FieldState.Enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectedPlugin.Path != null) {
|
if (SelectedPlugin.Path != null) {
|
||||||
|
@ -242,11 +246,11 @@ namespace SparkleShare {
|
||||||
|
|
||||||
} else if (SelectedPlugin.PathExample != null) {
|
} else if (SelectedPlugin.PathExample != null) {
|
||||||
if (ChangePathFieldEvent != null)
|
if (ChangePathFieldEvent != null)
|
||||||
ChangePathFieldEvent ("", SelectedPlugin.PathExample, FieldState.Enabled);
|
ChangePathFieldEvent (this.saved_remote_path, SelectedPlugin.PathExample, FieldState.Enabled);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (ChangePathFieldEvent != null)
|
if (ChangePathFieldEvent != null)
|
||||||
ChangePathFieldEvent ("", "", FieldState.Enabled);
|
ChangePathFieldEvent (this.saved_remote_path, "", FieldState.Enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +263,11 @@ namespace SparkleShare {
|
||||||
address = address.Trim ();
|
address = address.Trim ();
|
||||||
remote_path = remote_path.Trim ();
|
remote_path = remote_path.Trim ();
|
||||||
|
|
||||||
|
if (selected_plugin == 0)
|
||||||
|
this.saved_address = address;
|
||||||
|
|
||||||
|
this.saved_remote_path = remote_path;
|
||||||
|
|
||||||
bool fields_valid = address != null && address.Trim ().Length > 0 &&
|
bool fields_valid = address != null && address.Trim ().Length > 0 &&
|
||||||
remote_path != null && remote_path.Trim ().Length > 0;
|
remote_path != null && remote_path.Trim ().Length > 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue