setup: code cleanup
This commit is contained in:
parent
1efff92862
commit
d2214e525b
|
@ -25,6 +25,8 @@ using MonoMac.AppKit;
|
||||||
using MonoMac.ObjCRuntime;
|
using MonoMac.ObjCRuntime;
|
||||||
using MonoMac.WebKit;
|
using MonoMac.WebKit;
|
||||||
|
|
||||||
|
using Mono.Unix;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleSetup : SparkleSetupWindow {
|
public class SparkleSetup : SparkleSetupWindow {
|
||||||
|
@ -86,12 +88,20 @@ namespace SparkleShare {
|
||||||
{
|
{
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
Reset ();
|
Reset ();
|
||||||
|
ShowPage (type, warnings);
|
||||||
|
ShowAll ();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case PageType.Setup: {
|
|
||||||
|
|
||||||
|
public void ShowPage (PageType type, string [] warnings)
|
||||||
|
{
|
||||||
|
if (type == PageType.Setup) {
|
||||||
Header = "Welcome to SparkleShare!";
|
Header = "Welcome to SparkleShare!";
|
||||||
Description = "First off, what's your name and email?\nThis information is only visible to team members.";
|
Description = "First off, what's your name and email?\n(visible only to team members)";
|
||||||
|
|
||||||
|
|
||||||
FullNameLabel = new NSTextField () {
|
FullNameLabel = new NSTextField () {
|
||||||
Alignment = NSTextAlignment.Right,
|
Alignment = NSTextAlignment.Right,
|
||||||
|
@ -105,7 +115,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
FullNameTextField = new NSTextField () {
|
FullNameTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (330, Frame.Height - 238, 196, 22),
|
Frame = new RectangleF (330, Frame.Height - 238, 196, 22),
|
||||||
StringValue = Controller.GuessedUserName,
|
StringValue = UnixUserInfo.GetRealUser ().RealName,
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,31 +131,27 @@ namespace SparkleShare {
|
||||||
|
|
||||||
EmailTextField = new NSTextField () {
|
EmailTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (330, Frame.Height - 268, 196, 22),
|
Frame = new RectangleF (330, Frame.Height - 268, 196, 22),
|
||||||
StringValue = Controller.GuessedUserEmail,
|
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CancelButton = new NSButton () {
|
||||||
(FullNameTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
Title = "Cancel"
|
||||||
Controller.CheckSetupPage (
|
|
||||||
FullNameTextField.StringValue,
|
|
||||||
EmailTextField.StringValue
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(EmailTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
|
||||||
Controller.CheckSetupPage (
|
|
||||||
FullNameTextField.StringValue,
|
|
||||||
EmailTextField.StringValue
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
ContinueButton = new NSButton () {
|
||||||
Title = "Continue",
|
Title = "Continue",
|
||||||
Enabled = false
|
Enabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
(FullNameTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
|
Controller.CheckSetupPage (FullNameTextField.StringValue, EmailTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
(EmailTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
|
Controller.CheckSetupPage (FullNameTextField.StringValue, EmailTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
ContinueButton.Activated += delegate {
|
||||||
string full_name = FullNameTextField.StringValue.Trim ();
|
string full_name = FullNameTextField.StringValue.Trim ();
|
||||||
string email = EmailTextField.StringValue.Trim ();
|
string email = EmailTextField.StringValue.Trim ();
|
||||||
|
@ -153,15 +159,10 @@ namespace SparkleShare {
|
||||||
Controller.SetupPageCompleted (full_name, email);
|
Controller.SetupPageCompleted (full_name, email);
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate {
|
||||||
Controller.SetupPageCancelled ();
|
Controller.SetupPageCancelled ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) {
|
Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) {
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
ContinueButton.Enabled = button_enabled;
|
ContinueButton.Enabled = button_enabled;
|
||||||
|
@ -177,16 +178,10 @@ namespace SparkleShare {
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
Controller.CheckSetupPage (
|
Controller.CheckSetupPage (FullNameTextField.StringValue, EmailTextField.StringValue);
|
||||||
FullNameTextField.StringValue,
|
|
||||||
EmailTextField.StringValue
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PageType.Invite: {
|
if (type == PageType.Invite) {
|
||||||
|
|
||||||
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?";
|
||||||
|
|
||||||
|
@ -231,40 +226,38 @@ namespace SparkleShare {
|
||||||
Font = SparkleUI.BoldFont
|
Font = SparkleUI.BoldFont
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (AddressLabel);
|
|
||||||
ContentView.AddSubview (PathLabel);
|
|
||||||
ContentView.AddSubview (AddressTextField);
|
|
||||||
ContentView.AddSubview (PathTextField);
|
|
||||||
|
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
CancelButton = new NSButton () {
|
||||||
Title = "Cancel"
|
Title = "Cancel"
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
|
||||||
Controller.PageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
AddButton = new NSButton () {
|
AddButton = new NSButton () {
|
||||||
Title = "Add"
|
Title = "Add"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CancelButton.Activated += delegate {
|
||||||
|
Controller.PageCancelled ();
|
||||||
|
};
|
||||||
|
|
||||||
AddButton.Activated += delegate {
|
AddButton.Activated += delegate {
|
||||||
Controller.InvitePageCompleted ();
|
Controller.InvitePageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ContentView.AddSubview (AddressLabel);
|
||||||
|
ContentView.AddSubview (PathLabel);
|
||||||
|
ContentView.AddSubview (AddressTextField);
|
||||||
|
ContentView.AddSubview (PathTextField);
|
||||||
|
|
||||||
Buttons.Add (AddButton);
|
Buttons.Add (AddButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PageType.Add: {
|
if (type == PageType.Add) {
|
||||||
|
|
||||||
Header = "Where's your project hosted?";
|
Header = "Where's your project hosted?";
|
||||||
Description = "";
|
Description = "";
|
||||||
|
|
||||||
|
|
||||||
AddressLabel = new NSTextField () {
|
AddressLabel = new NSTextField () {
|
||||||
Alignment = NSTextAlignment.Left,
|
Alignment = NSTextAlignment.Left,
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
@ -279,11 +272,11 @@ namespace SparkleShare {
|
||||||
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
|
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
|
||||||
Font = SparkleUI.Font,
|
Font = SparkleUI.Font,
|
||||||
Enabled = (Controller.SelectedPlugin.Address == null),
|
Enabled = (Controller.SelectedPlugin.Address == null),
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate (),
|
||||||
|
StringValue = "" + Controller.PreviousAddress
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Controller.PreviousAddress != null)
|
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
AddressTextField.StringValue = Controller.PreviousAddress;
|
|
||||||
|
|
||||||
PathLabel = new NSTextField () {
|
PathLabel = new NSTextField () {
|
||||||
Alignment = NSTextAlignment.Left,
|
Alignment = NSTextAlignment.Left,
|
||||||
|
@ -298,43 +291,34 @@ namespace SparkleShare {
|
||||||
PathTextField = new NSTextField () {
|
PathTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 336, 196, 22),
|
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 336, 196, 22),
|
||||||
Enabled = (Controller.SelectedPlugin.Path == null),
|
Enabled = (Controller.SelectedPlugin.Path == null),
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate (),
|
||||||
|
StringValue = "" + Controller.PreviousPath
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Controller.PreviousPath != null)
|
|
||||||
PathTextField.StringValue = Controller.PreviousPath;
|
|
||||||
|
|
||||||
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
|
||||||
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
|
|
||||||
|
|
||||||
PathHelpLabel = new NSTextField () {
|
PathHelpLabel = new NSTextField () {
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
Bordered = false,
|
Bordered = false,
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Editable = false,
|
Editable = false,
|
||||||
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
|
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
||||||
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
NSFontTraitMask.Condensed, 0, 11),
|
||||||
|
StringValue = "" + Controller.SelectedPlugin.PathExample
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Controller.SelectedPlugin.PathExample != null)
|
|
||||||
PathHelpLabel.StringValue = Controller.SelectedPlugin.PathExample;
|
|
||||||
|
|
||||||
AddressHelpLabel = new NSTextField () {
|
AddressHelpLabel = new NSTextField () {
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
Bordered = false,
|
Bordered = false,
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Editable = false,
|
Editable = false,
|
||||||
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily
|
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
||||||
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
NSFontTraitMask.Condensed, 0, 11),
|
||||||
|
StringValue = "" + Controller.SelectedPlugin.AddressExample
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Controller.SelectedPlugin.AddressExample != null)
|
|
||||||
AddressHelpLabel.StringValue = Controller.SelectedPlugin.AddressExample;
|
|
||||||
|
|
||||||
|
|
||||||
TableView = new NSTableView () {
|
TableView = new NSTableView () {
|
||||||
Frame = new RectangleF (0, 0, 0, 0),
|
Frame = new RectangleF (0, 0, 0, 0),
|
||||||
RowHeight = 34,
|
RowHeight = 34,
|
||||||
|
@ -364,9 +348,8 @@ namespace SparkleShare {
|
||||||
Editable = false
|
Editable = false
|
||||||
};
|
};
|
||||||
|
|
||||||
DescriptionColumn.DataCell.Font =
|
DescriptionColumn.DataCell.Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
||||||
NSFontManager.SharedFontManager.FontWithFamily (
|
NSFontTraitMask.Condensed, 0, 11);
|
||||||
"Lucida Grande", NSFontTraitMask.Condensed, 0, 11);
|
|
||||||
|
|
||||||
TableView.AddColumn (IconColumn);
|
TableView.AddColumn (IconColumn);
|
||||||
TableView.AddColumn (DescriptionColumn);
|
TableView.AddColumn (DescriptionColumn);
|
||||||
|
@ -376,8 +359,6 @@ namespace SparkleShare {
|
||||||
TableView.DataSource = DataSource;
|
TableView.DataSource = DataSource;
|
||||||
TableView.ReloadData ();
|
TableView.ReloadData ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HistoryCheckButton = new NSButton () {
|
HistoryCheckButton = new NSButton () {
|
||||||
Frame = new RectangleF (190, Frame.Height - 400, 300, 18),
|
Frame = new RectangleF (190, Frame.Height - 400, 300, 18),
|
||||||
Title = "Fetch prior revisions"
|
Title = "Fetch prior revisions"
|
||||||
|
@ -388,13 +369,14 @@ namespace SparkleShare {
|
||||||
|
|
||||||
HistoryCheckButton.SetButtonType (NSButtonType.Switch);
|
HistoryCheckButton.SetButtonType (NSButtonType.Switch);
|
||||||
|
|
||||||
HistoryCheckButton.Activated += delegate {
|
AddButton = new NSButton () {
|
||||||
Controller.HistoryItemChanged (HistoryCheckButton.State == NSCellStateValue.On);
|
Title = "Add",
|
||||||
|
Enabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CancelButton = new NSButton () {
|
||||||
|
Title = "Cancel"
|
||||||
ContentView.AddSubview (HistoryCheckButton);
|
};
|
||||||
|
|
||||||
|
|
||||||
Controller.ChangeAddressFieldEvent += delegate (string text,
|
Controller.ChangeAddressFieldEvent += delegate (string text,
|
||||||
|
@ -407,7 +389,6 @@ namespace SparkleShare {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Controller.ChangePathFieldEvent += delegate (string text,
|
Controller.ChangePathFieldEvent += delegate (string text,
|
||||||
string example_text, FieldState state) {
|
string example_text, FieldState state) {
|
||||||
|
|
||||||
|
@ -418,36 +399,33 @@ namespace SparkleShare {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
TableView.SelectRow (Controller.SelectedPluginIndex, false);
|
TableView.SelectRow (Controller.SelectedPluginIndex, false);
|
||||||
TableView.ScrollRowToVisible (Controller.SelectedPluginIndex);
|
TableView.ScrollRowToVisible (Controller.SelectedPluginIndex);
|
||||||
|
|
||||||
(AddressTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
(AddressTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
Controller.CheckAddPage (
|
Controller.CheckAddPage (AddressTextField.StringValue, PathTextField.StringValue, TableView.SelectedRow);
|
||||||
AddressTextField.StringValue,
|
|
||||||
PathTextField.StringValue,
|
|
||||||
TableView.SelectedRow
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(PathTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
(PathTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
Controller.CheckAddPage (
|
Controller.CheckAddPage (AddressTextField.StringValue, PathTextField.StringValue, TableView.SelectedRow);
|
||||||
AddressTextField.StringValue,
|
|
||||||
PathTextField.StringValue,
|
|
||||||
TableView.SelectedRow
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(TableView.Delegate as SparkleTableViewDelegate).SelectionChanged += delegate {
|
(TableView.Delegate as SparkleTableViewDelegate).SelectionChanged += delegate {
|
||||||
Controller.SelectedPluginChanged (TableView.SelectedRow);
|
Controller.SelectedPluginChanged (TableView.SelectedRow);
|
||||||
|
Controller.CheckAddPage (AddressTextField.StringValue, PathTextField.StringValue, TableView.SelectedRow);
|
||||||
Controller.CheckAddPage (
|
|
||||||
AddressTextField.StringValue,
|
|
||||||
PathTextField.StringValue,
|
|
||||||
TableView.SelectedRow
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HistoryCheckButton.Activated += delegate {
|
||||||
|
Controller.HistoryItemChanged (HistoryCheckButton.State == NSCellStateValue.On);
|
||||||
|
};
|
||||||
|
|
||||||
|
AddButton.Activated += delegate {
|
||||||
|
Controller.AddPageCompleted (AddressTextField.StringValue, PathTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
CancelButton.Activated += delegate {
|
||||||
|
Controller.PageCancelled ();
|
||||||
|
};
|
||||||
|
|
||||||
Controller.UpdateAddProjectButtonEvent += delegate (bool button_enabled) {
|
Controller.UpdateAddProjectButtonEvent += delegate (bool button_enabled) {
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
|
@ -463,44 +441,18 @@ namespace SparkleShare {
|
||||||
ContentView.AddSubview (PathLabel);
|
ContentView.AddSubview (PathLabel);
|
||||||
ContentView.AddSubview (PathTextField);
|
ContentView.AddSubview (PathTextField);
|
||||||
ContentView.AddSubview (PathHelpLabel);
|
ContentView.AddSubview (PathHelpLabel);
|
||||||
|
ContentView.AddSubview (HistoryCheckButton);
|
||||||
AddButton = new NSButton () {
|
|
||||||
Title = "Add",
|
|
||||||
Enabled = false
|
|
||||||
};
|
|
||||||
|
|
||||||
AddButton.Activated += delegate {
|
|
||||||
Controller.AddPageCompleted (
|
|
||||||
AddressTextField.StringValue,
|
|
||||||
PathTextField.StringValue
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (AddButton);
|
Buttons.Add (AddButton);
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
|
||||||
Controller.PageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
Controller.CheckAddPage (
|
Controller.CheckAddPage (AddressTextField.StringValue, PathTextField.StringValue, TableView.SelectedRow);
|
||||||
AddressTextField.StringValue,
|
|
||||||
PathTextField.StringValue,
|
|
||||||
TableView.SelectedRow
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PageType.Syncing: {
|
if (type == PageType.Syncing) {
|
||||||
Header = "Adding project ‘" + Controller.SyncingFolder + "’…";
|
Header = "Adding project ‘" + Controller.SyncingFolder + "’…";
|
||||||
Description = "This may either take a short or a long time depending on the project's size.";
|
Description = "This may take a while on big projects. Isn'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),
|
||||||
|
@ -513,38 +465,38 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ProgressIndicator.StartAnimation (this);
|
ProgressIndicator.StartAnimation (this);
|
||||||
|
|
||||||
Controller.UpdateProgressBarEvent += delegate (double percentage) {
|
CancelButton = new NSButton () {
|
||||||
InvokeOnMainThread (delegate {
|
Title = "Cancel"
|
||||||
ProgressIndicator.DoubleValue = percentage;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.AddSubview (ProgressIndicator);
|
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
FinishButton = new NSButton () {
|
||||||
Title = "Finish",
|
Title = "Finish",
|
||||||
Enabled = false
|
Enabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
Controller.UpdateProgressBarEvent += delegate (double percentage) {
|
||||||
|
InvokeOnMainThread (() => {
|
||||||
|
ProgressIndicator.DoubleValue = percentage;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate {
|
||||||
Controller.SyncingCancelled ();
|
Controller.SyncingCancelled ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ContentView.AddSubview (ProgressIndicator);
|
||||||
|
|
||||||
Buttons.Add (FinishButton);
|
Buttons.Add (FinishButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PageType.Error: {
|
if (type == PageType.Error) {
|
||||||
|
|
||||||
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 ();
|
||||||
|
@ -587,33 +539,31 @@ namespace SparkleShare {
|
||||||
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
||||||
web_view.DrawsBackground = false;
|
web_view.DrawsBackground = false;
|
||||||
|
|
||||||
ContentView.AddSubview (web_view);
|
CancelButton = new NSButton () {
|
||||||
|
Title = "Cancel"
|
||||||
|
};
|
||||||
|
|
||||||
TryAgainButton = new NSButton () {
|
TryAgainButton = new NSButton () {
|
||||||
Title = "Try again…"
|
Title = "Try again…"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CancelButton.Activated += delegate {
|
||||||
|
Controller.PageCancelled ();
|
||||||
|
};
|
||||||
|
|
||||||
TryAgainButton.Activated += delegate {
|
TryAgainButton.Activated += delegate {
|
||||||
Controller.ErrorPageCompleted ();
|
Controller.ErrorPageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
ContentView.AddSubview (web_view);
|
||||||
Controller.PageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (TryAgainButton);
|
Buttons.Add (TryAgainButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == PageType.CryptoSetup) {
|
||||||
case PageType.CryptoSetup: {
|
|
||||||
|
|
||||||
Header = "Set up file encryption";
|
Header = "Set up file encryption";
|
||||||
Description = "This project is supposed to be encrypted, but it doesn't yet have a password set. Please provide one below:";
|
Description = "This project is supposed to be encrypted, but it doesn't yet have a password set. Please provide one below:";
|
||||||
|
|
||||||
|
@ -638,7 +588,6 @@ namespace SparkleShare {
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ShowPasswordCheckButton = new NSButton () {
|
ShowPasswordCheckButton = new NSButton () {
|
||||||
Frame = new RectangleF (318, Frame.Height - 235, 300, 18),
|
Frame = new RectangleF (318, Frame.Height - 235, 300, 18),
|
||||||
Title = "Show password",
|
Title = "Show password",
|
||||||
|
@ -647,54 +596,6 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ShowPasswordCheckButton.SetButtonType (NSButtonType.Switch);
|
ShowPasswordCheckButton.SetButtonType (NSButtonType.Switch);
|
||||||
|
|
||||||
ShowPasswordCheckButton.Activated += delegate {
|
|
||||||
if (PasswordTextField.Superview == ContentView) {
|
|
||||||
PasswordTextField.RemoveFromSuperview ();
|
|
||||||
ContentView.AddSubview (VisiblePasswordTextField);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
VisiblePasswordTextField.RemoveFromSuperview ();
|
|
||||||
ContentView.AddSubview (PasswordTextField);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
(PasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
|
||||||
VisiblePasswordTextField.StringValue = PasswordTextField.StringValue;
|
|
||||||
Controller.CheckCryptoSetupPage (PasswordTextField.StringValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
(VisiblePasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
|
||||||
PasswordTextField.StringValue = VisiblePasswordTextField.StringValue;
|
|
||||||
Controller.CheckCryptoSetupPage (PasswordTextField.StringValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
|
||||||
Title = "Continue",
|
|
||||||
Enabled = false
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
|
||||||
Controller.CryptoSetupPageCompleted (PasswordTextField.StringValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
|
||||||
Controller.CryptoPageCancelled ();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Controller.UpdateCryptoSetupContinueButtonEvent += delegate (bool button_enabled) {
|
|
||||||
InvokeOnMainThread (delegate {
|
|
||||||
ContinueButton.Enabled = button_enabled;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
WarningImage = NSImage.ImageNamed ("NSInfo");
|
WarningImage = NSImage.ImageNamed ("NSInfo");
|
||||||
WarningImage.Size = new SizeF (24, 24);
|
WarningImage.Size = new SizeF (24, 24);
|
||||||
|
|
||||||
|
@ -712,6 +613,52 @@ namespace SparkleShare {
|
||||||
Font = SparkleUI.Font
|
Font = SparkleUI.Font
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CancelButton = new NSButton () {
|
||||||
|
Title = "Cancel"
|
||||||
|
};
|
||||||
|
|
||||||
|
ContinueButton = new NSButton () {
|
||||||
|
Title = "Continue",
|
||||||
|
Enabled = false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ShowPasswordCheckButton.Activated += delegate {
|
||||||
|
if (PasswordTextField.Superview == ContentView) {
|
||||||
|
PasswordTextField.RemoveFromSuperview ();
|
||||||
|
ContentView.AddSubview (VisiblePasswordTextField);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
VisiblePasswordTextField.RemoveFromSuperview ();
|
||||||
|
ContentView.AddSubview (PasswordTextField);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
(PasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
|
VisiblePasswordTextField.StringValue = PasswordTextField.StringValue;
|
||||||
|
Controller.CheckCryptoSetupPage (PasswordTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
(VisiblePasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
|
PasswordTextField.StringValue = VisiblePasswordTextField.StringValue;
|
||||||
|
Controller.CheckCryptoSetupPage (PasswordTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Controller.UpdateCryptoSetupContinueButtonEvent += delegate (bool button_enabled) {
|
||||||
|
InvokeOnMainThread (() => {
|
||||||
|
ContinueButton.Enabled = button_enabled;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ContinueButton.Activated += delegate {
|
||||||
|
Controller.CryptoSetupPageCompleted (PasswordTextField.StringValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
CancelButton.Activated += delegate {
|
||||||
|
Controller.CryptoPageCancelled ();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (PasswordLabel);
|
ContentView.AddSubview (PasswordLabel);
|
||||||
ContentView.AddSubview (PasswordTextField);
|
ContentView.AddSubview (PasswordTextField);
|
||||||
|
@ -722,19 +669,13 @@ namespace SparkleShare {
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
NSApplication.SharedApplication.RequestUserAttention
|
NSApplication.SharedApplication.RequestUserAttention (NSRequestUserAttentionType.CriticalRequest);
|
||||||
(NSRequestUserAttentionType.CriticalRequest);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == PageType.CryptoPassword) {
|
||||||
case PageType.CryptoPassword: {
|
|
||||||
|
|
||||||
Header = "This project contains encrypted files";
|
Header = "This project contains encrypted files";
|
||||||
Description = "Please enter the password to see their contents.";
|
Description = "Please enter the password to see their contents.";
|
||||||
|
|
||||||
|
|
||||||
PasswordLabel = new NSTextField () {
|
PasswordLabel = new NSTextField () {
|
||||||
Alignment = NSTextAlignment.Right,
|
Alignment = NSTextAlignment.Right,
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
@ -755,7 +696,6 @@ namespace SparkleShare {
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ShowPasswordCheckButton = new NSButton () {
|
ShowPasswordCheckButton = new NSButton () {
|
||||||
Frame = new RectangleF (318, Frame.Height - 255, 300, 18),
|
Frame = new RectangleF (318, Frame.Height - 255, 300, 18),
|
||||||
Title = "Show password",
|
Title = "Show password",
|
||||||
|
@ -764,6 +704,22 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ShowPasswordCheckButton.SetButtonType (NSButtonType.Switch);
|
ShowPasswordCheckButton.SetButtonType (NSButtonType.Switch);
|
||||||
|
|
||||||
|
CancelButton = new NSButton () {
|
||||||
|
Title = "Cancel"
|
||||||
|
};
|
||||||
|
|
||||||
|
ContinueButton = new NSButton () {
|
||||||
|
Title = "Continue",
|
||||||
|
Enabled = false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Controller.UpdateCryptoPasswordContinueButtonEvent += delegate (bool button_enabled) {
|
||||||
|
InvokeOnMainThread (() => {
|
||||||
|
ContinueButton.Enabled = button_enabled;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
ShowPasswordCheckButton.Activated += delegate {
|
ShowPasswordCheckButton.Activated += delegate {
|
||||||
if (PasswordTextField.Superview == ContentView) {
|
if (PasswordTextField.Superview == ContentView) {
|
||||||
PasswordTextField.RemoveFromSuperview ();
|
PasswordTextField.RemoveFromSuperview ();
|
||||||
|
@ -775,7 +731,6 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
(PasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
(PasswordTextField.Delegate as SparkleTextFieldDelegate).StringValueChanged += delegate {
|
||||||
VisiblePasswordTextField.StringValue = PasswordTextField.StringValue;
|
VisiblePasswordTextField.StringValue = PasswordTextField.StringValue;
|
||||||
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
||||||
|
@ -786,32 +741,15 @@ namespace SparkleShare {
|
||||||
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
Controller.CheckCryptoPasswordPage (PasswordTextField.StringValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
|
||||||
Title = "Continue",
|
|
||||||
Enabled = false
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
ContinueButton.Activated += delegate {
|
||||||
Controller.CryptoPasswordPageCompleted (PasswordTextField.StringValue);
|
Controller.CryptoPasswordPageCompleted (PasswordTextField.StringValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
CancelButton = new NSButton () {
|
|
||||||
Title = "Cancel"
|
|
||||||
};
|
|
||||||
|
|
||||||
CancelButton.Activated += delegate {
|
CancelButton.Activated += delegate {
|
||||||
Controller.CryptoPageCancelled ();
|
Controller.CryptoPageCancelled ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Controller.UpdateCryptoPasswordContinueButtonEvent += delegate (bool button_enabled) {
|
|
||||||
InvokeOnMainThread (delegate {
|
|
||||||
ContinueButton.Enabled = button_enabled;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (PasswordLabel);
|
ContentView.AddSubview (PasswordLabel);
|
||||||
ContentView.AddSubview (PasswordTextField);
|
ContentView.AddSubview (PasswordTextField);
|
||||||
ContentView.AddSubview (ShowPasswordCheckButton);
|
ContentView.AddSubview (ShowPasswordCheckButton);
|
||||||
|
@ -819,18 +757,15 @@ namespace SparkleShare {
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
Buttons.Add (CancelButton);
|
Buttons.Add (CancelButton);
|
||||||
|
|
||||||
NSApplication.SharedApplication.RequestUserAttention
|
NSApplication.SharedApplication.RequestUserAttention (NSRequestUserAttentionType.CriticalRequest);
|
||||||
(NSRequestUserAttentionType.CriticalRequest);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case PageType.Finished: {
|
if (type == PageType.Finished) {
|
||||||
|
|
||||||
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);
|
||||||
|
@ -853,57 +788,34 @@ namespace SparkleShare {
|
||||||
ContentView.AddSubview (WarningTextField);
|
ContentView.AddSubview (WarningTextField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OpenFolderButton = new NSButton () {
|
||||||
|
Title = string.Format ("Open {0}", Path.GetFileName (Controller.PreviousPath))
|
||||||
|
};
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
FinishButton = new NSButton () {
|
||||||
Title = "Finish"
|
Title = "Finish"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
OpenFolderButton.Activated += delegate {
|
||||||
|
Controller.OpenFolderClicked ();
|
||||||
|
};
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
FinishButton.Activated += delegate {
|
||||||
Controller.FinishPageCompleted ();
|
Controller.FinishPageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
OpenFolderButton = new NSButton () {
|
|
||||||
Title = string.Format ("Open {0}", Path.GetFileName (Controller.PreviousPath))
|
|
||||||
};
|
|
||||||
|
|
||||||
OpenFolderButton.Activated += delegate {
|
|
||||||
Controller.OpenFolderClicked ();
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons.Add (FinishButton);
|
Buttons.Add (FinishButton);
|
||||||
Buttons.Add (OpenFolderButton);
|
Buttons.Add (OpenFolderButton);
|
||||||
|
|
||||||
NSApplication.SharedApplication.RequestUserAttention
|
NSApplication.SharedApplication.RequestUserAttention (NSRequestUserAttentionType.CriticalRequest);
|
||||||
(NSRequestUserAttentionType.CriticalRequest);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PageType.Tutorial: {
|
if (type == PageType.Tutorial) {
|
||||||
|
|
||||||
switch (Controller.TutorialPageNumber) {
|
|
||||||
case 1: {
|
|
||||||
Header = "What's happening next?";
|
|
||||||
Description = "SparkleShare creates a special folder on your computer " +
|
|
||||||
"that will keep track of your projects.";
|
|
||||||
|
|
||||||
SkipTutorialButton = new NSButton () {
|
|
||||||
Title = "Skip Tutorial"
|
|
||||||
};
|
|
||||||
|
|
||||||
SkipTutorialButton.Activated += delegate {
|
|
||||||
Controller.TutorialSkipped ();
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton = new NSButton () {
|
|
||||||
Title = "Continue"
|
|
||||||
};
|
|
||||||
|
|
||||||
ContinueButton.Activated += delegate {
|
|
||||||
Controller.TutorialPageCompleted ();
|
|
||||||
};
|
|
||||||
|
|
||||||
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||||
"Pixmaps", "tutorial-slide-1.png");
|
"Pixmaps", "tutorial-slide-" + Controller.TutorialPageNumber + ".png");
|
||||||
|
|
||||||
SlideImage = new NSImage (slide_image_path) {
|
SlideImage = new NSImage (slide_image_path) {
|
||||||
Size = new SizeF (350, 200)
|
Size = new SizeF (350, 200)
|
||||||
|
@ -915,6 +827,36 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.AddSubview (SlideImageView);
|
ContentView.AddSubview (SlideImageView);
|
||||||
|
|
||||||
|
|
||||||
|
switch (Controller.TutorialPageNumber) {
|
||||||
|
|
||||||
|
case 1: {
|
||||||
|
Header = "What's happening next?";
|
||||||
|
Description = "SparkleShare creates a special folder on your computer " +
|
||||||
|
"that will keep track of your projects.";
|
||||||
|
|
||||||
|
|
||||||
|
SkipTutorialButton = new NSButton () {
|
||||||
|
Title = "Skip Tutorial"
|
||||||
|
};
|
||||||
|
|
||||||
|
ContinueButton = new NSButton () {
|
||||||
|
Title = "Continue"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SkipTutorialButton.Activated += delegate {
|
||||||
|
Controller.TutorialSkipped ();
|
||||||
|
};
|
||||||
|
|
||||||
|
ContinueButton.Activated += delegate {
|
||||||
|
Controller.TutorialPageCompleted ();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ContentView.AddSubview (SlideImageView);
|
||||||
|
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
Buttons.Add (SkipTutorialButton);
|
Buttons.Add (SkipTutorialButton);
|
||||||
|
|
||||||
|
@ -934,19 +876,6 @@ namespace SparkleShare {
|
||||||
Controller.TutorialPageCompleted ();
|
Controller.TutorialPageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
|
||||||
"Pixmaps", "tutorial-slide-2.png");
|
|
||||||
|
|
||||||
SlideImage = new NSImage (slide_image_path) {
|
|
||||||
Size = new SizeF (350, 200)
|
|
||||||
};
|
|
||||||
|
|
||||||
SlideImageView = new NSImageView () {
|
|
||||||
Image = SlideImage,
|
|
||||||
Frame = new RectangleF (215, Frame.Height - 350, 350, 200)
|
|
||||||
};
|
|
||||||
|
|
||||||
ContentView.AddSubview (SlideImageView);
|
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -965,19 +894,6 @@ namespace SparkleShare {
|
||||||
Controller.TutorialPageCompleted ();
|
Controller.TutorialPageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
|
||||||
"Pixmaps", "tutorial-slide-3.png");
|
|
||||||
|
|
||||||
SlideImage = new NSImage (slide_image_path) {
|
|
||||||
Size = new SizeF (350, 200)
|
|
||||||
};
|
|
||||||
|
|
||||||
SlideImageView = new NSImageView () {
|
|
||||||
Image = SlideImage,
|
|
||||||
Frame = new RectangleF (215, Frame.Height - 350, 350, 200)
|
|
||||||
};
|
|
||||||
|
|
||||||
ContentView.AddSubview (SlideImageView);
|
|
||||||
Buttons.Add (ContinueButton);
|
Buttons.Add (ContinueButton);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -997,49 +913,30 @@ namespace SparkleShare {
|
||||||
|
|
||||||
StartupCheckButton.SetButtonType (NSButtonType.Switch);
|
StartupCheckButton.SetButtonType (NSButtonType.Switch);
|
||||||
|
|
||||||
StartupCheckButton.Activated += delegate {
|
|
||||||
Controller.StartupItemChanged (StartupCheckButton.State == NSCellStateValue.On);
|
|
||||||
};
|
|
||||||
|
|
||||||
FinishButton = new NSButton () {
|
FinishButton = new NSButton () {
|
||||||
Title = "Finish"
|
Title = "Finish"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SlideImage.Size = new SizeF (350, 64);
|
||||||
|
|
||||||
|
|
||||||
|
StartupCheckButton.Activated += delegate {
|
||||||
|
Controller.StartupItemChanged (StartupCheckButton.State == NSCellStateValue.On);
|
||||||
|
};
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
FinishButton.Activated += delegate {
|
||||||
Controller.TutorialPageCompleted ();
|
Controller.TutorialPageCompleted ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
|
||||||
"Pixmaps", "tutorial-slide-4.png");
|
|
||||||
|
|
||||||
SlideImage = new NSImage (slide_image_path) {
|
|
||||||
Size = new SizeF (350, 64)
|
|
||||||
};
|
|
||||||
|
|
||||||
SlideImageView = new NSImageView () {
|
|
||||||
Image = SlideImage,
|
|
||||||
Frame = new RectangleF (215, Frame.Height - 215, 350, 64)
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ContentView.AddSubview (SlideImageView);
|
|
||||||
ContentView.AddSubview (StartupCheckButton);
|
ContentView.AddSubview (StartupCheckButton);
|
||||||
Buttons.Add (FinishButton);
|
Buttons.Add (FinishButton);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowAll ();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1061,11 +958,9 @@ namespace SparkleShare {
|
||||||
foreach (SparklePlugin plugin in plugins) {
|
foreach (SparklePlugin plugin in plugins) {
|
||||||
Items.Add (plugin);
|
Items.Add (plugin);
|
||||||
|
|
||||||
|
|
||||||
NSTextFieldCell cell = new NSTextFieldCell ();
|
NSTextFieldCell cell = new NSTextFieldCell ();
|
||||||
|
|
||||||
NSData name_data = NSData.FromString (
|
NSData name_data = NSData.FromString ("<font face='Lucida Grande'><b>" + plugin.Name + "</b></font>");
|
||||||
"<font face='Lucida Grande'><b>" + plugin.Name + "</b></font>");
|
|
||||||
|
|
||||||
NSDictionary name_dictionary = new NSDictionary();
|
NSDictionary name_dictionary = new NSDictionary();
|
||||||
NSAttributedString name_attributes = new NSAttributedString (
|
NSAttributedString name_attributes = new NSAttributedString (
|
||||||
|
@ -1085,7 +980,6 @@ namespace SparkleShare {
|
||||||
cell.AttributedStringValue = mutable_attributes;
|
cell.AttributedStringValue = mutable_attributes;
|
||||||
Cells [i] = (NSAttributedString) cell.ObjectValue;
|
Cells [i] = (NSAttributedString) cell.ObjectValue;
|
||||||
|
|
||||||
|
|
||||||
NSTextFieldCell selected_cell = new NSTextFieldCell ();
|
NSTextFieldCell selected_cell = new NSTextFieldCell ();
|
||||||
|
|
||||||
NSData selected_name_data = NSData.FromString (
|
NSData selected_name_data = NSData.FromString (
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="MonoMac" />
|
<Reference Include="MonoMac" />
|
||||||
<Reference Include="System.Net" />
|
<Reference Include="System.Net" />
|
||||||
|
<Reference Include="Mono.Posix" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AppDelegate.cs">
|
<Compile Include="AppDelegate.cs">
|
||||||
|
|
Loading…
Reference in a new issue