setup: remember previous values correctly after a failed sync
This commit is contained in:
parent
5a9b7d4ba6
commit
3f26071a29
|
@ -169,28 +169,12 @@ namespace SparkleShare {
|
||||||
TreePath default_path = new TreePath ("0");
|
TreePath default_path = new TreePath ("0");
|
||||||
default_selection.SelectPath (default_path);
|
default_selection.SelectPath (default_path);
|
||||||
|
|
||||||
tree.Model.Foreach (new TreeModelForeachFunc (delegate (TreeModel model,
|
ScrolledWindow scrolled_window = new ScrolledWindow ();
|
||||||
TreePath path, TreeIter iter) {
|
scrolled_window.AddWithViewport (tree);
|
||||||
|
|
||||||
string address;
|
FolderEntry = new SparkleEntry ();
|
||||||
|
ServerEntry = new SparkleEntry ();
|
||||||
|
|
||||||
try {
|
|
||||||
address = (model.GetValue (iter, 2) as SparklePlugin).Address;
|
|
||||||
} catch (NullReferenceException) {
|
|
||||||
address = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty (address) &&
|
|
||||||
address.Equals (Controller.PreviousServer)) {
|
|
||||||
|
|
||||||
tree.SetCursor (path, service_column, false);
|
|
||||||
// TODO: Scroll to the selection
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Update the address field text when the selection changes
|
// Update the address field text when the selection changes
|
||||||
tree.CursorChanged += delegate(object sender, EventArgs e) {
|
tree.CursorChanged += delegate(object sender, EventArgs e) {
|
||||||
|
@ -240,10 +224,37 @@ namespace SparkleShare {
|
||||||
// TODO: Scroll along with the selection
|
// TODO: Scroll along with the selection
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrolledWindow scrolled_window = new ScrolledWindow ();
|
tree.Model.Foreach (new TreeModelForeachFunc (delegate (TreeModel model,
|
||||||
scrolled_window.AddWithViewport (tree);
|
TreePath path, TreeIter iter) {
|
||||||
|
|
||||||
|
string address;
|
||||||
|
|
||||||
|
try {
|
||||||
|
address = (model.GetValue (iter, 2) as SparklePlugin).Address;
|
||||||
|
} catch (NullReferenceException) {
|
||||||
|
address = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty (address) &&
|
||||||
|
address.Equals (Controller.PreviousServer)) {
|
||||||
|
|
||||||
|
tree.SetCursor (path, service_column, false);
|
||||||
|
SparklePlugin plugin = (SparklePlugin) model.GetValue (iter, 2);
|
||||||
|
|
||||||
|
if (plugin.Address != null) {Console.WriteLine ("DDDDDDDDD");
|
||||||
|
ServerEntry.Sensitive = false;}
|
||||||
|
|
||||||
|
if (plugin.Path != null)
|
||||||
|
FolderEntry.Sensitive = false;
|
||||||
|
|
||||||
|
// TODO: Scroll to the selection
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
ServerEntry = new SparkleEntry ();
|
|
||||||
ServerEntry.Completion = new EntryCompletion();
|
ServerEntry.Completion = new EntryCompletion();
|
||||||
ListStore server_store = new ListStore (typeof (string));
|
ListStore server_store = new ListStore (typeof (string));
|
||||||
|
|
||||||
|
@ -272,7 +283,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
layout_address.PackStart (ServerEntry, true, true, 0);
|
layout_address.PackStart (ServerEntry, true, true, 0);
|
||||||
|
|
||||||
FolderEntry = new SparkleEntry ();
|
|
||||||
FolderEntry.ExampleText = _("/path/to/project");
|
FolderEntry.ExampleText = _("/path/to/project");
|
||||||
FolderEntry.Completion = new EntryCompletion();
|
FolderEntry.Completion = new EntryCompletion();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue