mac: clean up
This commit is contained in:
parent
b7808ecbe4
commit
c7e8e910ee
|
@ -50,8 +50,19 @@ namespace SparkleShare {
|
||||||
HasShadow = true;
|
HasShadow = true;
|
||||||
BackingType = NSBackingStore.Buffered;
|
BackingType = NSBackingStore.Buffered;
|
||||||
|
|
||||||
|
this.hidden_close_button = new NSButton () {
|
||||||
|
Frame = new RectangleF (0, 0, 0, 0),
|
||||||
|
KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask,
|
||||||
|
KeyEquivalent = "w"
|
||||||
|
};
|
||||||
|
|
||||||
CreateAbout ();
|
CreateAbout ();
|
||||||
|
|
||||||
|
|
||||||
|
this.hidden_close_button.Activated += delegate {
|
||||||
|
Controller.WindowClosed ();
|
||||||
|
};
|
||||||
|
|
||||||
Controller.HideWindowEvent += delegate {
|
Controller.HideWindowEvent += delegate {
|
||||||
Program.Controller.Invoke (() => PerformClose (this));
|
Program.Controller.Invoke (() => PerformClose (this));
|
||||||
};
|
};
|
||||||
|
@ -77,6 +88,9 @@ namespace SparkleShare {
|
||||||
this.updates_text_field.StringValue = "Checking for updates...";
|
this.updates_text_field.StringValue = "Checking for updates...";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ContentView.AddSubview (this.hidden_close_button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,40 +104,32 @@ namespace SparkleShare {
|
||||||
Frame = new RectangleF (0, 0, 640, 260)
|
Frame = new RectangleF (0, 0, 640, 260)
|
||||||
};
|
};
|
||||||
|
|
||||||
this.version_text_field = new NSTextField () {
|
this.version_text_field = new SparkleLabel ("version " + Controller.RunningVersion, NSTextAlignment.Left) {
|
||||||
StringValue = "version " + Controller.RunningVersion,
|
|
||||||
Frame = new RectangleF (295, 140, 318, 22),
|
|
||||||
BackgroundColor = NSColor.White,
|
|
||||||
Bordered = false,
|
|
||||||
Editable = false,
|
|
||||||
DrawsBackground = false,
|
DrawsBackground = false,
|
||||||
|
Frame = new RectangleF (295, 140, 318, 22),
|
||||||
TextColor = NSColor.White,
|
TextColor = NSColor.White,
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
||||||
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
|
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updates_text_field = new NSTextField () {
|
this.updates_text_field = new SparkleLabel ("Checking for updates...", NSTextAlignment.Left) {
|
||||||
StringValue = "Checking for updates...",
|
|
||||||
Frame = new RectangleF (295, Frame.Height - 232, 318, 98),
|
|
||||||
Bordered = false,
|
|
||||||
Editable = false,
|
|
||||||
DrawsBackground = false,
|
DrawsBackground = false,
|
||||||
|
Frame = new RectangleF (295, Frame.Height - 232, 318, 98),
|
||||||
TextColor = NSColor.FromCalibratedRgba (1.0f, 1.0f, 1.0f, 0.5f),
|
TextColor = NSColor.FromCalibratedRgba (1.0f, 1.0f, 1.0f, 0.5f),
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
||||||
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
|
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
|
||||||
};
|
};
|
||||||
|
|
||||||
this.credits_text_field = new NSTextField () {
|
this.credits_text_field = new SparkleLabel (
|
||||||
StringValue = @"Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others." +
|
@"Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others." +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"SparkleShare is Open Source software. You are free to use, modify, and redistribute it " +
|
"SparkleShare is Open Source software. You are free to use, modify, and redistribute it " +
|
||||||
"under the GNU General Public License version 3 or later.",
|
"under the GNU General Public License version 3 or later.", NSTextAlignment.Left) {
|
||||||
|
|
||||||
|
DrawsBackground = false,
|
||||||
Frame = new RectangleF (295, Frame.Height - 260, 318, 98),
|
Frame = new RectangleF (295, Frame.Height - 260, 318, 98),
|
||||||
TextColor = NSColor.White,
|
TextColor = NSColor.White,
|
||||||
DrawsBackground = false,
|
|
||||||
Bordered = false,
|
|
||||||
Editable = false,
|
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
Font = NSFontManager.SharedFontManager.FontWithFamily (
|
||||||
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11),
|
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11),
|
||||||
};
|
};
|
||||||
|
@ -145,20 +151,8 @@ namespace SparkleShare {
|
||||||
this.debug_log_link.Frame = new RectangleF (
|
this.debug_log_link.Frame = new RectangleF (
|
||||||
new PointF (this.report_problem_link.Frame.X + this.report_problem_link.Frame.Width + 10, 25),
|
new PointF (this.report_problem_link.Frame.X + this.report_problem_link.Frame.Width + 10, 25),
|
||||||
this.debug_log_link.Frame.Size);
|
this.debug_log_link.Frame.Size);
|
||||||
|
|
||||||
this.hidden_close_button = new NSButton () {
|
|
||||||
Frame = new RectangleF (0, 0, 0, 0),
|
|
||||||
KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask,
|
|
||||||
KeyEquivalent = "w"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
this.hidden_close_button.Activated += delegate {
|
|
||||||
Controller.WindowClosed ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (this.hidden_close_button);
|
|
||||||
ContentView.AddSubview (this.about_image_view);
|
ContentView.AddSubview (this.about_image_view);
|
||||||
ContentView.AddSubview (this.version_text_field);
|
ContentView.AddSubview (this.version_text_field);
|
||||||
ContentView.AddSubview (this.updates_text_field);
|
ContentView.AddSubview (this.updates_text_field);
|
||||||
|
|
|
@ -52,15 +52,11 @@ namespace SparkleShare {
|
||||||
public SparkleSetup () : base ()
|
public SparkleSetup () : base ()
|
||||||
{
|
{
|
||||||
Controller.HideWindowEvent += delegate {
|
Controller.HideWindowEvent += delegate {
|
||||||
Program.Controller.Invoke (() => {
|
Program.Controller.Invoke (() => PerformClose (this));
|
||||||
PerformClose (this);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Controller.ShowWindowEvent += delegate {
|
Controller.ShowWindowEvent += delegate {
|
||||||
Program.Controller.Invoke (() => {
|
Program.Controller.Invoke (() => OrderFrontRegardless ());
|
||||||
OrderFrontRegardless ();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Controller.ChangePageEvent += delegate (PageType type, string [] warnings) {
|
Controller.ChangePageEvent += delegate (PageType type, string [] warnings) {
|
||||||
|
@ -79,12 +75,8 @@ namespace SparkleShare {
|
||||||
Header = "Welcome to SparkleShare!";
|
Header = "Welcome to SparkleShare!";
|
||||||
Description = "First off, what's your name and email?\n(visible only to team members)";
|
Description = "First off, what's your name and email?\n(visible only to team members)";
|
||||||
|
|
||||||
|
FullNameLabel = new SparkleLabel ("Full Name:", NSTextAlignment.Right);
|
||||||
FullNameLabel = new SparkleLabel () {
|
FullNameLabel.Frame = new RectangleF (165, Frame.Height - 234, 160, 17);
|
||||||
Alignment = NSTextAlignment.Right,
|
|
||||||
Frame = new RectangleF (165, Frame.Height - 234, 160, 17),
|
|
||||||
StringValue = "Full Name:"
|
|
||||||
};
|
|
||||||
|
|
||||||
FullNameTextField = new NSTextField () {
|
FullNameTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (330, Frame.Height - 238, 196, 22),
|
Frame = new RectangleF (330, Frame.Height - 238, 196, 22),
|
||||||
|
@ -92,21 +84,15 @@ namespace SparkleShare {
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
EmailLabel = new SparkleLabel () {
|
EmailLabel = new SparkleLabel ("Email:", NSTextAlignment.Right);
|
||||||
Alignment = NSTextAlignment.Right,
|
EmailLabel.Frame = new RectangleF (165, Frame.Height - 264, 160, 17);
|
||||||
Frame = new RectangleF (165, Frame.Height - 264, 160, 17),
|
|
||||||
StringValue = "Email:"
|
|
||||||
};
|
|
||||||
|
|
||||||
EmailTextField = new NSTextField () {
|
EmailTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (330, Frame.Height - 268, 196, 22),
|
Frame = new RectangleF (330, Frame.Height - 268, 196, 22),
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
ContinueButton = new NSButton () {
|
||||||
Title = "Continue",
|
Title = "Continue",
|
||||||
|
@ -129,9 +115,7 @@ namespace SparkleShare {
|
||||||
Controller.SetupPageCompleted (full_name, email);
|
Controller.SetupPageCompleted (full_name, email);
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.SetupPageCancelled (); };
|
||||||
Controller.SetupPageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) {
|
Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) {
|
||||||
Program.Controller.Invoke (() => {
|
Program.Controller.Invoke (() => {
|
||||||
|
@ -155,47 +139,28 @@ namespace SparkleShare {
|
||||||
Header = "You've received an invite!";
|
Header = "You've received an invite!";
|
||||||
Description = "Do you want to add this project to SparkleShare?";
|
Description = "Do you want to add this project to SparkleShare?";
|
||||||
|
|
||||||
|
AddressLabel = new SparkleLabel ("Address:", NSTextAlignment.Right);
|
||||||
AddressLabel = new SparkleLabel () {
|
AddressLabel.Frame = new RectangleF (165, Frame.Height - 240, 160, 17);
|
||||||
Alignment = NSTextAlignment.Right,
|
|
||||||
Frame = new RectangleF (165, Frame.Height - 240, 160, 17),
|
AddressTextField = new SparkleLabel (Controller.PendingInvite.Address, NSTextAlignment.Left) {
|
||||||
StringValue = "Address:"
|
Frame = new RectangleF (330, Frame.Height - 240, 260, 17),
|
||||||
|
Font = SparkleUI.BoldFont
|
||||||
};
|
};
|
||||||
|
|
||||||
PathLabel = new SparkleLabel () {
|
PathLabel = new SparkleLabel ("Remote Path:", NSTextAlignment.Right);
|
||||||
Alignment = NSTextAlignment.Right,
|
PathLabel.Frame = new RectangleF (165, Frame.Height - 264, 160, 17);
|
||||||
Frame = new RectangleF (165, Frame.Height - 264, 160, 17),
|
|
||||||
StringValue = "Remote Path:"
|
PathTextField = new SparkleLabel (Controller.PendingInvite.RemotePath, NSTextAlignment.Left) {
|
||||||
|
Frame = new RectangleF (330, Frame.Height - 264, 260, 17),
|
||||||
|
Font = SparkleUI.BoldFont
|
||||||
};
|
};
|
||||||
|
|
||||||
AddressTextField = new SparkleLabel () {
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
Frame = new RectangleF (330, Frame.Height - 240, 260, 17),
|
AddButton = new NSButton () { Title = "Add" };
|
||||||
StringValue = Controller.PendingInvite.Address,
|
|
||||||
Font = SparkleUI.BoldFont
|
|
||||||
};
|
|
||||||
|
|
||||||
PathTextField = new SparkleLabel () {
|
|
||||||
Frame = new RectangleF (330, Frame.Height - 264, 260, 17),
|
|
||||||
StringValue = Controller.PendingInvite.RemotePath,
|
|
||||||
Font = SparkleUI.BoldFont
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
AddButton = new NSButton () {
|
|
||||||
Title = "Add"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.PageCancelled (); };
|
||||||
Controller.PageCancelled ();
|
AddButton.Activated += delegate { Controller.InvitePageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
AddButton.Activated += delegate {
|
|
||||||
Controller.InvitePageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (AddressLabel);
|
ContentView.AddSubview (AddressLabel);
|
||||||
|
@ -211,11 +176,9 @@ namespace SparkleShare {
|
||||||
Header = "Where's your project hosted?";
|
Header = "Where's your project hosted?";
|
||||||
Description = "";
|
Description = "";
|
||||||
|
|
||||||
|
AddressLabel = new SparkleLabel ("Address:", NSTextAlignment.Left) {
|
||||||
AddressLabel = new SparkleLabel () {
|
Frame = new RectangleF (190, Frame.Height - 308, 160, 17),
|
||||||
Frame = new RectangleF (190, Frame.Height - 308, 160, 17),
|
Font = SparkleUI.BoldFont
|
||||||
StringValue = "Address:",
|
|
||||||
Font = SparkleUI.BoldFont
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AddressTextField = new NSTextField () {
|
AddressTextField = new NSTextField () {
|
||||||
|
@ -228,10 +191,9 @@ namespace SparkleShare {
|
||||||
|
|
||||||
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
|
|
||||||
PathLabel = new SparkleLabel () {
|
PathLabel = new SparkleLabel ("Remote Path:", NSTextAlignment.Left) {
|
||||||
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 308, 160, 17),
|
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 308, 160, 17),
|
||||||
StringValue = "Remote Path:",
|
Font = SparkleUI.BoldFont
|
||||||
Font = SparkleUI.BoldFont
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PathTextField = new NSTextField () {
|
PathTextField = new NSTextField () {
|
||||||
|
@ -243,20 +205,18 @@ namespace SparkleShare {
|
||||||
|
|
||||||
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
|
|
||||||
PathHelpLabel = new SparkleLabel () {
|
PathHelpLabel = new SparkleLabel (Controller.SelectedPlugin.PathExample, NSTextAlignment.Left) {
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 355, 204, 17),
|
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 355, 204, 17),
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
||||||
NSFontTraitMask.Condensed, 0, 11),
|
NSFontTraitMask.Condensed, 0, 11),
|
||||||
StringValue = "" + Controller.SelectedPlugin.PathExample
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AddressHelpLabel = new SparkleLabel () {
|
AddressHelpLabel = new SparkleLabel (Controller.SelectedPlugin.AddressExample, NSTextAlignment.Left) {
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
||||||
NSFontTraitMask.Condensed, 0, 11),
|
NSFontTraitMask.Condensed, 0, 11),
|
||||||
StringValue = "" + Controller.SelectedPlugin.AddressExample
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TableView = new NSTableView () {
|
TableView = new NSTableView () {
|
||||||
|
@ -275,11 +235,9 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
IconColumn = new NSTableColumn (new NSImage ()) {
|
IconColumn = new NSTableColumn (new NSImage ()) {
|
||||||
Width = 36,
|
Width = 36,
|
||||||
HeaderToolTip = "Icon",
|
HeaderToolTip = "Icon",
|
||||||
DataCell = new NSImageCell () {
|
DataCell = new NSImageCell () { ImageAlignment = NSImageAlignment.Right }
|
||||||
ImageAlignment = NSImageAlignment.Right
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DescriptionColumn = new NSTableColumn () {
|
DescriptionColumn = new NSTableColumn () {
|
||||||
|
@ -314,9 +272,7 @@ namespace SparkleShare {
|
||||||
Enabled = false
|
Enabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Controller.ChangeAddressFieldEvent += delegate (string text, string example_text, FieldState state) {
|
Controller.ChangeAddressFieldEvent += delegate (string text, string example_text, FieldState state) {
|
||||||
|
@ -359,9 +315,7 @@ namespace SparkleShare {
|
||||||
Controller.AddPageCompleted (AddressTextField.StringValue, PathTextField.StringValue);
|
Controller.AddPageCompleted (AddressTextField.StringValue, PathTextField.StringValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.PageCancelled (); };
|
||||||
Controller.PageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Controller.UpdateAddProjectButtonEvent += delegate (bool button_enabled) {
|
Controller.UpdateAddProjectButtonEvent += delegate (bool button_enabled) {
|
||||||
Program.Controller.Invoke (() => {
|
Program.Controller.Invoke (() => {
|
||||||
|
@ -389,7 +343,6 @@ namespace SparkleShare {
|
||||||
Header = "Adding project ‘" + Controller.SyncingFolder + "’…";
|
Header = "Adding project ‘" + Controller.SyncingFolder + "’…";
|
||||||
Description = "This may take a while for large projects.\nIsn't it coffee-o'clock?";
|
Description = "This may take a while for large projects.\nIsn't it coffee-o'clock?";
|
||||||
|
|
||||||
|
|
||||||
ProgressIndicator = new NSProgressIndicator () {
|
ProgressIndicator = new NSProgressIndicator () {
|
||||||
Frame = new RectangleF (190, Frame.Height - 200, 640 - 150 - 80, 20),
|
Frame = new RectangleF (190, Frame.Height - 200, 640 - 150 - 80, 20),
|
||||||
Style = NSProgressIndicatorStyle.Bar,
|
Style = NSProgressIndicatorStyle.Bar,
|
||||||
|
@ -401,9 +354,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ProgressIndicator.StartAnimation (this);
|
ProgressIndicator.StartAnimation (this);
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
FinishButton = new NSButton () {
|
||||||
Title = "Finish",
|
Title = "Finish",
|
||||||
|
@ -417,9 +368,7 @@ namespace SparkleShare {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.SyncingCancelled (); };
|
||||||
Controller.SyncingCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (ProgressIndicator);
|
ContentView.AddSubview (ProgressIndicator);
|
||||||
|
@ -432,7 +381,6 @@ namespace SparkleShare {
|
||||||
Header = "Oops! Something went wrong…";
|
Header = "Oops! Something went wrong…";
|
||||||
Description = "Please check the following:";
|
Description = "Please check the following:";
|
||||||
|
|
||||||
|
|
||||||
// Displaying marked up text with Cocoa is
|
// Displaying marked up text with Cocoa is
|
||||||
// a pain, so we just use a webview instead
|
// a pain, so we just use a webview instead
|
||||||
WebView web_view = new WebView ();
|
WebView web_view = new WebView ();
|
||||||
|
@ -476,22 +424,12 @@ namespace SparkleShare {
|
||||||
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
||||||
web_view.DrawsBackground = false;
|
web_view.DrawsBackground = false;
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
Title = "Cancel"
|
TryAgainButton = new NSButton () { Title = "Try Again…" };
|
||||||
};
|
|
||||||
|
|
||||||
TryAgainButton = new NSButton () {
|
|
||||||
Title = "Try Again…"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.PageCancelled (); };
|
||||||
Controller.PageCancelled ();
|
TryAgainButton.Activated += delegate { Controller.ErrorPageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
TryAgainButton.Activated += delegate {
|
|
||||||
Controller.ErrorPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (web_view);
|
ContentView.AddSubview (web_view);
|
||||||
|
@ -515,10 +453,8 @@ namespace SparkleShare {
|
||||||
if (type == PageType.CryptoPassword)
|
if (type == PageType.CryptoPassword)
|
||||||
extra_pos_y = 20;
|
extra_pos_y = 20;
|
||||||
|
|
||||||
PasswordLabel = new SparkleLabel () {
|
PasswordLabel = new SparkleLabel ("Password:", NSTextAlignment.Right) {
|
||||||
Alignment = NSTextAlignment.Right,
|
|
||||||
Frame = new RectangleF (155, Frame.Height - 204 - extra_pos_y, 160, 17),
|
Frame = new RectangleF (155, Frame.Height - 204 - extra_pos_y, 160, 17),
|
||||||
StringValue = "Password:",
|
|
||||||
Font = SparkleUI.BoldFont
|
Font = SparkleUI.BoldFont
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -548,14 +484,11 @@ namespace SparkleShare {
|
||||||
Frame = new RectangleF (200, Frame.Height - 320, 24, 24)
|
Frame = new RectangleF (200, Frame.Height - 320, 24, 24)
|
||||||
};
|
};
|
||||||
|
|
||||||
WarningTextField = new SparkleLabel () {
|
WarningTextField = new SparkleLabel ("This password can't be changed later, and your files can't be recovered if it's forgotten.", NSTextAlignment.Left) {
|
||||||
Frame = new RectangleF (235, Frame.Height - 390, 325, 100),
|
Frame = new RectangleF (235, Frame.Height - 390, 325, 100),
|
||||||
StringValue = "This password can't be changed later, and your files can't be recovered if it's forgotten."
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
CancelButton = new NSButton () { Title = "Cancel" };
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
ContinueButton = new NSButton () {
|
||||||
Title = "Continue",
|
Title = "Continue",
|
||||||
|
@ -592,7 +525,6 @@ namespace SparkleShare {
|
||||||
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Controller.UpdateCryptoPasswordContinueButtonEvent += delegate (bool button_enabled) {
|
Controller.UpdateCryptoPasswordContinueButtonEvent += delegate (bool button_enabled) {
|
||||||
Program.Controller.Invoke (() => { ContinueButton.Enabled = button_enabled; });
|
Program.Controller.Invoke (() => { ContinueButton.Enabled = button_enabled; });
|
||||||
};
|
};
|
||||||
|
@ -608,9 +540,7 @@ namespace SparkleShare {
|
||||||
Controller.CryptoPasswordPageCompleted (PasswordTextField.StringValue);
|
Controller.CryptoPasswordPageCompleted (PasswordTextField.StringValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate { Controller.CryptoPageCancelled (); };
|
||||||
Controller.CryptoPageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (PasswordLabel);
|
ContentView.AddSubview (PasswordLabel);
|
||||||
|
@ -633,7 +563,6 @@ namespace SparkleShare {
|
||||||
Header = "Your shared project is ready!";
|
Header = "Your shared project is ready!";
|
||||||
Description = "You can find the files in your SparkleShare folder.";
|
Description = "You can find the files in your SparkleShare folder.";
|
||||||
|
|
||||||
|
|
||||||
if (warnings.Length > 0) {
|
if (warnings.Length > 0) {
|
||||||
WarningImage = NSImage.ImageNamed ("NSInfo");
|
WarningImage = NSImage.ImageNamed ("NSInfo");
|
||||||
WarningImage.Size = new SizeF (24, 24);
|
WarningImage.Size = new SizeF (24, 24);
|
||||||
|
@ -643,32 +572,19 @@ namespace SparkleShare {
|
||||||
Frame = new RectangleF (200, Frame.Height - 175, 24, 24)
|
Frame = new RectangleF (200, Frame.Height - 175, 24, 24)
|
||||||
};
|
};
|
||||||
|
|
||||||
WarningTextField = new SparkleLabel () {
|
WarningTextField = new SparkleLabel (warnings [0], NSTextAlignment.Left);
|
||||||
Frame = new RectangleF (235, Frame.Height - 245, 325, 100),
|
WarningTextField.Frame = new RectangleF (235, Frame.Height - 245, 325, 100);
|
||||||
StringValue = warnings [0]
|
|
||||||
};
|
|
||||||
|
|
||||||
ContentView.AddSubview (WarningImageView);
|
ContentView.AddSubview (WarningImageView);
|
||||||
ContentView.AddSubview (WarningTextField);
|
ContentView.AddSubview (WarningTextField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShowFilesButton = new NSButton () { Title = "Show Files…" };
|
||||||
ShowFilesButton = new NSButton () {
|
FinishButton = new NSButton () { Title = "Finish" };
|
||||||
Title = "Show Files…"
|
|
||||||
};
|
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
|
||||||
Title = "Finish"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ShowFilesButton.Activated += delegate {
|
ShowFilesButton.Activated += delegate { Controller.ShowFilesClicked (); };
|
||||||
Controller.ShowFilesClicked ();
|
FinishButton.Activated += delegate { Controller.FinishPageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
|
||||||
Controller.FinishPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Buttons.Add (FinishButton);
|
Buttons.Add (FinishButton);
|
||||||
|
@ -701,23 +617,12 @@ namespace SparkleShare {
|
||||||
Description = "SparkleShare creates a special folder on your computer " +
|
Description = "SparkleShare creates a special folder on your computer " +
|
||||||
"that will keep track of your projects.";
|
"that will keep track of your projects.";
|
||||||
|
|
||||||
|
SkipTutorialButton = new NSButton () { Title = "Skip Tutorial" };
|
||||||
SkipTutorialButton = new NSButton () {
|
ContinueButton = new NSButton () { Title = "Continue" };
|
||||||
Title = "Skip Tutorial"
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
|
||||||
Title = "Continue"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
SkipTutorialButton.Activated += delegate {
|
SkipTutorialButton.Activated += delegate { Controller.TutorialSkipped (); };
|
||||||
Controller.TutorialSkipped ();
|
ContinueButton.Activated += delegate { Controller.TutorialPageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
|
||||||
Controller.TutorialPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (SlideImageView);
|
ContentView.AddSubview (SlideImageView);
|
||||||
|
@ -733,14 +638,8 @@ namespace SparkleShare {
|
||||||
Description = "All files added to your project folders are synced automatically with " +
|
Description = "All files added to your project folders are synced automatically with " +
|
||||||
"the host and your team members.";
|
"the host and your team members.";
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
ContinueButton = new NSButton () { Title = "Continue" };
|
||||||
Title = "Continue"
|
ContinueButton.Activated += delegate { Controller.TutorialPageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
|
||||||
Controller.TutorialPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -751,14 +650,8 @@ namespace SparkleShare {
|
||||||
Description = "It shows the syncing progress, provides easy access to " +
|
Description = "It shows the syncing progress, provides easy access to " +
|
||||||
"your projects and let's you view recent changes.";
|
"your projects and let's you view recent changes.";
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
ContinueButton = new NSButton () { Title = "Continue" };
|
||||||
Title = "Continue"
|
ContinueButton.Activated += delegate { Controller.TutorialPageCompleted (); };
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
|
||||||
Controller.TutorialPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -780,9 +673,9 @@ namespace SparkleShare {
|
||||||
LinkCodeTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
LinkCodeTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
|
|
||||||
CopyButton = new NSButton () {
|
CopyButton = new NSButton () {
|
||||||
Title = "Copy",
|
Title = "Copy",
|
||||||
BezelStyle = NSBezelStyle.RoundRect,
|
BezelStyle = NSBezelStyle.RoundRect,
|
||||||
Frame = new RectangleF (480, Frame.Height - 238, 60, 22)
|
Frame = new RectangleF (480, Frame.Height - 238, 60, 22)
|
||||||
};
|
};
|
||||||
|
|
||||||
StartupCheckButton = new NSButton () {
|
StartupCheckButton = new NSButton () {
|
||||||
|
@ -793,9 +686,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
StartupCheckButton.SetButtonType (NSButtonType.Switch);
|
StartupCheckButton.SetButtonType (NSButtonType.Switch);
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
FinishButton = new NSButton () { Title = "Finish" };
|
||||||
Title = "Finish"
|
|
||||||
};
|
|
||||||
|
|
||||||
CopyButton.Activated += delegate {
|
CopyButton.Activated += delegate {
|
||||||
NSPasteboard.GeneralPasteboard.ClearContents ();
|
NSPasteboard.GeneralPasteboard.ClearContents ();
|
||||||
|
@ -807,10 +699,9 @@ namespace SparkleShare {
|
||||||
Controller.StartupItemChanged (StartupCheckButton.State == NSCellStateValue.On);
|
Controller.StartupItemChanged (StartupCheckButton.State == NSCellStateValue.On);
|
||||||
};
|
};
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
FinishButton.Activated += delegate { Controller.TutorialPageCompleted (); };
|
||||||
Controller.TutorialPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
ContentView.AddSubview (LinkCodeTextField);
|
ContentView.AddSubview (LinkCodeTextField);
|
||||||
ContentView.AddSubview (CopyButton);
|
ContentView.AddSubview (CopyButton);
|
||||||
ContentView.AddSubview (StartupCheckButton);
|
ContentView.AddSubview (StartupCheckButton);
|
||||||
|
@ -953,8 +844,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleLabel : NSTextField {
|
public class SparkleLabel : NSTextField {
|
||||||
|
|
||||||
public SparkleLabel () : base ()
|
public SparkleLabel (string label, NSTextAlignment alignment)
|
||||||
{
|
{
|
||||||
|
Alignment = alignment;
|
||||||
|
StringValue = label;
|
||||||
BackgroundColor = NSColor.WindowBackground;
|
BackgroundColor = NSColor.WindowBackground;
|
||||||
Bordered = false;
|
Bordered = false;
|
||||||
Editable = false;
|
Editable = false;
|
||||||
|
|
Loading…
Reference in a new issue