From 7a051e3d878da4d5f697efc88f8e386692b88d36 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 31 May 2010 17:12:36 +0200 Subject: [PATCH] clean up Add dialog some more --- SparkleShare/SparkleDialog.cs | 77 ++++++++++++----------------------- SparkleShare/SparkleWindow.cs | 4 +- 2 files changed, 29 insertions(+), 52 deletions(-) diff --git a/SparkleShare/SparkleDialog.cs b/SparkleShare/SparkleDialog.cs index 4ac9f888..88a741f1 100644 --- a/SparkleShare/SparkleDialog.cs +++ b/SparkleShare/SparkleDialog.cs @@ -33,53 +33,46 @@ namespace SparkleShare { } private Button AddButton; - private Entry UserNameEntry; - private Entry UserEmailEntry; private ComboBoxEntry RemoteUrlCombo; public SparkleDialog (string Url) : base ("") { BorderWidth = 12; IconName = "folder-sparkleshare"; - Modal = true; + WidthRequest = 320; + Title = "SparkleShare"; SetPosition (WindowPosition.Center); - Title = ""; - VBox VBox = new VBox (false, 6); + VBox VBox = new VBox (false, 0); Label RemoteUrlLabel = - new Label (_("Remote SparkleShare address:")); - - RemoteUrlCombo = new ComboBoxEntry (); - RemoteUrlCombo.Entry.Text = Url; + new Label (_("Address of remote SparkleShare folder:")); - ListStore Defaults = new ListStore (typeof (string), - typeof (Gdk.Pixbuf)); + ListStore Defaults = new ListStore (typeof (string)); + + RemoteUrlCombo = new ComboBoxEntry (Defaults, 0); + if (Url.Equals ("")) + RemoteUrlCombo.Entry.Text = "ssh://"; + else + RemoteUrlCombo.Entry.Text = Url; RemoteUrlCombo.Entry.Completion = new EntryCompletion (); - - CellRendererPixbuf CellRendererPixbuf = new CellRendererPixbuf (); RemoteUrlCombo.Entry.Completion.Model = Defaults; - RemoteUrlCombo.Entry.Completion.PackStart (CellRendererPixbuf, false); - RemoteUrlCombo.Entry.Completion.AddAttribute (CellRendererPixbuf, "pixbuf", 1); - // TODO: The combobox arrow should be clickable - RemoteUrlCombo.Entry.Completion.InlineCompletion = false; + + RemoteUrlCombo.Entry.Completion.InlineCompletion = true; RemoteUrlCombo.Entry.Completion.PopupCompletion = true; RemoteUrlCombo.Entry.Completion.TextColumn = 0; - RemoteUrlCombo.TextColumn = 0; + RemoteUrlCombo.Entry.Changed += CheckFields; - Defaults.AppendValues ("ssh://git@github.com/", - SparkleHelpers.GetIcon ("github", 16)); - Defaults.AppendValues ("ssh://git@git.gnome.org/", - SparkleHelpers.GetIcon ("gnome", 16)); - Defaults.AppendValues ("ssh://git@fedorahosted.org/", - SparkleHelpers.GetIcon ("fedorahosted", 16)); - Defaults.AppendValues ("ssh://git@gitorious.org/", - SparkleHelpers.GetIcon ("gitorious", 16)); + Defaults.AppendValues ("ssh://git@github.com/"); + Defaults.AppendValues ("ssh://git@git.gnome.org/"); + Defaults.AppendValues ("ssh://git@fedorahosted.org/"); + Defaults.AppendValues ("ssh://git@gitorious.org/"); - Label RemoteUrlExample = new Label (_("These usually look something like this:\n ") + - _("‘git://git@gnome.org/project’.")); + Label RemoteUrlExample = + new Label (_("These usually look something like this:\n ") + + _("‘git://git@gnome.org/project’.")); RemoteUrlExample.UseMarkup = true; RemoteUrlExample.SetAlignment (0, 0); @@ -91,41 +84,25 @@ namespace SparkleShare { ButtonBox.BorderWidth = 0; AddButton = new Button (_("Add Folder")); + // TODO: This freezes the UI + AddButton.Clicked += CloneRepo; + AddButton.Sensitive = false; + Button CancelButton = new Button (Stock.Cancel); CancelButton.Clicked += delegate { Destroy (); }; - RemoteUrlCombo.Entry.Changed += CheckFields; -// RemoteUrlCombo.WidthRequest = 300; - - // TODO: This freezes the UI - AddButton.Clicked += CloneRepo; - AddButton.Sensitive = false; - ButtonBox.Add (CancelButton); ButtonBox.Add (AddButton); - - UserNameEntry = new Entry (); - Label UserNameLabel = new Label (_("Your name:")); - UserNameLabel.Xalign = 0; - - UserEmailEntry = new Entry (); - Label UserEmailLabel = new Label (_("Your e-mail address:")); - UserEmailLabel.Xalign = 0; - VBox.PackStart (RemoteUrlLabel, false, false, 0); - VBox.PackStart (RemoteUrlCombo, false, false, 0); - VBox.PackStart (UserNameLabel, false, false, 0); - VBox.PackStart (UserNameEntry, false, false, 0); - VBox.PackStart (UserEmailLabel, false, false, 0); - VBox.PackStart (UserEmailEntry, false, false, 0); - + VBox.PackStart (RemoteUrlCombo, false, false, 12); VBox.PackStart (ButtonBox, false, false, 0); Add (VBox); + ShowAll (); } diff --git a/SparkleShare/SparkleWindow.cs b/SparkleShare/SparkleWindow.cs index 300e8673..4f1fd724 100644 --- a/SparkleShare/SparkleWindow.cs +++ b/SparkleShare/SparkleWindow.cs @@ -62,7 +62,7 @@ namespace SparkleShare { HButtonBox DialogButtons = new HButtonBox (); DialogButtons.Layout = ButtonBoxStyle.End; - DialogButtons.BorderWidth = 0; + DialogButtons.BorderWidth = 6; Button CloseButton = new Button (Stock.Close); CloseButton.Clicked += delegate (object o, EventArgs args) { @@ -261,7 +261,7 @@ namespace SparkleShare { } - IconView PeopleView = new IconView (PeopleStore); + IconView PeopleView = new IconView (PeopleStore); PeopleView.PixbufColumn = 0; PeopleView.MarkupColumn = 1; PeopleView.Columns = 3;