From 038f673c0fc9445ceb1c28d78593519020252d91 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 5 Mar 2012 18:50:19 +0000 Subject: [PATCH] windows: use dedicated SparkleUI class --- SparkleShare/SparkleControllerBase.cs | 9 +++++- SparkleShare/Windows/SparkleShare.csproj | 6 ++-- SparkleShare/Windows/SparkleUI.cs | 39 ++---------------------- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 214af432..d617e9da 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -206,7 +206,14 @@ namespace SparkleShare { new Thread (new ThreadStart (PopulateRepositories)).Start (); } - + + + public void UIHasLoaded () + { + if (FirstRun) + ShowSetupWindow (PageType.Setup); + } + public bool FirstRun { get { diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index 82f2dcdb..4fc1b021 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -63,9 +63,6 @@ - - ..\..\bin\CefSharp.dll - @@ -73,6 +70,9 @@ ..\..\bin\Gettext.Cs.dll + + ..\..\bin\CefSharp.dll + diff --git a/SparkleShare/Windows/SparkleUI.cs b/SparkleShare/Windows/SparkleUI.cs index 9ac860f9..37b7f21d 100644 --- a/SparkleShare/Windows/SparkleUI.cs +++ b/SparkleShare/Windows/SparkleUI.cs @@ -16,20 +16,8 @@ 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 { @@ -42,26 +30,9 @@ namespace SparkleShare { 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 SparkleWindow window = new SparkleWindow (); Setup = new SparkleSetup (); @@ -70,18 +41,14 @@ namespace SparkleShare { Bubbles = new SparkleBubbles (); StatusIcon = new SparkleStatusIcon (); - if (Program.Controller.FirstRun) - Program.Controller.ShowSetupWindow (PageType.Setup); + Program.Controller.UIHasLoaded (); } - - // Runs the application + public void Run () { Application.Run (); -#if !__MonoCS__ StatusIcon.Dispose (); -#endif } } }