diff --git a/SparkleShare/Windows/SparkleAbout.cs b/SparkleShare/Windows/SparkleAbout.cs index 9376bf37..b4023f59 100644 --- a/SparkleShare/Windows/SparkleAbout.cs +++ b/SparkleShare/Windows/SparkleAbout.cs @@ -16,18 +16,17 @@ using System; -using System.ComponentModel +using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Net; -using System.Windows; -using System.Windows.Controls; +using System.Windows.Forms; namespace SparkleShare { - public class SparkleAbout : Window { + public class SparkleAbout : Form { public SparkleAboutController Controller = new SparkleAboutController (); @@ -67,7 +66,7 @@ namespace SparkleShare { SizeGripStyle = SizeGripStyle.Hide; StartPosition = FormStartPosition.CenterScreen; - FormClosing += FormClosingEventHandler (Close); + FormClosing += Close; CreateAbout (); diff --git a/SparkleShare/Windows/SparkleController.cs b/SparkleShare/Windows/SparkleController.cs index 12472f2b..0ecd3c2f 100644 --- a/SparkleShare/Windows/SparkleController.cs +++ b/SparkleShare/Windows/SparkleController.cs @@ -24,11 +24,11 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading; +using System.Windows.Forms; using CefSharp; using Microsoft.Win32; using SparkleLib; -using System.Windows.Forms; namespace SparkleShare { @@ -152,7 +152,7 @@ namespace SparkleShare { public override bool CreateSparkleShareFolder () { - if (!Directory.Exists(SparkleConfig.DefaultConfig.FoldersPath) { + if (!Directory.Exists (SparkleConfig.DefaultConfig.FoldersPath)) { Directory.CreateDirectory(SparkleConfig.DefaultConfig.FoldersPath); Directory.CreateDirectory(SparkleConfig.DefaultConfig.TmpPath); diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index 745233e1..63674022 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -117,7 +117,7 @@ - + diff --git a/SparkleShare/Windows/SparkleStatusIcon.cs b/SparkleShare/Windows/SparkleStatusIcon.cs index 5f1b01ce..feabbfa8 100644 --- a/SparkleShare/Windows/SparkleStatusIcon.cs +++ b/SparkleShare/Windows/SparkleStatusIcon.cs @@ -339,7 +339,7 @@ namespace SparkleShare { private Icon GetIconFromBitmap (Bitmap bitmap) { IntPtr unmanaged_icon = bitmap.GetHicon (); - Icon icon = (Icon) Icon.FromHandle (unmanaged_con).Clone (); + Icon icon = (Icon) Icon.FromHandle (unmanaged_icon).Clone (); DestroyIcon (unmanaged_icon); return icon; diff --git a/SparkleShare/Windows/SparkleUI.cs b/SparkleShare/Windows/SparkleUI.cs new file mode 100644 index 00000000..a8b579f4 --- /dev/null +++ b/SparkleShare/Windows/SparkleUI.cs @@ -0,0 +1,86 @@ +// SparkleShare, a collaboration and sharing tool. +// Copyright (C) 2010 Hylke Bons +// +// 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 . + + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +#if __MonoCS__ +using Gtk; +using Mono.Unix; +using Mono.Unix.Native; +#else +using System.Windows.Forms; +#endif +using SparkleLib; + +namespace SparkleShare { + + public class SparkleUI { + + public static SparkleStatusIcon StatusIcon; + public static SparkleEventLog EventLog; + public static SparkleBubbles Bubbles; + public static SparkleSetup Setup; + public static SparkleAbout About; + + public static string AssetsPath = + new string [] {Defines.PREFIX, "share", "sparkleshare"}.Combine (); + + + // Short alias for the translations + public static string _(string s) + { + return Program._ (s); + } + + + public SparkleUI () + { + // Initialize the application +#if __MonoCS__ + Application.Init (); + + // Use translations + Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR); +#endif + + Setup = new SparkleSetup (); + EventLog = new SparkleEventLog (); + //About = new SparkleAbout (); + Bubbles = new SparkleBubbles (); + StatusIcon = new SparkleStatusIcon (); + + if (Program.Controller.FirstRun) + Program.Controller.ShowSetupWindow (PageType.Setup); + } + + + // Runs the application + public void Run () + { + Application.Run (); +#if !__MonoCS__ + StatusIcon.Dispose (); +#endif + } + } +}