UI is not allowed to access config. go via controller and talk about hosts
This commit is contained in:
parent
cb4a1e1a5b
commit
290b8917de
|
@ -200,16 +200,16 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<string> Domains {
|
public List<string> Hosts {
|
||||||
get {
|
get {
|
||||||
List<string> domains = new List<string> ();
|
List<string> hosts = new List<string> ();
|
||||||
|
|
||||||
foreach (XmlNode node_folder in SelectNodes ("/sparkleshare/folder")) {
|
foreach (XmlNode node_folder in SelectNodes ("/sparkleshare/folder")) {
|
||||||
Uri uri = new Uri (node_folder ["url"].InnerText);
|
Uri uri = new Uri (node_folder ["url"].InnerText);
|
||||||
domains.Add (uri.Host);
|
hosts.Add (uri.Host);
|
||||||
}
|
}
|
||||||
|
|
||||||
return domains;
|
return hosts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,6 +230,15 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<string> PreviousHosts {
|
||||||
|
get {
|
||||||
|
List<string> hosts = SparkleConfig.DefaultConfig.Hosts;
|
||||||
|
hosts.Sort ();
|
||||||
|
return hosts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<string> UnsyncedFolders {
|
public List<string> UnsyncedFolders {
|
||||||
get {
|
get {
|
||||||
List<string> unsynced_folders = new List<string> ();
|
List<string> unsynced_folders = new List<string> ();
|
||||||
|
|
|
@ -681,29 +681,28 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TreeModel ServerEntryCompletion ()
|
private TreeModel ServerEntryCompletion ()
|
||||||
{
|
{
|
||||||
ListStore store = new ListStore (typeof (string));
|
List<string> hosts = SparkleShare.Controller.PreviousHosts;
|
||||||
List<string> Urls = SparkleLib.SparkleConfig.DefaultConfig.Domains;
|
|
||||||
|
|
||||||
|
ListStore store = new ListStore (typeof (string));
|
||||||
store.AppendValues ("user@localhost");
|
store.AppendValues ("user@localhost");
|
||||||
store.AppendValues ("user@example.com");
|
store.AppendValues ("user@example.com");
|
||||||
foreach (string url in Urls) {
|
|
||||||
store.AppendValues (url);
|
foreach (string host in hosts)
|
||||||
}
|
store.AppendValues (host);
|
||||||
|
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TreeModel FolderEntryCompletion ()
|
private TreeModel FolderEntryCompletion ()
|
||||||
{
|
{
|
||||||
ListStore store = new ListStore (typeof (string));
|
ListStore store = new ListStore (typeof (string));
|
||||||
|
|
||||||
store.AppendValues ("~/test.git");
|
store.AppendValues ("~/test.git");
|
||||||
foreach (string folder in SparkleLib.SparkleConfig.DefaultConfig.Folders) {
|
|
||||||
|
foreach (string folder in SparkleShare.Controller.Folders)
|
||||||
store.AppendValues (folder);
|
store.AppendValues (folder);
|
||||||
}
|
|
||||||
|
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue