[controller] Fix size not being updated in statusicon
This commit is contained in:
parent
49029e8513
commit
37b4c5f3fb
|
@ -63,16 +63,6 @@ namespace SparkleShare {
|
|||
|
||||
Directory.CreateDirectory (SparklePaths.SparklePath);
|
||||
|
||||
|
||||
string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||
"Pixmaps", "sparkleshare-folder.icns");
|
||||
|
||||
NSImage folder_icon = new NSImage (folder_icon_path);
|
||||
|
||||
NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon,
|
||||
SparklePaths.SparklePath, 0);
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Timers;
|
||||
using MonoMac.Foundation;
|
||||
using MonoMac.AppKit;
|
||||
|
@ -69,7 +70,12 @@ namespace SparkleShare {
|
|||
|
||||
SparkleShare.Controller.FolderSizeChanged += delegate {
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
if (!Animation.Enabled)
|
||||
SetNormalState ();
|
||||
|
||||
UpdateMenu ();
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -161,7 +167,11 @@ namespace SparkleShare {
|
|||
SparkleShare.Controller.OpenSparkleShareFolder ();
|
||||
};
|
||||
|
||||
FolderMenuItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-mac-16.png");
|
||||
|
||||
string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||
"sparkleshare.icns");
|
||||
|
||||
FolderMenuItem.Image = new NSImage (folder_icon_path);
|
||||
FolderMenuItem.Image.Size = new SizeF (16, 16);
|
||||
|
||||
Menu.AddItem (FolderMenuItem);
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace SparkleShare {
|
|||
|
||||
NSApplication.Init ();
|
||||
|
||||
SetSparkleIcon ();
|
||||
|
||||
// TODO: Getting crashes when I remove this
|
||||
NSApplication.SharedApplication.ApplicationIconImage
|
||||
|
@ -96,6 +97,20 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public void SetSparkleIcon ()
|
||||
{
|
||||
|
||||
string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||
"sparkleshare.icns");
|
||||
|
||||
NSImage folder_icon = new NSImage (folder_icon_path);
|
||||
|
||||
NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon,
|
||||
SparkleShare.Controller.SparklePath, 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Run ()
|
||||
{
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ namespace SparkleShare {
|
|||
public string FolderSize;
|
||||
public bool FirstRun;
|
||||
|
||||
public readonly string SparklePath;
|
||||
|
||||
|
||||
public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing;
|
||||
public delegate void OnQuitWhileSyncingEventHandler ();
|
||||
|
@ -88,6 +90,8 @@ namespace SparkleShare {
|
|||
FolderSize = GetFolderSize ();
|
||||
|
||||
|
||||
SparklePath = SparklePaths.SparklePath;
|
||||
|
||||
string global_config_file_path = SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath, "config");
|
||||
|
||||
// Show the introduction screen if SparkleShare isn't configured
|
||||
|
@ -555,6 +559,12 @@ namespace SparkleShare {
|
|||
if (FolderListChanged != null)
|
||||
FolderListChanged ();
|
||||
|
||||
|
||||
FolderSize = GetFolderSize ();
|
||||
|
||||
if (FolderSizeChanged != null)
|
||||
FolderSizeChanged (FolderSize);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -584,6 +594,12 @@ namespace SparkleShare {
|
|||
if (FolderListChanged != null)
|
||||
FolderListChanged ();
|
||||
|
||||
|
||||
FolderSize = GetFolderSize ();
|
||||
|
||||
if (FolderSizeChanged != null)
|
||||
FolderSizeChanged (FolderSize);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue