windows: use dedicated SparkleUI class
This commit is contained in:
parent
532821394b
commit
038f673c0f
|
@ -208,6 +208,13 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void UIHasLoaded ()
|
||||||
|
{
|
||||||
|
if (FirstRun)
|
||||||
|
ShowSetupWindow (PageType.Setup);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool FirstRun {
|
public bool FirstRun {
|
||||||
get {
|
get {
|
||||||
return SparkleConfig.DefaultConfig.User.Email.Equals ("Unknown");
|
return SparkleConfig.DefaultConfig.User.Email.Equals ("Unknown");
|
||||||
|
|
|
@ -63,9 +63,6 @@
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="CefSharp, Version=0.3.4006.34354, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<HintPath>..\..\bin\CefSharp.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
|
@ -73,6 +70,9 @@
|
||||||
<HintPath>..\..\bin\Gettext.Cs.dll</HintPath>
|
<HintPath>..\..\bin\Gettext.Cs.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WindowsFormsIntegration" />
|
<Reference Include="WindowsFormsIntegration" />
|
||||||
|
<Reference Include="CefSharp">
|
||||||
|
<HintPath>..\..\bin\CefSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\..\SparkleLib\windows\GlobalAssemblyInfo.cs">
|
<Compile Include="..\..\SparkleLib\windows\GlobalAssemblyInfo.cs">
|
||||||
|
|
|
@ -16,20 +16,8 @@
|
||||||
|
|
||||||
|
|
||||||
using System;
|
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;
|
using System.Windows.Forms;
|
||||||
#endif
|
|
||||||
using SparkleLib;
|
using SparkleLib;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
@ -42,26 +30,9 @@ namespace SparkleShare {
|
||||||
public static SparkleSetup Setup;
|
public static SparkleSetup Setup;
|
||||||
public static SparkleAbout About;
|
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 ()
|
public SparkleUI ()
|
||||||
{
|
{
|
||||||
// Initialize the application
|
|
||||||
#if __MonoCS__
|
|
||||||
Application.Init ();
|
|
||||||
|
|
||||||
// Use translations
|
|
||||||
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
|
|
||||||
#endif
|
|
||||||
SparkleWindow window = new SparkleWindow ();
|
SparkleWindow window = new SparkleWindow ();
|
||||||
|
|
||||||
Setup = new SparkleSetup ();
|
Setup = new SparkleSetup ();
|
||||||
|
@ -70,18 +41,14 @@ namespace SparkleShare {
|
||||||
Bubbles = new SparkleBubbles ();
|
Bubbles = new SparkleBubbles ();
|
||||||
StatusIcon = new SparkleStatusIcon ();
|
StatusIcon = new SparkleStatusIcon ();
|
||||||
|
|
||||||
if (Program.Controller.FirstRun)
|
Program.Controller.UIHasLoaded ();
|
||||||
Program.Controller.ShowSetupWindow (PageType.Setup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Runs the application
|
|
||||||
public void Run ()
|
public void Run ()
|
||||||
{
|
{
|
||||||
Application.Run ();
|
Application.Run ();
|
||||||
#if !__MonoCS__
|
|
||||||
StatusIcon.Dispose ();
|
StatusIcon.Dispose ();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue