diff --git a/SparkleShare/Linux/Note.cs b/SparkleShare/Linux/Note.cs index e4ccd29c..6beb31fe 100644 --- a/SparkleShare/Linux/Note.cs +++ b/SparkleShare/Linux/Note.cs @@ -15,6 +15,7 @@ // along with this program. If not, see (http://www.gnu.org/licenses/). +using System.IO; using Gtk; namespace SparkleShare { @@ -55,6 +56,9 @@ namespace SparkleShare { Controller.ShowWindowEvent += delegate { Application.Invoke (delegate { + if (Child != null) + Remove (Child); + CreateNote (); ShowAll (); Present (); @@ -64,14 +68,17 @@ namespace SparkleShare { Controller.UpdateTitleEvent += delegate (string title) { Application.Invoke (delegate { Title = title; }); }; - - CreateNote (); } private void CreateNote () { - var user_image = new Image (Controller.AvatarFilePath); + Image user_image; + + if (File.Exists (Controller.AvatarFilePath)) + user_image = new Image (Controller.AvatarFilePath); + else + user_image = UserInterfaceHelpers.GetImage ("user-icon-default.png"); /* TODO: Style the entry neatly, multiple lines, and add placeholder text string balloon_image_path = new string [] { UserInterface.AssetsPath, "pixmaps", "text-balloon.png" }.Combine (); @@ -96,8 +103,9 @@ namespace SparkleShare { var cancel_button = new Button ("Cancel"); - var sync_button = new Button ("Sync"); // TODO: Make default button - sync_button.CanDefault = true; + var sync_button = new Button ("Sync") { CanDefault = true }; + + sync_button.StyleContext.AddClass ("suggested-action"); cancel_button.Clicked += delegate { Controller.CancelClicked (); }; sync_button.Clicked += delegate { Controller.SyncClicked (balloon.Buffer.Text); }; diff --git a/Sparkles/SSHAuthenticationInfo.cs b/Sparkles/SSHAuthenticationInfo.cs index 87487c3c..0724a241 100644 --- a/Sparkles/SSHAuthenticationInfo.cs +++ b/Sparkles/SSHAuthenticationInfo.cs @@ -34,10 +34,9 @@ namespace Sparkles { public string KnownHostsFilePath { get; private set; } - readonly string Path; - // TODO: Store keys in the platform's secure key store + public SSHAuthenticationInfo () { Path = IO.Path.Combine (Configuration.DefaultConfiguration.DirectoryPath, "ssh");