clean up Add dialog some more
This commit is contained in:
parent
43939f6242
commit
7a051e3d87
|
@ -33,52 +33,45 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Button AddButton;
|
private Button AddButton;
|
||||||
private Entry UserNameEntry;
|
|
||||||
private Entry UserEmailEntry;
|
|
||||||
private ComboBoxEntry RemoteUrlCombo;
|
private ComboBoxEntry RemoteUrlCombo;
|
||||||
|
|
||||||
public SparkleDialog (string Url) : base ("") {
|
public SparkleDialog (string Url) : base ("") {
|
||||||
|
|
||||||
BorderWidth = 12;
|
BorderWidth = 12;
|
||||||
IconName = "folder-sparkleshare";
|
IconName = "folder-sparkleshare";
|
||||||
Modal = true;
|
WidthRequest = 320;
|
||||||
|
Title = "SparkleShare";
|
||||||
|
|
||||||
SetPosition (WindowPosition.Center);
|
SetPosition (WindowPosition.Center);
|
||||||
Title = "";
|
|
||||||
|
|
||||||
VBox VBox = new VBox (false, 6);
|
VBox VBox = new VBox (false, 0);
|
||||||
|
|
||||||
Label RemoteUrlLabel =
|
Label RemoteUrlLabel =
|
||||||
new Label (_("Remote SparkleShare address:"));
|
new Label (_("Address of remote SparkleShare folder:"));
|
||||||
|
|
||||||
RemoteUrlCombo = new ComboBoxEntry ();
|
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.Text = Url;
|
||||||
|
|
||||||
ListStore Defaults = new ListStore (typeof (string),
|
|
||||||
typeof (Gdk.Pixbuf));
|
|
||||||
|
|
||||||
RemoteUrlCombo.Entry.Completion = new EntryCompletion ();
|
RemoteUrlCombo.Entry.Completion = new EntryCompletion ();
|
||||||
|
|
||||||
CellRendererPixbuf CellRendererPixbuf = new CellRendererPixbuf ();
|
|
||||||
RemoteUrlCombo.Entry.Completion.Model = Defaults;
|
RemoteUrlCombo.Entry.Completion.Model = Defaults;
|
||||||
RemoteUrlCombo.Entry.Completion.PackStart (CellRendererPixbuf, false);
|
|
||||||
RemoteUrlCombo.Entry.Completion.AddAttribute (CellRendererPixbuf, "pixbuf", 1);
|
RemoteUrlCombo.Entry.Completion.InlineCompletion = true;
|
||||||
// TODO: The combobox arrow should be clickable
|
|
||||||
RemoteUrlCombo.Entry.Completion.InlineCompletion = false;
|
|
||||||
RemoteUrlCombo.Entry.Completion.PopupCompletion = true;
|
RemoteUrlCombo.Entry.Completion.PopupCompletion = true;
|
||||||
RemoteUrlCombo.Entry.Completion.TextColumn = 0;
|
RemoteUrlCombo.Entry.Completion.TextColumn = 0;
|
||||||
RemoteUrlCombo.TextColumn = 0;
|
RemoteUrlCombo.Entry.Changed += CheckFields;
|
||||||
|
|
||||||
Defaults.AppendValues ("ssh://git@github.com/",
|
Defaults.AppendValues ("ssh://git@github.com/");
|
||||||
SparkleHelpers.GetIcon ("github", 16));
|
Defaults.AppendValues ("ssh://git@git.gnome.org/");
|
||||||
Defaults.AppendValues ("ssh://git@git.gnome.org/",
|
Defaults.AppendValues ("ssh://git@fedorahosted.org/");
|
||||||
SparkleHelpers.GetIcon ("gnome", 16));
|
Defaults.AppendValues ("ssh://git@gitorious.org/");
|
||||||
Defaults.AppendValues ("ssh://git@fedorahosted.org/",
|
|
||||||
SparkleHelpers.GetIcon ("fedorahosted", 16));
|
|
||||||
Defaults.AppendValues ("ssh://git@gitorious.org/",
|
|
||||||
SparkleHelpers.GetIcon ("gitorious", 16));
|
|
||||||
|
|
||||||
Label RemoteUrlExample = new Label (_("These usually look something like this:\n ") +
|
Label RemoteUrlExample =
|
||||||
|
new Label (_("These usually look something like this:\n ") +
|
||||||
_("‘git://git@gnome.org/project’."));
|
_("‘git://git@gnome.org/project’."));
|
||||||
|
|
||||||
RemoteUrlExample.UseMarkup = true;
|
RemoteUrlExample.UseMarkup = true;
|
||||||
|
@ -91,41 +84,25 @@ namespace SparkleShare {
|
||||||
ButtonBox.BorderWidth = 0;
|
ButtonBox.BorderWidth = 0;
|
||||||
|
|
||||||
AddButton = new Button (_("Add Folder"));
|
AddButton = new Button (_("Add Folder"));
|
||||||
|
// TODO: This freezes the UI
|
||||||
|
AddButton.Clicked += CloneRepo;
|
||||||
|
AddButton.Sensitive = false;
|
||||||
|
|
||||||
Button CancelButton = new Button (Stock.Cancel);
|
Button CancelButton = new Button (Stock.Cancel);
|
||||||
|
|
||||||
CancelButton.Clicked += delegate {
|
CancelButton.Clicked += delegate {
|
||||||
Destroy ();
|
Destroy ();
|
||||||
};
|
};
|
||||||
|
|
||||||
RemoteUrlCombo.Entry.Changed += CheckFields;
|
|
||||||
// RemoteUrlCombo.WidthRequest = 300;
|
|
||||||
|
|
||||||
// TODO: This freezes the UI
|
|
||||||
AddButton.Clicked += CloneRepo;
|
|
||||||
AddButton.Sensitive = false;
|
|
||||||
|
|
||||||
ButtonBox.Add (CancelButton);
|
ButtonBox.Add (CancelButton);
|
||||||
ButtonBox.Add (AddButton);
|
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 (RemoteUrlLabel, false, false, 0);
|
||||||
VBox.PackStart (RemoteUrlCombo, false, false, 0);
|
VBox.PackStart (RemoteUrlCombo, false, false, 12);
|
||||||
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 (ButtonBox, false, false, 0);
|
VBox.PackStart (ButtonBox, false, false, 0);
|
||||||
|
|
||||||
Add (VBox);
|
Add (VBox);
|
||||||
|
|
||||||
ShowAll ();
|
ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
HButtonBox DialogButtons = new HButtonBox ();
|
HButtonBox DialogButtons = new HButtonBox ();
|
||||||
DialogButtons.Layout = ButtonBoxStyle.End;
|
DialogButtons.Layout = ButtonBoxStyle.End;
|
||||||
DialogButtons.BorderWidth = 0;
|
DialogButtons.BorderWidth = 6;
|
||||||
|
|
||||||
Button CloseButton = new Button (Stock.Close);
|
Button CloseButton = new Button (Stock.Close);
|
||||||
CloseButton.Clicked += delegate (object o, EventArgs args) {
|
CloseButton.Clicked += delegate (object o, EventArgs args) {
|
||||||
|
|
Loading…
Reference in a new issue