diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index d063b8df..563a99dc 100644 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -200,16 +200,16 @@ namespace SparkleLib { } - public List Domains { + public List Hosts { get { - List domains = new List (); + List hosts = new List (); foreach (XmlNode node_folder in SelectNodes ("/sparkleshare/folder")) { Uri uri = new Uri (node_folder ["url"].InnerText); - domains.Add (uri.Host); + hosts.Add (uri.Host); } - return domains; + return hosts; } } diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 2efea66c..1ed7642e 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -230,6 +230,15 @@ namespace SparkleShare { } + public List PreviousHosts { + get { + List hosts = SparkleConfig.DefaultConfig.Hosts; + hosts.Sort (); + return hosts; + } + } + + public List UnsyncedFolders { get { List unsynced_folders = new List (); diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleIntro.cs index d393afbe..0147d8dc 100644 --- a/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/SparkleIntro.cs @@ -681,29 +681,28 @@ namespace SparkleShare { } - TreeModel ServerEntryCompletion () + private TreeModel ServerEntryCompletion () { - ListStore store = new ListStore (typeof (string)); - List Urls = SparkleLib.SparkleConfig.DefaultConfig.Domains; + List hosts = SparkleShare.Controller.PreviousHosts; + ListStore store = new ListStore (typeof (string)); store.AppendValues ("user@localhost"); store.AppendValues ("user@example.com"); - foreach (string url in Urls) { - store.AppendValues (url); - } + + foreach (string host in hosts) + store.AppendValues (host); return store; } - TreeModel FolderEntryCompletion () + private TreeModel FolderEntryCompletion () { ListStore store = new ListStore (typeof (string)); - store.AppendValues ("~/test.git"); - foreach (string folder in SparkleLib.SparkleConfig.DefaultConfig.Folders) { + + foreach (string folder in SparkleShare.Controller.Folders) store.AppendValues (folder); - } return store; }