Improve startup screen

This commit is contained in:
Hylke Bons 2010-07-15 20:39:12 +01:00
parent 517afbfb77
commit a881c31c66
5 changed files with 285 additions and 8 deletions

View file

@ -1 +1,41 @@
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{005CCA8E-DFBF-464A-B6DA-452C62D4589C}</ProjectGuid> <OutputType>Library</OutputType> <RootNamespace>notifysharp</RootNamespace> <AssemblyName>notify-sharp</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Compile Include="Global.cs" /> <Compile Include="Notification.cs" /> </ItemGroup> <ItemGroup> <Reference Include="NDesk.DBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" /> <Reference Include="NDesk.DBus.GLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" /> <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{005CCA8E-DFBF-464A-B6DA-452C62D4589C}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>notifysharp</RootNamespace>
<AssemblyName>notify-sharp</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Global.cs" />
<Compile Include="Notification.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="NDesk.DBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" />
<Reference Include="NDesk.DBus.GLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare", "SparkleShar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifySharp", "NotifySharp\NotifySharp.csproj", "{005CCA8E-DFBF-464A-B6DA-452C62D4589C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSSH", "SharpSSH\SharpSSH.csproj", "{BB50B7E2-4622-4D8B-B7FF-5E5D8F02D91F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -19,10 +21,13 @@ Global
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.Build.0 = Release|Any CPU
{BB50B7E2-4622-4D8B-B7FF-5E5D8F02D91F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB50B7E2-4622-4D8B-B7FF-5E5D8F02D91F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB50B7E2-4622-4D8B-B7FF-5E5D8F02D91F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB50B7E2-4622-4D8B-B7FF-5E5D8F02D91F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
name = SparkleShare
version = 0.1
StartupItem = SparkleShare\SparkleShare.csproj
name = SparkleShare
EndGlobalSection
EndGlobal
EndGlobal

View file

@ -39,7 +39,7 @@ namespace SparkleShare {
{
BorderWidth = 0;
SetSizeRequest (600, 400);
SetSizeRequest (640, 400);
Resizable = false;
IconName = "folder-sparkleshare";
@ -55,13 +55,14 @@ namespace SparkleShare {
VBox layout_vertical = new VBox (false, 0);
Label introduction = new Label ("<span size='xx-large'><b>Welcome to SparkleShare!</b></span>");
Label introduction = new Label ("<span size='x-large'><b>Welcome to SparkleShare!</b></span>");
introduction.UseMarkup = true;
introduction.Xalign = 0;
Label information = new Label ("Before we can create a SparkleShare folder on this \n" +
Label information = new Label ("Before we can create a SparkleShare folder on this " +
"computer, we need a few bits of information from you.");
information.Xalign = 0;
information.Wrap = true;
Entry name_entry = new Entry ("");
@ -113,7 +114,21 @@ namespace SparkleShare {
HButtonBox controls = new HButtonBox ();
controls.Layout = ButtonBoxStyle.End;
Button done_button = new Button ("Next");
Button done_button = new Button (_("Next"));
done_button.Clicked += delegate (object o, EventArgs args) {
done_button.Remove (done_button.Child);
HBox hbox = new HBox ();
hbox.Add (new SparkleSpinner ());
hbox.Add (new Label ("Configuring…"));
done_button.Add (hbox);
done_button.Sensitive = false;
table.Sensitive = false;
done_button.ShowAll ();
ShowStepTwo ();
};
controls.Add (done_button);
layout_vertical.PackStart (introduction, false, false, 0);
@ -131,6 +146,70 @@ namespace SparkleShare {
ShowAll ();
}
public void ShowStepTwo ()
{
Remove (Child);
HBox layout_horizontal = new HBox (false, 6);
Image side_splash = new Image ("/home/hbons/github/SparkleShare/data/side-splash.png");
layout_horizontal.PackStart (side_splash, false, false, 0);
VBox wrapper = new VBox (false, 0);
VBox layout_vertical = new VBox (false, 0);
layout_vertical.BorderWidth = 30;
Label introduction;
introduction = new Label ("<span size='x-large'><b>SparkleShare ready to go!</b></span>");
introduction.UseMarkup = true;
introduction.Xalign = 0;
Label information;
information = new Label ("You can now start accepting invitations from others. " +
"Just click on invitations you get by email and " +
"we'll take care of the rest.");
information.UseMarkup = true;
information.Wrap = true;
information.Xalign = 0;
HBox link_wrapper = new HBox (false, 0);
LinkButton link = new LinkButton ("http://www.sparkleshare.org/",
_("Learn how to host your own SparkleSpace"));
link_wrapper.PackStart (link, false, false, 0);
layout_vertical.PackStart (introduction, false, false, 0);
layout_vertical.PackStart (information, false, false, 21);
layout_vertical.PackStart (link_wrapper, false, false, 0);
HButtonBox controls = new HButtonBox ();
controls.Layout = ButtonBoxStyle.End;
controls.BorderWidth = 12;
Button finish_button = new Button (_("Finish"));
finish_button.Clicked += delegate (object o, EventArgs args) {
Destroy ();
};
controls.Add (finish_button);
wrapper.PackStart (layout_vertical, true, true, 0);
wrapper.PackStart (controls, false, false, 0);
layout_horizontal.Add (wrapper);
Add (layout_horizontal);
ShowAll ();
}
}

View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<ProjectGuid>{728483AA-E34B-4441-BF2C-C8BC2901E4E0}</ProjectGuid>
<OutputType>Exe</OutputType>
<AssemblyName>SparkleShare</AssemblyName>
<SchemaVersion>2.0</SchemaVersion>
<RootNamespace>SparkleShare</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="System" />
<Reference Include="Mono.Posix" />
</ItemGroup>
<ItemGroup>
<Compile Include="SparkleBubble.cs" />
<Compile Include="SparkleDialog.cs" />
<Compile Include="SparkleHelpers.cs" />
<Compile Include="SparklePaths.cs" />
<Compile Include="SparklePlatform.cs" />
<Compile Include="SparkleRepo.cs" />
<Compile Include="SparkleShare.cs" />
<Compile Include="SparkleSpinner.cs" />
<Compile Include="SparkleStatusIcon.cs" />
<Compile Include="SparkleUI.cs" />
<Compile Include="SparkleWindow.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotifySharp\NotifySharp.csproj">
<Project>{005CCA8E-DFBF-464A-B6DA-452C62D4589C}</Project>
<Name>NotifySharp</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,97 @@
// SparkleShare, an instant update workflow to Git.
// 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 Gtk;
using System.Timers;
namespace SparkleShare {
// This is a close implementation of GtkSpinner
public class SparkleSpinner : Image
{
public bool Active;
private Gdk.Pixbuf [] Images;
private Timer Timer;
private int CycleDuration;
private int CurrentStep;
private int NumSteps;
private int Size;
public SparkleSpinner () : base ()
{
CycleDuration = 750;
CurrentStep = 0;
Size = 16;
Gdk.Pixbuf spinner_gallery = SparkleHelpers.GetIcon ("process-working", Size);
int frames_in_width = spinner_gallery.Width / Size;
int frames_in_height = spinner_gallery.Height / Size;
NumSteps = frames_in_width * frames_in_height;
Images = new Gdk.Pixbuf [NumSteps - 1];
int i = 0;
for (int y = 0; y < frames_in_height; y++) {
for (int x = 0; x < frames_in_width; x++) {
if (!(y == 0 && x == 0)) {
Images [i] = new Gdk.Pixbuf (spinner_gallery, x * Size, y * Size, Size, Size);
i++;
}
}
}
Timer = new Timer ();
Timer.Interval = CycleDuration / NumSteps;
Timer.Elapsed += delegate {
NextImage ();
};
Start ();
}
private void NextImage ()
{
if (CurrentStep < NumSteps)
CurrentStep++;
else
CurrentStep = 0;
Pixbuf = Images [CurrentStep];
}
public bool IsActive ()
{
return Active;
}
public void Start ()
{
CurrentStep = 0;
Active = true;
Timer.Start ();
}
public void Stop ()
{
Active = false;
Timer.Stop ();
}
}
}