setup mac: change the last tutorial page. present link code with copy button
This commit is contained in:
parent
d79f093996
commit
c88a0a5a4b
|
@ -132,18 +132,15 @@ namespace SparkleLib {
|
|||
public SparkleUser User {
|
||||
get {
|
||||
XmlNode name_node = SelectSingleNode ("/sparkleshare/user/name/text()");
|
||||
string name = name_node.Value;
|
||||
|
||||
XmlNode email_node = SelectSingleNode ("/sparkleshare/user/email/text()");
|
||||
string email = email_node.Value;
|
||||
string user_name = name_node.Value;
|
||||
string user_email = email_node.Value;
|
||||
|
||||
string pubkey_file_path = Path.Combine (
|
||||
Path.GetDirectoryName (FullPath), "sparkleshare." + email + ".key.pub");
|
||||
SparkleUser user = new SparkleUser (user_name, user_email);
|
||||
string [] pubkey_file_paths = Directory.GetFiles (Path.GetDirectoryName (FullPath), "*.pub");
|
||||
|
||||
SparkleUser user = new SparkleUser (name, email);
|
||||
|
||||
if (File.Exists (pubkey_file_path))
|
||||
user.PublicKey = File.ReadAllText (pubkey_file_path);
|
||||
if (pubkey_file_paths.Length > 0)
|
||||
user.PublicKey = File.ReadAllText (pubkey_file_paths [0]);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
@ -152,9 +149,8 @@ namespace SparkleLib {
|
|||
SparkleUser user = (SparkleUser) value;
|
||||
|
||||
XmlNode name_node = SelectSingleNode ("/sparkleshare/user/name/text()");
|
||||
name_node.InnerText = user.Name;
|
||||
|
||||
XmlNode email_node = SelectSingleNode ("/sparkleshare/user/email/text()");
|
||||
name_node.InnerText = user.Name;
|
||||
email_node.InnerText = user.Email;
|
||||
|
||||
Save ();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
dist_pixmaps_DATA = \
|
||||
tutorial-slide-4.png \
|
||||
side-splash.png \
|
||||
user-icon-default.png \
|
||||
about.png
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace SparkleShare {
|
|||
|
||||
private NSButton ContinueButton;
|
||||
private NSButton AddButton;
|
||||
private NSButton CopyButton;
|
||||
private NSButton TryAgainButton;
|
||||
private NSButton CancelButton;
|
||||
private NSButton SkipTutorialButton;
|
||||
|
@ -51,6 +52,7 @@ namespace SparkleShare {
|
|||
private NSTextField EmailHelpLabel;
|
||||
private NSTextField FullNameTextField;
|
||||
private NSTextField FullNameLabel;
|
||||
private NSTextField LinkCodeTextField;
|
||||
private NSTextField AddressTextField;
|
||||
private NSTextField AddressLabel;
|
||||
private NSTextField AddressHelpLabel;
|
||||
|
@ -832,6 +834,7 @@ namespace SparkleShare {
|
|||
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||
"Pixmaps", "tutorial-slide-" + Controller.TutorialPageNumber + ".png");
|
||||
|
||||
if (File.Exists (slide_image_path)) {
|
||||
SlideImage = new NSImage (slide_image_path) {
|
||||
Size = new SizeF (350, 200)
|
||||
};
|
||||
|
@ -842,7 +845,7 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
ContentView.AddSubview (SlideImageView);
|
||||
|
||||
}
|
||||
|
||||
switch (Controller.TutorialPageNumber) {
|
||||
|
||||
|
@ -915,10 +918,25 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
case 4: {
|
||||
Header = "Adding projects to SparkleShare";
|
||||
Description = "You can do this through the status icon menu, or by clicking " +
|
||||
"magic buttons on webpages that look like this:";
|
||||
Header = "Here's your unique link code";
|
||||
Description = "You'll need it whenever you want to link this computer to a host" +
|
||||
" (we keep a copy in your SparkleShare folder).";
|
||||
|
||||
LinkCodeTextField = new NSTextField () {
|
||||
StringValue = Program.Controller.CurrentUser.PublicKey,
|
||||
Enabled = false,
|
||||
Selectable = false,
|
||||
Frame = new RectangleF (230, Frame.Height - 238, 246, 22)
|
||||
};
|
||||
|
||||
LinkCodeTextField.Cell.UsesSingleLineMode = true;
|
||||
LinkCodeTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||
|
||||
CopyButton = new NSButton () {
|
||||
Title = "Copy",
|
||||
BezelStyle = NSBezelStyle.RoundRect,
|
||||
Frame = new RectangleF (480, Frame.Height - 238, 60, 22)
|
||||
};
|
||||
|
||||
StartupCheckButton = new NSButton () {
|
||||
Frame = new RectangleF (190, Frame.Height - 400, 300, 18),
|
||||
|
@ -932,8 +950,11 @@ namespace SparkleShare {
|
|||
Title = "Finish"
|
||||
};
|
||||
|
||||
SlideImage.Size = new SizeF (350, 64);
|
||||
|
||||
CopyButton.Activated += delegate {
|
||||
NSPasteboard.GeneralPasteboard.ClearContents ();
|
||||
NSPasteboard.GeneralPasteboard.SetStringForType (LinkCodeTextField.StringValue,
|
||||
"NSStringPboardType");
|
||||
};
|
||||
|
||||
StartupCheckButton.Activated += delegate {
|
||||
Controller.StartupItemChanged (StartupCheckButton.State == NSCellStateValue.On);
|
||||
|
@ -943,8 +964,10 @@ namespace SparkleShare {
|
|||
Controller.TutorialPageCompleted ();
|
||||
};
|
||||
|
||||
|
||||
ContentView.AddSubview (LinkCodeTextField);
|
||||
ContentView.AddSubview (CopyButton);
|
||||
ContentView.AddSubview (StartupCheckButton);
|
||||
|
||||
Buttons.Add (FinishButton);
|
||||
|
||||
break;
|
||||
|
|
|
@ -157,9 +157,6 @@
|
|||
<Content Include="Pixmaps\tutorial-slide-3.png">
|
||||
<Link>Pixmaps\tutorial-slide-3.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\Common\Pixmaps\tutorial-slide-4.png">
|
||||
<Link>Pixmaps\tutorial-slide-4.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\Common\Plugins\bitbucket.xml">
|
||||
<Link>Plugins\bitbucket.xml</Link>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in a new issue