windows: begin SetupWindow work
This commit is contained in:
parent
a76237046b
commit
a8bbb8da32
|
@ -45,6 +45,8 @@ namespace SparkleShare {
|
||||||
Height = 288;
|
Height = 288;
|
||||||
Width = 640;
|
Width = 640;
|
||||||
|
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|
||||||
Closing += Close;
|
Closing += Close;
|
||||||
|
|
||||||
CreateAbout ();
|
CreateAbout ();
|
||||||
|
@ -153,8 +155,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private void Close (object sender, CancelEventArgs args)
|
private void Close (object sender, CancelEventArgs args)
|
||||||
{
|
{
|
||||||
Controller.WindowClosed ();
|
Controller.WindowClosed ();
|
||||||
args.Cancel = true;
|
args.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public SparkleBubbles ()
|
public SparkleBubbles ()
|
||||||
{
|
{
|
||||||
Controller.ShowBubbleEvent += delegate (string title, string subtext,
|
Controller.ShowBubbleEvent += delegate (string title,
|
||||||
string image_path) {
|
string subtext, string image_path) {
|
||||||
|
|
||||||
SparkleUI.StatusIcon.ShowBalloon (title, subtext, image_path);
|
SparkleUI.StatusIcon.ShowBalloon (title, subtext, image_path);
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,6 +22,7 @@ using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
@ -50,18 +51,20 @@ namespace SparkleShare {
|
||||||
Height = 640;
|
Height = 640;
|
||||||
Width = 480;
|
Width = 480;
|
||||||
ResizeMode = ResizeMode.NoResize;
|
ResizeMode = ResizeMode.NoResize;
|
||||||
Background = new SolidColorBrush (Colors.WhiteSmoke);
|
Background = new SolidColorBrush (Color.FromRgb (240, 240, 240));
|
||||||
|
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|
||||||
Closing += Close;
|
Closing += Close;
|
||||||
|
|
||||||
|
|
||||||
Label size_label = new Label () {
|
Label size_label = new Label () {
|
||||||
Content = "Size:",
|
Content = "Size:"
|
||||||
FontWeight = FontWeights.Bold
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.size_label_value = new Label () {
|
this.size_label_value = new Label () {
|
||||||
Content = Controller.Size
|
Content = Controller.Size,
|
||||||
|
FontWeight = FontWeights.Bold
|
||||||
};
|
};
|
||||||
|
|
||||||
size_label.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity));
|
size_label.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity));
|
||||||
|
@ -70,24 +73,31 @@ namespace SparkleShare {
|
||||||
|
|
||||||
|
|
||||||
Label history_label = new Label () {
|
Label history_label = new Label () {
|
||||||
Content = "History:",
|
Content = "History:"
|
||||||
FontWeight = FontWeights.Bold
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.history_label_value = new Label () {
|
this.history_label_value = new Label () {
|
||||||
Content = Controller.HistorySize
|
Content = Controller.HistorySize,
|
||||||
|
FontWeight = FontWeights.Bold
|
||||||
};
|
};
|
||||||
|
|
||||||
history_label.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity));
|
history_label.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity));
|
||||||
Rect history_label_rect = new Rect (history_label.DesiredSize);
|
Rect history_label_rect = new Rect (history_label.DesiredSize);
|
||||||
|
|
||||||
|
|
||||||
this.web_browser = new WebBrowser () {
|
Rectangle line = new Rectangle () {
|
||||||
Width = Width - 7,
|
Width = Width,
|
||||||
Height = Height - 48 - 12
|
Height = 1,
|
||||||
|
Fill = new SolidColorBrush (Color.FromRgb (223, 223, 223))
|
||||||
};
|
};
|
||||||
|
|
||||||
this.web_browser.Navigating += delegate(object sender, NavigatingCancelEventArgs e) {
|
|
||||||
|
this.web_browser = new WebBrowser () {
|
||||||
|
Width = Width - 7,
|
||||||
|
Height = Height - 36 - 12
|
||||||
|
};
|
||||||
|
|
||||||
|
this.web_browser.Navigating += delegate (object sender, NavigatingCancelEventArgs e) {
|
||||||
string url = e.Uri.ToString ();
|
string url = e.Uri.ToString ();
|
||||||
Controller.LinkClicked (url);
|
Controller.LinkClicked (url);
|
||||||
};
|
};
|
||||||
|
@ -98,20 +108,25 @@ namespace SparkleShare {
|
||||||
|
|
||||||
this.canvas.Children.Add (size_label);
|
this.canvas.Children.Add (size_label);
|
||||||
Canvas.SetLeft (size_label, 12);
|
Canvas.SetLeft (size_label, 12);
|
||||||
Canvas.SetTop (size_label, 10);
|
Canvas.SetTop (size_label, 4);
|
||||||
|
|
||||||
this.canvas.Children.Add (this.size_label_value);
|
this.canvas.Children.Add (this.size_label_value);
|
||||||
Canvas.SetLeft (this.size_label_value, 12 + size_label_rect.Width);
|
Canvas.SetLeft (this.size_label_value, 12 + size_label_rect.Width);
|
||||||
Canvas.SetTop (this.size_label_value, 10);
|
Canvas.SetTop (this.size_label_value, 4);
|
||||||
|
|
||||||
|
|
||||||
this.canvas.Children.Add (history_label);
|
this.canvas.Children.Add (history_label);
|
||||||
Canvas.SetLeft (history_label, 120);
|
Canvas.SetLeft (history_label, 120);
|
||||||
Canvas.SetTop (history_label, 10);
|
Canvas.SetTop (history_label, 4);
|
||||||
|
|
||||||
this.canvas.Children.Add (this.history_label_value);
|
this.canvas.Children.Add (this.history_label_value);
|
||||||
Canvas.SetLeft (this.history_label_value, 120 + history_label_rect.Width);
|
Canvas.SetLeft (this.history_label_value, 120 + history_label_rect.Width);
|
||||||
Canvas.SetTop (this.history_label_value, 10);
|
Canvas.SetTop (this.history_label_value, 4);
|
||||||
|
|
||||||
|
|
||||||
|
this.canvas.Children.Add (line);
|
||||||
|
Canvas.SetLeft (line, 0);
|
||||||
|
Canvas.SetTop (line, 35);
|
||||||
|
|
||||||
|
|
||||||
Controller.ShowWindowEvent += delegate {
|
Controller.ShowWindowEvent += delegate {
|
||||||
|
@ -202,7 +217,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
this.canvas.Children.Add (combo_box);
|
this.canvas.Children.Add (combo_box);
|
||||||
Canvas.SetLeft (this.combo_box, Width - 18 - this.combo_box.Width);
|
Canvas.SetLeft (this.combo_box, Width - 18 - this.combo_box.Width);
|
||||||
Canvas.SetTop (this.combo_box, 12);
|
Canvas.SetTop (this.combo_box, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -249,7 +264,7 @@ namespace SparkleShare {
|
||||||
if (!this.canvas.Children.Contains (this.web_browser)) {
|
if (!this.canvas.Children.Contains (this.web_browser)) {
|
||||||
this.canvas.Children.Add (this.web_browser);
|
this.canvas.Children.Add (this.web_browser);
|
||||||
Canvas.SetLeft (this.web_browser, 0);
|
Canvas.SetLeft (this.web_browser, 0);
|
||||||
Canvas.SetTop (this.web_browser, 48);
|
Canvas.SetTop (this.web_browser, 36);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
@ -260,8 +275,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private void Close (object sender, CancelEventArgs args)
|
private void Close (object sender, CancelEventArgs args)
|
||||||
{
|
{
|
||||||
Controller.WindowClosed ();
|
Controller.WindowClosed ();
|
||||||
args.Cancel = true;
|
args.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
206
SparkleShare/Windows/SparkleSetupWindow.cs
Normal file
206
SparkleShare/Windows/SparkleSetupWindow.cs
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
// SparkleShare, a collaboration and sharing tool.
|
||||||
|
// Copyright (C) 2010 Hylke Bons (hylkebons@gmail.com)
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see (http://www.gnu.org/licenses/).
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace SparkleShare {
|
||||||
|
|
||||||
|
public class SparkleSetupWindow : Window {
|
||||||
|
|
||||||
|
private Canvas canvas;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public SparkleSetupWindow ()
|
||||||
|
{
|
||||||
|
Title = "SparkleShare Setup";
|
||||||
|
Width = 640;
|
||||||
|
Height = 440;
|
||||||
|
ResizeMode = ResizeMode.NoResize;
|
||||||
|
Background = new SolidColorBrush (Colors.WhiteSmoke);
|
||||||
|
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|
||||||
|
Closing += Close;
|
||||||
|
|
||||||
|
|
||||||
|
Image image = new Image () {
|
||||||
|
Width = 150,
|
||||||
|
Height = 482
|
||||||
|
};
|
||||||
|
|
||||||
|
BitmapImage bitmap_image = new BitmapImage();
|
||||||
|
|
||||||
|
bitmap_image.BeginInit();
|
||||||
|
// TODO: get relative reference to the image
|
||||||
|
bitmap_image.UriSource = new Uri(@"C:\Users\Hylke\Code\SparkleShare\data\side-splash.png");
|
||||||
|
bitmap_image.DecodePixelWidth = 150;
|
||||||
|
bitmap_image.EndInit();
|
||||||
|
|
||||||
|
image.Source = bitmap_image;
|
||||||
|
|
||||||
|
|
||||||
|
Label size_label = new Label () {
|
||||||
|
Content = "Welcome to SparkleShare!",
|
||||||
|
|
||||||
|
Foreground = new SolidColorBrush (Color.FromRgb (0, 51, 153)),
|
||||||
|
FontSize = 16
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TextBlock history_label_value = new TextBlock () {
|
||||||
|
Text = "Before we get started, what's your name and email?\n" +
|
||||||
|
"Don't worry, this information will only visible to any team members.",
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
Width = 375
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.canvas = new Canvas ();
|
||||||
|
Content = this.canvas;
|
||||||
|
|
||||||
|
this.canvas.Children.Add (size_label);
|
||||||
|
Canvas.SetLeft (size_label, 180);
|
||||||
|
Canvas.SetTop (size_label, 18);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.canvas.Children.Add (history_label_value);
|
||||||
|
Canvas.SetLeft (history_label_value, 185);
|
||||||
|
Canvas.SetTop (history_label_value, 60);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TextBlock name_label = new TextBlock () {
|
||||||
|
Text = "Full Name:",
|
||||||
|
Width = 150,
|
||||||
|
TextAlignment = TextAlignment.Right,
|
||||||
|
FontWeight = FontWeights.Bold
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
TextBox name = new TextBox () {
|
||||||
|
Text = "Hylke Bons",
|
||||||
|
Width = 175
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TextBlock email_label = new TextBlock () {
|
||||||
|
Text = "Email:",
|
||||||
|
Width = 150,
|
||||||
|
TextAlignment = TextAlignment.Right,
|
||||||
|
FontWeight = FontWeights.Bold
|
||||||
|
};
|
||||||
|
|
||||||
|
TextBox email = new TextBox () {
|
||||||
|
Text = "hylkebons@gmail.com",
|
||||||
|
Width = 175
|
||||||
|
};
|
||||||
|
|
||||||
|
canvas.Children.Add (name);
|
||||||
|
Canvas.SetLeft (name, 340);
|
||||||
|
Canvas.SetTop (name, 200);
|
||||||
|
|
||||||
|
canvas.Children.Add (name_label);
|
||||||
|
Canvas.SetLeft (name_label, 180);
|
||||||
|
Canvas.SetTop (name_label, 200 + 3);
|
||||||
|
|
||||||
|
canvas.Children.Add (email_label);
|
||||||
|
Canvas.SetLeft (email_label, 180);
|
||||||
|
Canvas.SetTop (email_label, 230 + 3);
|
||||||
|
|
||||||
|
|
||||||
|
canvas.Children.Add (email);
|
||||||
|
Canvas.SetLeft (email, 340);
|
||||||
|
Canvas.SetTop (email, 230);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle rect = new Rectangle () {
|
||||||
|
Width = Width,
|
||||||
|
Height = 40,
|
||||||
|
Fill = new SolidColorBrush (Color.FromRgb (240, 240, 240))
|
||||||
|
};
|
||||||
|
|
||||||
|
Rectangle line = new Rectangle () {
|
||||||
|
Width = Width,
|
||||||
|
Height = 1,
|
||||||
|
Fill = new SolidColorBrush (Color.FromRgb (223, 223, 223))
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
canvas.Children.Add (rect);
|
||||||
|
Canvas.SetRight (rect, 0);
|
||||||
|
Canvas.SetBottom (rect, 0);
|
||||||
|
|
||||||
|
canvas.Children.Add (line);
|
||||||
|
Canvas.SetRight (line, 0);
|
||||||
|
Canvas.SetBottom (line, 40);
|
||||||
|
|
||||||
|
|
||||||
|
Button button = new Button () {
|
||||||
|
Content = "Continue",
|
||||||
|
Width = 75,
|
||||||
|
IsDefault = true
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
canvas.Children.Add (button);
|
||||||
|
Canvas.SetRight (button, 10);
|
||||||
|
Canvas.SetBottom (button, 9);
|
||||||
|
|
||||||
|
|
||||||
|
CheckBox check_box = new CheckBox () {
|
||||||
|
Content = "Add SparkleShare to startup items",
|
||||||
|
IsChecked = true
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
canvas.Children.Add (check_box);
|
||||||
|
Canvas.SetLeft (check_box, 200);
|
||||||
|
Canvas.SetBottom (check_box, 12);
|
||||||
|
|
||||||
|
|
||||||
|
canvas.Children.Add (image);
|
||||||
|
Canvas.SetLeft (image, 0);
|
||||||
|
Canvas.SetBottom (image, 0);
|
||||||
|
|
||||||
|
Show ();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Close (object sender, CancelEventArgs args)
|
||||||
|
{
|
||||||
|
//Controller.WindowClosed ();
|
||||||
|
args.Cancel = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -144,6 +144,7 @@
|
||||||
<Compile Include="..\SparkleEventLogController.cs">
|
<Compile Include="..\SparkleEventLogController.cs">
|
||||||
<Link>SparkleEventLogController.cs</Link>
|
<Link>SparkleEventLogController.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="SparkleSetupWindow.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\SparkleLib\windows\SparkleLib.csproj">
|
<ProjectReference Include="..\..\SparkleLib\windows\SparkleLib.csproj">
|
||||||
|
|
|
@ -62,7 +62,8 @@ namespace SparkleShare {
|
||||||
// Use translations
|
// Use translations
|
||||||
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
|
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
|
||||||
#endif
|
#endif
|
||||||
|
SparkleSetupWindow window = new SparkleSetupWindow ();
|
||||||
|
|
||||||
Setup = new SparkleSetup ();
|
Setup = new SparkleSetup ();
|
||||||
EventLog = new SparkleEventLog ();
|
EventLog = new SparkleEventLog ();
|
||||||
About = new SparkleAbout ();
|
About = new SparkleAbout ();
|
||||||
|
|
Loading…
Reference in a new issue