[intro] Finish server form
This commit is contained in:
parent
dd37318e30
commit
bd6ce58249
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using MonoMac.Foundation;
|
using MonoMac.Foundation;
|
||||||
using MonoMac.AppKit;
|
using MonoMac.AppKit;
|
||||||
|
@ -28,7 +29,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleIntro : SparkleWindow {
|
public class SparkleIntro : SparkleWindow {
|
||||||
|
|
||||||
private NSButton NextButton;
|
private NSButton ContinueButton;
|
||||||
private NSButton SyncButton;
|
private NSButton SyncButton;
|
||||||
private NSButton TryAgainButton;
|
private NSButton TryAgainButton;
|
||||||
private NSButton CancelButton;
|
private NSButton CancelButton;
|
||||||
|
@ -37,6 +38,15 @@ namespace SparkleShare {
|
||||||
private NSButton FinishButton;
|
private NSButton FinishButton;
|
||||||
private NSForm UserInfoForm;
|
private NSForm UserInfoForm;
|
||||||
private NSProgressIndicator ProgressIndicator;
|
private NSProgressIndicator ProgressIndicator;
|
||||||
|
private NSTextField AddressTextField;
|
||||||
|
private NSTextField FolderNameTextField;
|
||||||
|
private NSTextField ServerTypeLabel;
|
||||||
|
private NSTextField AddressLabel;
|
||||||
|
private NSTextField FolderNameLabel;
|
||||||
|
private NSTextField FolderNameHelpLabel;
|
||||||
|
private NSButtonCell ButtonCellProto;
|
||||||
|
private NSMatrix Matrix;
|
||||||
|
private int ServerType;
|
||||||
|
|
||||||
private bool ServerFormOnly;
|
private bool ServerFormOnly;
|
||||||
|
|
||||||
|
@ -55,26 +65,27 @@ namespace SparkleShare {
|
||||||
Reset ();
|
Reset ();
|
||||||
|
|
||||||
Header = "Welcome to SparkleShare!";
|
Header = "Welcome to SparkleShare!";
|
||||||
Description = "Before we can create a SparkleShare folder on this\n" +
|
Description = "Before we can create a SparkleShare folder on this " +
|
||||||
"computer, we need a few bits of information from you.";
|
"computer, we need some information from you.";
|
||||||
|
|
||||||
|
|
||||||
UserInfoForm = new NSForm (new RectangleF (250, 190, 350, 64));
|
UserInfoForm = new NSForm (new RectangleF (250, 115, 350, 64));
|
||||||
UserInfoForm.AddEntry ("Full Name:");
|
UserInfoForm.AddEntry ("Full Name:");
|
||||||
UserInfoForm.AddEntry ("Email Address:");
|
UserInfoForm.AddEntry ("Email Address:");
|
||||||
UserInfoForm.CellSize = new SizeF (280, 22);
|
UserInfoForm.CellSize = new SizeF (280, 22);
|
||||||
|
UserInfoForm.IntercellSpacing = new SizeF (4, 4);
|
||||||
|
|
||||||
string full_name = new UnixUserInfo (UnixEnvironment.UserName).RealName;
|
string full_name = new UnixUserInfo (UnixEnvironment.UserName).RealName;
|
||||||
UserInfoForm.Cells [0].StringValue = full_name;
|
UserInfoForm.Cells [0].StringValue = full_name;
|
||||||
UserInfoForm.Cells [1].StringValue = SparkleShare.Controller.UserEmail;
|
UserInfoForm.Cells [1].StringValue = SparkleShare.Controller.UserEmail;
|
||||||
|
|
||||||
|
|
||||||
NextButton = new NSButton () {
|
ContinueButton = new NSButton () {
|
||||||
Title = "Next",
|
Title = "Continue",
|
||||||
Enabled = false
|
Enabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
NextButton.Activated += delegate {
|
ContinueButton.Activated += delegate {
|
||||||
|
|
||||||
SparkleShare.Controller.UserName = UserInfoForm.Cells [0].StringValue.Trim ();
|
SparkleShare.Controller.UserName = UserInfoForm.Cells [0].StringValue.Trim ();
|
||||||
SparkleShare.Controller.UserEmail = UserInfoForm.Cells [1].StringValue.Trim ();
|
SparkleShare.Controller.UserEmail = UserInfoForm.Cells [1].StringValue.Trim ();
|
||||||
|
@ -90,7 +101,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// TODO: Ugly hack, do properly with events
|
// TODO: Ugly hack, do properly with events
|
||||||
Timer timer = new Timer () {
|
Timer timer = new Timer () {
|
||||||
Interval = 500
|
Interval = 50
|
||||||
};
|
};
|
||||||
|
|
||||||
timer.Elapsed += delegate {
|
timer.Elapsed += delegate {
|
||||||
|
@ -103,7 +114,7 @@ namespace SparkleShare {
|
||||||
bool email_is_correct = SparkleShare.Controller.IsValidEmail
|
bool email_is_correct = SparkleShare.Controller.IsValidEmail
|
||||||
(UserInfoForm.Cells [1].StringValue.Trim ());
|
(UserInfoForm.Cells [1].StringValue.Trim ());
|
||||||
|
|
||||||
NextButton.Enabled = (name_is_correct && email_is_correct);
|
ContinueButton.Enabled = (name_is_correct && email_is_correct);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -112,7 +123,7 @@ namespace SparkleShare {
|
||||||
timer.Start ();
|
timer.Start ();
|
||||||
|
|
||||||
ContentView.AddSubview (UserInfoForm);
|
ContentView.AddSubview (UserInfoForm);
|
||||||
Buttons.Add (NextButton);
|
Buttons.Add (ContinueButton);
|
||||||
|
|
||||||
ShowAll ();
|
ShowAll ();
|
||||||
|
|
||||||
|
@ -137,11 +148,242 @@ namespace SparkleShare {
|
||||||
Description = "";
|
Description = "";
|
||||||
|
|
||||||
|
|
||||||
SyncButton = new NSButton () {
|
ServerTypeLabel = new NSTextField () {
|
||||||
Title = "Sync"
|
Alignment = (uint) NSTextAlignment.Right,
|
||||||
//Enabled = false TODO
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
Bordered = false,
|
||||||
|
Editable = false,
|
||||||
|
Frame = new RectangleF (150, Frame.Height - 139 , 160, 17),
|
||||||
|
StringValue = "Server Type:",
|
||||||
|
Font = SparkleUI.Font
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AddressLabel = new NSTextField () {
|
||||||
|
Alignment = (uint) NSTextAlignment.Right,
|
||||||
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
Bordered = false,
|
||||||
|
Editable = false,
|
||||||
|
Frame = new RectangleF (150, Frame.Height - 237 , 160, 17),
|
||||||
|
StringValue = "Address:",
|
||||||
|
Font = SparkleUI.Font
|
||||||
|
};
|
||||||
|
|
||||||
|
FolderNameLabel = new NSTextField () {
|
||||||
|
Alignment = (uint) NSTextAlignment.Right,
|
||||||
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
Bordered = false,
|
||||||
|
Editable = false,
|
||||||
|
Frame = new RectangleF (150, Frame.Height - 264 , 160, 17),
|
||||||
|
StringValue = "Folder Name:",
|
||||||
|
Font = SparkleUI.Font
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
AddressTextField = new NSTextField () {
|
||||||
|
Frame = new RectangleF (320, Frame.Height - 240 , 256, 22),
|
||||||
|
Font = SparkleUI.Font
|
||||||
|
};
|
||||||
|
|
||||||
|
FolderNameTextField = new NSTextField () {
|
||||||
|
Frame = new RectangleF (320, Frame.Height - (240 + 22 + 4) , 256, 22),
|
||||||
|
StringValue = ""
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
FolderNameHelpLabel = new NSTextField () {
|
||||||
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
|
Bordered = false,
|
||||||
|
TextColor = NSColor.DisabledControlText,
|
||||||
|
Editable = false,
|
||||||
|
Frame = new RectangleF (320, Frame.Height - 285 , 200, 17),
|
||||||
|
StringValue = "e.g. ‘rupert/website-design’"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ServerType = 0;
|
||||||
|
|
||||||
|
ButtonCellProto = new NSButtonCell ();
|
||||||
|
ButtonCellProto.SetButtonType (NSButtonType.Radio) ;
|
||||||
|
|
||||||
|
Matrix = new NSMatrix (new RectangleF (315, 180, 256, 78),
|
||||||
|
NSMatrixMode.Radio, ButtonCellProto, 4, 1);
|
||||||
|
|
||||||
|
Matrix.CellSize = new SizeF (256, 18);
|
||||||
|
|
||||||
|
Matrix.Cells [0].Title = "My own server";
|
||||||
|
Matrix.Cells [1].Title = "Github";
|
||||||
|
Matrix.Cells [2].Title = "Gitorious";
|
||||||
|
Matrix.Cells [3].Title = "The GNOME Project";
|
||||||
|
|
||||||
|
foreach (NSCell cell in Matrix.Cells)
|
||||||
|
cell.Font = SparkleUI.Font;
|
||||||
|
|
||||||
|
// TODO: Ugly hack, do properly with events
|
||||||
|
Timer timer = new Timer () {
|
||||||
|
Interval = 50
|
||||||
|
};
|
||||||
|
|
||||||
|
timer.Elapsed += delegate {
|
||||||
|
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
|
||||||
|
if (Matrix.SelectedRow != ServerType) {
|
||||||
|
ServerType = Matrix.SelectedRow;
|
||||||
|
|
||||||
|
AddressTextField.Enabled = (ServerType == 0);
|
||||||
|
|
||||||
|
switch (ServerType) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
AddressTextField.StringValue = "";
|
||||||
|
FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
AddressTextField.StringValue = "ssh://git@github.com/";
|
||||||
|
FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
AddressTextField.StringValue = "ssh://git@gitorious.org/";
|
||||||
|
FolderNameHelpLabel.StringValue = "e.g. ‘project/website-design’";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
AddressTextField.StringValue = "ssh://git@gnome.org/git/";
|
||||||
|
FolderNameHelpLabel.StringValue = "e.g. ‘gnome-icon-theme’";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (ServerType == 0 && !AddressTextField.StringValue.Trim ().Equals ("")
|
||||||
|
&& !FolderNameTextField.StringValue.Trim ().Equals ("")) {
|
||||||
|
|
||||||
|
SyncButton.Enabled = true;
|
||||||
|
|
||||||
|
} else if (ServerType != 0 &&
|
||||||
|
!FolderNameTextField.StringValue.Trim ().Equals ("")) {
|
||||||
|
|
||||||
|
SyncButton.Enabled = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
SyncButton.Enabled = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
timer.Start ();
|
||||||
|
|
||||||
|
|
||||||
|
ContentView.AddSubview (ServerTypeLabel);
|
||||||
|
ContentView.AddSubview (Matrix);
|
||||||
|
|
||||||
|
ContentView.AddSubview (AddressLabel);
|
||||||
|
ContentView.AddSubview (AddressTextField);
|
||||||
|
|
||||||
|
ContentView.AddSubview (FolderNameLabel);
|
||||||
|
ContentView.AddSubview (FolderNameTextField);
|
||||||
|
ContentView.AddSubview (FolderNameHelpLabel);
|
||||||
|
|
||||||
|
|
||||||
|
SyncButton = new NSButton () {
|
||||||
|
Title = "Sync",
|
||||||
|
Enabled = false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SyncButton.Activated += delegate {
|
||||||
|
|
||||||
|
string name = FolderNameTextField.StringValue;
|
||||||
|
|
||||||
|
// Remove the starting slash if there is one
|
||||||
|
if (name.StartsWith ("/"))
|
||||||
|
name = name.Substring (1);
|
||||||
|
|
||||||
|
string server = AddressTextField.StringValue;
|
||||||
|
|
||||||
|
if (name.EndsWith ("/"))
|
||||||
|
name = name.TrimEnd ("/".ToCharArray ());
|
||||||
|
|
||||||
|
if (name.StartsWith ("/"))
|
||||||
|
name = name.TrimStart ("/".ToCharArray ());
|
||||||
|
|
||||||
|
if (server.StartsWith ("ssh://"))
|
||||||
|
server = server.Substring (6);
|
||||||
|
|
||||||
|
if (ServerType == 0) {
|
||||||
|
|
||||||
|
// Use the default user 'git' if no username is specified
|
||||||
|
if (!server.Contains ("@"))
|
||||||
|
server = "git@" + server;
|
||||||
|
|
||||||
|
// Prepend the Secure Shell protocol when it isn't specified
|
||||||
|
if (!server.StartsWith ("ssh://"))
|
||||||
|
server = "ssh://" + server;
|
||||||
|
|
||||||
|
// Remove the trailing slash if there is one
|
||||||
|
if (server.EndsWith ("/"))
|
||||||
|
server = server.TrimEnd ("/".ToCharArray ());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ServerType == 2) {
|
||||||
|
|
||||||
|
server = "ssh://git@gitorious.org";
|
||||||
|
|
||||||
|
if (!name.EndsWith (".git")) {
|
||||||
|
|
||||||
|
if (!name.Contains ("/"))
|
||||||
|
name = name + "/" + name;
|
||||||
|
|
||||||
|
name += ".git";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ServerType == 1)
|
||||||
|
server = "ssh://git@github.com";
|
||||||
|
|
||||||
|
if (ServerType == 3)
|
||||||
|
server = "ssh://git@gnome.org/git/";
|
||||||
|
|
||||||
|
string url = server + "/" + name;
|
||||||
|
string canonical_name = Path.GetFileNameWithoutExtension (name);
|
||||||
|
|
||||||
|
|
||||||
|
ShowSyncingPage (canonical_name);
|
||||||
|
|
||||||
|
|
||||||
|
SparkleShare.Controller.FolderFetched += delegate {
|
||||||
|
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
ShowSuccessPage (canonical_name);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
SparkleShare.Controller.FolderFetchError += delegate {
|
||||||
|
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
ShowErrorPage ();
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SparkleShare.Controller.FetchFolder (url, name);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
Buttons.Add (SyncButton);
|
Buttons.Add (SyncButton);
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +453,8 @@ namespace SparkleShare {
|
||||||
"You sure it’s not coffee o-clock?";
|
"You sure it’s not coffee o-clock?";
|
||||||
|
|
||||||
|
|
||||||
ProgressIndicator = new NSProgressIndicator (new RectangleF (200, 230, 390, 20)) {
|
ProgressIndicator = new NSProgressIndicator () {
|
||||||
|
Frame = new RectangleF (190, Frame.Height - 200, 640 - 150 - 80, 20),
|
||||||
Style = NSProgressIndicatorStyle.Bar
|
Style = NSProgressIndicatorStyle.Bar
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -232,7 +475,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ShowSuccessPage (string folder_name)
|
public void ShowSuccessPage (string folder_name)
|
||||||
{
|
{
|
||||||
|
|
||||||
Reset ();
|
Reset ();
|
||||||
|
@ -247,6 +490,7 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
FinishButton.Activated += delegate {
|
||||||
|
SparkleUI.StatusIcon.CreateMenu ();
|
||||||
Close ();
|
Close ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -287,7 +531,7 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
FinishButton.Activated += delegate {
|
FinishButton.Activated += delegate {
|
||||||
Console.WriteLine ("ffffffff");
|
SparkleUI.StatusIcon.CreateMenu ();
|
||||||
Close ();
|
Close ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,24 +543,5 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// proto.SetButtonType (NSButtonType.Radio) ;
|
|
||||||
|
|
||||||
// NSButton button = new NSButton (new RectangleF (150, 0, 350, 300)) {
|
|
||||||
// Cell = proto,
|
|
||||||
// Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
|
|
||||||
// NSFontTraitMask.Bold,
|
|
||||||
// 0, 14)
|
|
||||||
// };
|
|
||||||
|
|
||||||
// NSMatrix matrix = new NSMatrix (new RectangleF (300, 00, 300, 300), NSMatrixMode.Radio, proto, 4, 1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// matrix.Cells [0].Title = "My own server:";
|
|
||||||
// matrix.Cells [1].Title = "Github\nFree hosting";
|
|
||||||
// matrix.Cells [2].Title = "Gitorious";
|
|
||||||
// matrix.Cells [3].Title = "The GNOME Project";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ContentView.AddSubview (WebView);
|
ContentView.AddSubview (WebView);
|
||||||
|
|
||||||
OpenFolderButton = new NSButton (new RectangleF (16, 12, 120, 31)) {
|
OpenFolderButton = new NSButton (new RectangleF (16, 12, 120, 32)) {
|
||||||
Title = "Open Folder",
|
Title = "Open Folder",
|
||||||
BezelStyle = NSBezelStyle.Rounded
|
BezelStyle = NSBezelStyle.Rounded ,
|
||||||
|
Font = SparkleUI.Font
|
||||||
};
|
};
|
||||||
|
|
||||||
OpenFolderButton.Activated += delegate {
|
OpenFolderButton.Activated += delegate {
|
||||||
|
@ -83,9 +84,10 @@ namespace SparkleShare {
|
||||||
ContentView.AddSubview (OpenFolderButton);
|
ContentView.AddSubview (OpenFolderButton);
|
||||||
|
|
||||||
|
|
||||||
CloseButton = new NSButton (new RectangleF (480 - 120 - 16, 12, 120, 31)) {
|
CloseButton = new NSButton (new RectangleF (480 - 120 - 16, 12, 120, 32)) {
|
||||||
Title = "Close",
|
Title = "Close",
|
||||||
BezelStyle = NSBezelStyle.Rounded
|
BezelStyle = NSBezelStyle.Rounded,
|
||||||
|
Font = SparkleUI.Font
|
||||||
};
|
};
|
||||||
|
|
||||||
CloseButton.Activated += delegate {
|
CloseButton.Activated += delegate {
|
||||||
|
@ -98,7 +100,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
|
|
||||||
string name = Path.GetFileName (LocalPath);
|
string name = Path.GetFileName (LocalPath);
|
||||||
Title = String.Format ("Recent Events in ‘{0}’", name);
|
Title = String.Format ("Events in ‘{0}’", name);
|
||||||
|
|
||||||
Separator = new NSBox (new RectangleF (0, 58, 480, 1)) {
|
Separator = new NSBox (new RectangleF (0, 58, 480, 1)) {
|
||||||
BorderColor = NSColor.LightGray,
|
BorderColor = NSColor.LightGray,
|
||||||
|
@ -119,7 +121,7 @@ namespace SparkleShare {
|
||||||
string html = SparkleShare.Controller.GetHTMLLog (folder_name);
|
string html = SparkleShare.Controller.GetHTMLLog (folder_name);
|
||||||
|
|
||||||
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
|
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
|
||||||
html = html.Replace ("<!-- $body-font-size -->", "10pt");
|
html = html.Replace ("<!-- $body-font-size -->", "10.1pt");
|
||||||
html = html.Replace ("<!-- $secondary-font-color -->", "#bbb");
|
html = html.Replace ("<!-- $secondary-font-color -->", "#bbb");
|
||||||
html = html.Replace ("<!-- $day-entry-header-background-color -->", "#f5f5f5");
|
html = html.Replace ("<!-- $day-entry-header-background-color -->", "#f5f5f5");
|
||||||
html = html.Replace ("<!-- $a-color -->", "#0085cf");
|
html = html.Replace ("<!-- $a-color -->", "#0085cf");
|
||||||
|
|
|
@ -234,8 +234,7 @@ namespace SparkleShare {
|
||||||
Title = "Add Remote Folder…"
|
Title = "Add Remote Folder…"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (SparkleShare.Controller.FirstRun)
|
if (!SparkleShare.Controller.FirstRun) {
|
||||||
SyncMenuItem.Enabled = false;
|
|
||||||
|
|
||||||
SyncMenuItem.Activated += delegate {
|
SyncMenuItem.Activated += delegate {
|
||||||
|
|
||||||
|
@ -260,6 +259,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Menu.AddItem (SyncMenuItem);
|
Menu.AddItem (SyncMenuItem);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace SparkleShare {
|
||||||
public static List <SparkleLog> OpenLogs;
|
public static List <SparkleLog> OpenLogs;
|
||||||
public static int NewEvents;
|
public static int NewEvents;
|
||||||
public static SparkleIntro Intro;
|
public static SparkleIntro Intro;
|
||||||
|
public static NSFont Font;
|
||||||
|
|
||||||
|
|
||||||
public SparkleUI ()
|
public SparkleUI ()
|
||||||
|
@ -61,6 +62,10 @@ namespace SparkleShare {
|
||||||
= NSImage.ImageNamed ("sparkleshare.icns");
|
= NSImage.ImageNamed ("sparkleshare.icns");
|
||||||
|
|
||||||
|
|
||||||
|
Font = NSFontManager.SharedFontManager.FontWithFamily
|
||||||
|
("Lucida Grande", NSFontTraitMask.Condensed, 0, 13);
|
||||||
|
|
||||||
|
|
||||||
OpenLogs = new List <SparkleLog> ();
|
OpenLogs = new List <SparkleLog> ();
|
||||||
StatusIcon = new SparkleStatusIcon ();
|
StatusIcon = new SparkleStatusIcon ();
|
||||||
|
|
||||||
|
@ -107,6 +112,12 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (SparkleShare.Controller.FirstRun) {
|
||||||
|
|
||||||
|
Intro = new SparkleIntro ();
|
||||||
|
Intro.ShowAccountForm ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,16 +45,15 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// Title = "SparkleShare Configuration";
|
// Title = "SparkleShare Configuration";
|
||||||
|
|
||||||
SetFrame (new RectangleF (0, 0, 640, 480), true);
|
SetFrame (new RectangleF (0, 0, 640, 380), true);
|
||||||
|
|
||||||
Center ();
|
|
||||||
|
|
||||||
StyleMask = NSWindowStyle.Titled;
|
StyleMask = NSWindowStyle.Titled;
|
||||||
MaxSize = new SizeF (640, 480);
|
MaxSize = new SizeF (640, 380);
|
||||||
MinSize = new SizeF (640, 480);
|
MinSize = new SizeF (640, 380);
|
||||||
HasShadow = true;
|
HasShadow = true;
|
||||||
BackingType = NSBackingStore.Buffered;
|
BackingType = NSBackingStore.Buffered;
|
||||||
|
|
||||||
|
Center ();
|
||||||
|
|
||||||
string side_splash_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
string side_splash_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||||
"Pixmaps", "side-splash.png");
|
"Pixmaps", "side-splash.png");
|
||||||
|
@ -72,18 +71,19 @@ namespace SparkleShare {
|
||||||
Buttons = new List <NSButton> ();
|
Buttons = new List <NSButton> ();
|
||||||
|
|
||||||
|
|
||||||
HeaderTextField = new NSTextField (new RectangleF (200, Frame.Height - 100, 350, 48)) {
|
HeaderTextField = new NSTextField (new RectangleF (190, Frame.Height - 100, 318, 48)) {
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
Bordered = false,
|
Bordered = false,
|
||||||
Editable = false,
|
Editable = false,
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily
|
Font = NSFontManager.SharedFontManager.FontWithFamily
|
||||||
("Lucida Grande", NSFontTraitMask.Bold, 0, 18)
|
("Lucida Grande", NSFontTraitMask.Bold, 0, 15)
|
||||||
};
|
};
|
||||||
|
|
||||||
DescriptionTextField = new NSTextField (new RectangleF (200, Frame.Height - 155 , 350, 64)) {
|
DescriptionTextField = new NSTextField (new RectangleF (190, Frame.Height - 155 , 640 - 240, 64)) {
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
Bordered = false,
|
Bordered = false,
|
||||||
Editable = false
|
Editable = false,
|
||||||
|
Font = SparkleUI.Font
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,11 +110,13 @@ namespace SparkleShare {
|
||||||
DescriptionTextField.StringValue = Description;
|
DescriptionTextField.StringValue = Description;
|
||||||
|
|
||||||
ContentView.AddSubview (HeaderTextField);
|
ContentView.AddSubview (HeaderTextField);
|
||||||
|
|
||||||
|
if (!Description.Equals (""))
|
||||||
ContentView.AddSubview (DescriptionTextField);
|
ContentView.AddSubview (DescriptionTextField);
|
||||||
|
|
||||||
ContentView.AddSubview (SideSplashView);
|
ContentView.AddSubview (SideSplashView);
|
||||||
|
|
||||||
int i = 0;
|
int i = 1;
|
||||||
|
|
||||||
if (Buttons.Count > 0) {
|
if (Buttons.Count > 0) {
|
||||||
|
|
||||||
|
@ -123,7 +125,13 @@ namespace SparkleShare {
|
||||||
foreach (NSButton button in Buttons) {
|
foreach (NSButton button in Buttons) {
|
||||||
|
|
||||||
button.BezelStyle = NSBezelStyle.Rounded;
|
button.BezelStyle = NSBezelStyle.Rounded;
|
||||||
button.Frame = new RectangleF (Frame.Width - 15 - (105 * (i + 1)) , 12, 105, 31);
|
button.Frame = new RectangleF (Frame.Width - 15 - (105 * i) , 12, 105, 32);
|
||||||
|
|
||||||
|
if (button.Title.Contains (" "))
|
||||||
|
button.Frame = new RectangleF (Frame.Width - 30 - (105 * i) , 12, 120, 32);
|
||||||
|
|
||||||
|
button.Font = SparkleUI.Font;
|
||||||
|
|
||||||
ContentView.AddSubview (button);
|
ContentView.AddSubview (button);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in a new issue