save work on windows

This commit is contained in:
Hylke Bons 2012-03-06 01:18:45 +00:00
parent 72704cc740
commit 1e6cba4baa
8 changed files with 55 additions and 23 deletions

View file

@ -737,6 +737,7 @@ namespace SparkleLib.Git {
!path.Equals (LocalPath)) {
File.Create (Path.Combine (path, ".empty")).Close ();
File.SetAttributes (Path.Combine (path, ".empty"), FileAttributes.Hidden);
}
}

View file

@ -990,7 +990,8 @@ namespace SparkleShare {
string tmp_path = SparkleConfig.DefaultConfig.TmpPath;
if (!Directory.Exists (tmp_path)) {
Directory.CreateDirectory (tmp_path);
File.SetAttributes (tmp_path, File.GetAttributes (tmp_path) | FileAttributes.Hidden);
File.SetAttributes (tmp_path, FileAttributes.Directory | FileAttributes.Hidden);
}

View file

@ -96,15 +96,11 @@ namespace SparkleShare {
Height = 260
};
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\about.png");
bitmap_image.DecodePixelWidth = 640;
bitmap_image.EndInit();
image.Source = bitmap_image;
image.Source =
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
Icons.about.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty,
BitmapSizeOptions.FromWidthAndHeight(640, 260));
Label version = new Label () {

View file

@ -26,6 +26,8 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Reflection;
namespace SparkleShare {
public class SparkleSetupWindow : Window {
@ -37,6 +39,7 @@ namespace SparkleShare {
private Image side_splash;
private Rectangle bar;
private Rectangle line;
@ -70,18 +73,25 @@ namespace SparkleShare {
Width = 150,
Height = 482
};
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
string [] resources = thisExe.GetManifestResourceNames();
string list = "";
// Build the string of resources.
foreach (string resource in resources)
list += resource + "\r\n";
MessageBox.Show (list);
BitmapImage bitmap_image = new BitmapImage();
;
Assembly thisassembly = Assembly.GetExecutingAssembly();
System.IO.Stream imageStream= thisassembly.GetManifestResourceStream("SparkleShare.Pixmaps.side-splash.png");
BitmapFrame bmp= BitmapFrame.Create(imageStream);
bitmap_image.BeginInit ();
bitmap_image.DecodePixelWidth = 150;
this.side_splash.Source = bmp;
bitmap_image.UriSource =
new Uri (@"C:\Users\Hylke\Code\SparkleShare\data\side-splash.png");
bitmap_image.EndInit ();
this.side_splash.Source = bitmap_image;
ContentCanvas.Children.Add (this.bar);
Canvas.SetRight (bar, 0);

View file

@ -213,6 +213,9 @@
<DependentUpon>SparkleSetup.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="..\..\data\side-splash.png">
<Link>Pixmaps\side-splash.png</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Icons.tt">
@ -387,4 +390,8 @@
<ItemGroup>
<Content Include="..\..\data\icons\sparkleshare.ico" />
</ItemGroup>
<ItemGroup>
<Folder Include="New Folder\" />
<Folder Include="Pixmaps\" />
</ItemGroup>
</Project>

View file

@ -40,7 +40,7 @@ namespace SparkleShare {
private WinForms.NotifyIcon notify_icon = new WinForms.NotifyIcon () {
Text = "SparkleShare",
Icon = Icons.sparkleshare,
Visible = true
};
@ -55,6 +55,7 @@ namespace SparkleShare {
public SparkleStatusIcon ()
{
notify_icon.Icon = Icon.FromHandle(Icons.document_added_12.GetHicon());
AnimationFrames = CreateAnimationFrames ();
Animation = CreateAnimation ();
@ -162,9 +163,17 @@ namespace SparkleShare {
IsEnabled = false
};
System.Windows.Controls.Image i = new System.Windows.Controls.Image();
i.Source =
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
Icons.folder_sparkleshare_16.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(16, 16));
MenuItem folder_item = new MenuItem () {
Header = " SparkleShare"//,
//Icon = Icons.sparkleshare
,Icon = i
};
folder_item.Click += delegate {
@ -230,6 +239,14 @@ namespace SparkleShare {
};
subfolder_item.Click += OpenFolderDelegate (folder_name);
System.Windows.Controls.Image i2 = new System.Windows.Controls.Image();
i2.Source =
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
Icons.sparkleshare_windows_status.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(16, 16));
subfolder_item.Icon = i2;
/*
if (Program.Controller.UnsyncedFolders.Contains (folder_name))
subfolder_item.Icon = Icons.dialog_error_16;
@ -295,7 +312,7 @@ namespace SparkleShare {
StateText = _(" Welcome to SparkleShare!");
Dispatcher.Invoke ((Action)delegate {
this.notify_icon.Icon = GetIconFromBitmap (AnimationFrames [0]);
this.notify_icon.Icon = GetIconFromBitmap (Icons.sparkleshare_windows_status);
});
} else {
@ -308,7 +325,7 @@ namespace SparkleShare {
} else {
StateText = _(" Files up to date") + Controller.FolderSize;
Dispatcher.Invoke ((Action)delegate {
this.notify_icon.Icon = GetIconFromBitmap (AnimationFrames [0]);
this.notify_icon.Icon = GetIconFromBitmap (Icons.sparkleshare_windows_status);
});
}
}
@ -324,7 +341,7 @@ namespace SparkleShare {
// The state when animating
private void SetAnimationState ()
{
StateText = _("Syncing…");
StateText = _(" Syncing…");
if (!Animation.Enabled)
Animation.Start ();

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB