save work on windows
This commit is contained in:
parent
7b14f37d2e
commit
b1493c74fb
|
@ -737,6 +737,7 @@ namespace SparkleLib.Git {
|
||||||
!path.Equals (LocalPath)) {
|
!path.Equals (LocalPath)) {
|
||||||
|
|
||||||
File.Create (Path.Combine (path, ".empty")).Close ();
|
File.Create (Path.Combine (path, ".empty")).Close ();
|
||||||
|
File.SetAttributes (Path.Combine (path, ".empty"), FileAttributes.Hidden);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -990,7 +990,8 @@ namespace SparkleShare {
|
||||||
string tmp_path = SparkleConfig.DefaultConfig.TmpPath;
|
string tmp_path = SparkleConfig.DefaultConfig.TmpPath;
|
||||||
if (!Directory.Exists (tmp_path)) {
|
if (!Directory.Exists (tmp_path)) {
|
||||||
Directory.CreateDirectory (tmp_path);
|
Directory.CreateDirectory (tmp_path);
|
||||||
File.SetAttributes (tmp_path, File.GetAttributes (tmp_path) | FileAttributes.Hidden);
|
|
||||||
|
File.SetAttributes (tmp_path, FileAttributes.Directory | FileAttributes.Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,15 +96,11 @@ namespace SparkleShare {
|
||||||
Height = 260
|
Height = 260
|
||||||
};
|
};
|
||||||
|
|
||||||
BitmapImage bitmap_image = new BitmapImage();
|
image.Source =
|
||||||
|
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
|
||||||
|
Icons.about.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty,
|
||||||
|
BitmapSizeOptions.FromWidthAndHeight(640, 260));
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
|
|
||||||
Label version = new Label () {
|
Label version = new Label () {
|
||||||
|
|
|
@ -26,6 +26,8 @@ using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleSetupWindow : Window {
|
public class SparkleSetupWindow : Window {
|
||||||
|
@ -37,6 +39,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private Image side_splash;
|
private Image side_splash;
|
||||||
private Rectangle bar;
|
private Rectangle bar;
|
||||||
|
|
||||||
private Rectangle line;
|
private Rectangle line;
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,17 +73,24 @@ namespace SparkleShare {
|
||||||
Width = 150,
|
Width = 150,
|
||||||
Height = 482
|
Height = 482
|
||||||
};
|
};
|
||||||
|
System.Reflection.Assembly thisExe;
|
||||||
|
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
|
||||||
|
string [] resources = thisExe.GetManifestResourceNames();
|
||||||
|
string list = "";
|
||||||
|
|
||||||
BitmapImage bitmap_image = new BitmapImage();
|
// Build the string of resources.
|
||||||
|
foreach (string resource in resources)
|
||||||
|
list += resource + "\r\n";
|
||||||
|
MessageBox.Show (list);
|
||||||
|
|
||||||
bitmap_image.BeginInit ();
|
;
|
||||||
bitmap_image.DecodePixelWidth = 150;
|
Assembly thisassembly = Assembly.GetExecutingAssembly();
|
||||||
|
System.IO.Stream imageStream= thisassembly.GetManifestResourceStream("SparkleShare.Pixmaps.side-splash.png");
|
||||||
|
BitmapFrame bmp= BitmapFrame.Create(imageStream);
|
||||||
|
|
||||||
bitmap_image.UriSource =
|
|
||||||
new Uri (@"C:\Users\Hylke\Code\SparkleShare\data\side-splash.png");
|
|
||||||
|
|
||||||
bitmap_image.EndInit ();
|
this.side_splash.Source = bmp;
|
||||||
this.side_splash.Source = bitmap_image;
|
|
||||||
|
|
||||||
|
|
||||||
ContentCanvas.Children.Add (this.bar);
|
ContentCanvas.Children.Add (this.bar);
|
||||||
|
|
|
@ -213,6 +213,9 @@
|
||||||
<DependentUpon>SparkleSetup.cs</DependentUpon>
|
<DependentUpon>SparkleSetup.cs</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="..\..\data\side-splash.png">
|
||||||
|
<Link>Pixmaps\side-splash.png</Link>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Icons.tt">
|
<None Include="Icons.tt">
|
||||||
|
@ -387,4 +390,8 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="..\..\data\icons\sparkleshare.ico" />
|
<Content Include="..\..\data\icons\sparkleshare.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="New Folder\" />
|
||||||
|
<Folder Include="Pixmaps\" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private WinForms.NotifyIcon notify_icon = new WinForms.NotifyIcon () {
|
private WinForms.NotifyIcon notify_icon = new WinForms.NotifyIcon () {
|
||||||
Text = "SparkleShare",
|
Text = "SparkleShare",
|
||||||
Icon = Icons.sparkleshare,
|
|
||||||
Visible = true
|
Visible = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public SparkleStatusIcon ()
|
public SparkleStatusIcon ()
|
||||||
{
|
{
|
||||||
|
notify_icon.Icon = Icon.FromHandle(Icons.document_added_12.GetHicon());
|
||||||
AnimationFrames = CreateAnimationFrames ();
|
AnimationFrames = CreateAnimationFrames ();
|
||||||
Animation = CreateAnimation ();
|
Animation = CreateAnimation ();
|
||||||
|
|
||||||
|
@ -162,9 +163,17 @@ namespace SparkleShare {
|
||||||
IsEnabled = false
|
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 () {
|
MenuItem folder_item = new MenuItem () {
|
||||||
Header = " SparkleShare"//,
|
Header = " SparkleShare"//,
|
||||||
//Icon = Icons.sparkleshare
|
,Icon = i
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
folder_item.Click += delegate {
|
folder_item.Click += delegate {
|
||||||
|
@ -230,6 +239,14 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
subfolder_item.Click += OpenFolderDelegate (folder_name);
|
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))
|
if (Program.Controller.UnsyncedFolders.Contains (folder_name))
|
||||||
subfolder_item.Icon = Icons.dialog_error_16;
|
subfolder_item.Icon = Icons.dialog_error_16;
|
||||||
|
@ -295,7 +312,7 @@ namespace SparkleShare {
|
||||||
StateText = _(" Welcome to SparkleShare!");
|
StateText = _(" Welcome to SparkleShare!");
|
||||||
|
|
||||||
Dispatcher.Invoke ((Action)delegate {
|
Dispatcher.Invoke ((Action)delegate {
|
||||||
this.notify_icon.Icon = GetIconFromBitmap (AnimationFrames [0]);
|
this.notify_icon.Icon = GetIconFromBitmap (Icons.sparkleshare_windows_status);
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -308,7 +325,7 @@ namespace SparkleShare {
|
||||||
} else {
|
} else {
|
||||||
StateText = _(" Files up to date") + Controller.FolderSize;
|
StateText = _(" Files up to date") + Controller.FolderSize;
|
||||||
Dispatcher.Invoke ((Action)delegate {
|
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
|
// The state when animating
|
||||||
private void SetAnimationState ()
|
private void SetAnimationState ()
|
||||||
{
|
{
|
||||||
StateText = _("Syncing…");
|
StateText = _(" Syncing…");
|
||||||
|
|
||||||
if (!Animation.Enabled)
|
if (!Animation.Enabled)
|
||||||
Animation.Start ();
|
Animation.Start ();
|
||||||
|
|
BIN
data/tutorial-slide-1-windows.png
Normal file
BIN
data/tutorial-slide-1-windows.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
data/tutorial-slide-3-windows.png
Normal file
BIN
data/tutorial-slide-3-windows.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
Loading…
Reference in a new issue