commit
8a0817b8be
|
@ -33,21 +33,6 @@ SOURCES = \
|
|||
SparkleStatusIconController.cs \
|
||||
SparkleUI.cs \
|
||||
SparkleUIHelpers.cs
|
||||
SparkleBubbles.cs \
|
||||
SparkleBubblesController.cs \
|
||||
SparkleController.cs \
|
||||
SparkleEntry.cs \
|
||||
SparkleEventLog.cs \
|
||||
SparkleEventLogController.cs \
|
||||
SparkleOptions.cs \
|
||||
SparkleSetup.cs \
|
||||
SparkleSetupController.cs \
|
||||
SparkleSetupWindow.cs \
|
||||
SparkleSpinner.cs \
|
||||
SparkleStatusIcon.cs \
|
||||
SparkleStatusIconController.cs \
|
||||
SparkleUI.cs \
|
||||
SparkleUIHelpers.cs
|
||||
|
||||
include $(top_srcdir)/build/build.mk
|
||||
|
||||
|
|
|
@ -52,6 +52,13 @@ namespace SparkleShare {
|
|||
return Catalog.GetString (s);
|
||||
}
|
||||
|
||||
public static int GetSelected (TreeView tree)
|
||||
{
|
||||
TreeIter iter;
|
||||
TreeModel model;
|
||||
tree.Selection.GetSelected(out model, out iter);
|
||||
return int.Parse (model.GetPath (iter).ToString ());
|
||||
}
|
||||
|
||||
public SparkleSetup () : base ()
|
||||
{
|
||||
|
@ -87,12 +94,12 @@ namespace SparkleShare {
|
|||
|
||||
NameEntry = new Entry (Controller.GuessedUserName);
|
||||
NameEntry.Changed += delegate {
|
||||
CheckSetupPage ();
|
||||
Controller.CheckSetupPage (NameEntry.Text, EmailEntry.Text);
|
||||
};
|
||||
|
||||
EmailEntry = new Entry (Controller.GuessedUserEmail);
|
||||
EmailEntry.Changed += delegate {
|
||||
CheckSetupPage ();
|
||||
Controller.CheckSetupPage (NameEntry.Text, EmailEntry.Text);
|
||||
};
|
||||
|
||||
Label email_label = new Label ("<b>" + _("Email:") + "</b>") {
|
||||
|
@ -119,7 +126,7 @@ namespace SparkleShare {
|
|||
AddButton (NextButton);
|
||||
Add (Table);
|
||||
|
||||
CheckSetupPage ();
|
||||
Controller.CheckSetupPage (NameEntry.Text, EmailEntry.Text);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -133,6 +140,7 @@ namespace SparkleShare {
|
|||
VBox layout_address = new VBox (true, 0);
|
||||
VBox layout_path = new VBox (true, 0);
|
||||
|
||||
|
||||
ListStore store = new ListStore (typeof (Gdk.Pixbuf),
|
||||
typeof (string), typeof (SparklePlugin));
|
||||
|
||||
|
@ -212,16 +220,7 @@ namespace SparkleShare {
|
|||
|
||||
// Update the address field text when the selection changes
|
||||
tree.CursorChanged += delegate (object sender, EventArgs e) {
|
||||
TreeIter iter;
|
||||
TreeModel model;
|
||||
|
||||
TreeSelection selection = (sender as TreeView).Selection;
|
||||
selection.GetSelected (out model, out iter);
|
||||
|
||||
// SparklePlugin plugin = (SparklePlugin) model.GetValue (iter, 2);
|
||||
int selected_path = int.Parse (model.GetPath (iter).ToString ());
|
||||
|
||||
Controller.SelectedPluginChanged (selected_path);
|
||||
Controller.SelectedPluginChanged (GetSelected(sender as TreeView));
|
||||
|
||||
// TODO: Scroll to selected row when using arrow keys
|
||||
};
|
||||
|
@ -268,7 +267,7 @@ namespace SparkleShare {
|
|||
AddressEntry.Completion.TextColumn = 0;
|
||||
|
||||
AddressEntry.Changed += delegate {
|
||||
CheckAddPage ();
|
||||
Controller.CheckAddPage (AddressEntry.Text, PathEntry.Text, GetSelected(tree));
|
||||
};
|
||||
|
||||
layout_address.PackStart (new Label () {
|
||||
|
@ -289,7 +288,7 @@ namespace SparkleShare {
|
|||
PathEntry.Completion.TextColumn = 0;
|
||||
|
||||
PathEntry.Changed += delegate {
|
||||
CheckAddPage ();
|
||||
Controller.CheckAddPage (AddressEntry.Text, PathEntry.Text, GetSelected(tree));
|
||||
};
|
||||
|
||||
layout_path.PackStart (new Label () { Markup = "<b>" + _("Remote Path") + "</b>", Xalign = 0 },
|
||||
|
@ -325,7 +324,7 @@ namespace SparkleShare {
|
|||
AddButton (cancel_button);
|
||||
AddButton (SyncButton);
|
||||
|
||||
CheckAddPage ();
|
||||
Controller.CheckAddPage (AddressEntry.Text, PathEntry.Text, GetSelected(tree));
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -170,8 +170,8 @@ namespace SparkleShare {
|
|||
full_name = full_name.Trim ();
|
||||
email = email.Trim ();
|
||||
|
||||
bool fields_valid = (!string.IsNullOrWhiteSpace (full_name) &&
|
||||
IsValidEmail (email));
|
||||
bool fields_valid = full_name != null && full_name.Trim().Length > 0 &&
|
||||
IsValidEmail (email);
|
||||
|
||||
if (UpdateSetupContinueButtonEvent != null)
|
||||
UpdateSetupContinueButtonEvent (fields_valid);
|
||||
|
@ -226,8 +226,8 @@ namespace SparkleShare {
|
|||
address = address.Trim ();
|
||||
remote_path = remote_path.Trim ();
|
||||
|
||||
bool fields_valid = (!string.IsNullOrWhiteSpace (address) &&
|
||||
!string.IsNullOrWhiteSpace (remote_path));
|
||||
bool fields_valid = address != null && address.Trim().Length > 0 &&
|
||||
remote_path != null && remote_path.Trim().Length > 0;
|
||||
|
||||
if (UpdateAddProjectButtonEvent != null)
|
||||
UpdateAddProjectButtonEvent (fields_valid);
|
||||
|
|
Loading…
Reference in a new issue