public static Button create_button_stock_image(String stockid,String tooltip){ Button tb = new Button(stockid); tb.Remove(tb.Child); VBox v = new VBox(); v.Add(new Gtk.Image(tb.RenderIcon(stockid,IconSize.SmallToolbar,tooltip))); tb.Add(v); tb.WidthRequest = 30; tb.CanFocus = false; tb.TooltipText = tooltip; tb.HasTooltip = true; return tb; }
public void ShowAccountForm() { Reset (); VBox layout_vertical = new VBox (false, 0); DeleteEvent += PreventClose; Label header = new Label ("<span size='x-large'><b>" + _("Welcome to SparkleShare!") + "</b></span>") { UseMarkup = true, Xalign = 0 }; Label information = new Label (_("Before we can create a SparkleShare folder on this " + "computer, we need a few bits of information from you.")) { Xalign = 0, Wrap = true }; Table table = new Table (4, 2, true) { RowSpacing = 6 }; UnixUserInfo unix_user_info = new UnixUserInfo (UnixEnvironment.UserName); Label name_label = new Label ("<b>" + _("Full Name:") + "</b>") { UseMarkup = true, Xalign = 0 }; NameEntry = new Entry (unix_user_info.RealName); NameEntry.Changed += delegate { CheckAccountForm (); }; EmailEntry = new Entry (SparkleShare.Controller.UserEmail); EmailEntry.Changed += delegate { CheckAccountForm (); }; Label email_label = new Label ("<b>" + _("Email:") + "</b>") { UseMarkup = true, Xalign = 0 }; table.Attach (name_label, 0, 1, 0, 1); table.Attach (NameEntry, 1, 2, 0, 1); table.Attach (email_label, 0, 1, 1, 2); table.Attach (EmailEntry, 1, 2, 1, 2); NextButton = new Button (_("Next")) { Sensitive = false }; NextButton.Clicked += delegate (object o, EventArgs args) { NextButton.Remove (NextButton.Child); NextButton.Add (new Label (_("Configuring…"))); NextButton.Sensitive = false; table.Sensitive = false; NextButton.ShowAll (); SparkleShare.Controller.UserName = NameEntry.Text; SparkleShare.Controller.UserEmail = EmailEntry.Text; SparkleShare.Controller.GenerateKeyPair (); SparkleShare.Controller.AddKey (); SparkleShare.Controller.FirstRun = false; DeleteEvent += PreventClose; ShowServerForm (); }; AddButton (NextButton); layout_vertical.PackStart (header, false, false, 0); layout_vertical.PackStart (information, false, false, 21); layout_vertical.PackStart (new Label (""), false, false, 0); layout_vertical.PackStart (table, false, false, 0); Add (layout_vertical); CheckAccountForm (); ShowAll (); }