[osx] Set a custom icon for ~/SparkleShare
This commit is contained in:
parent
a67971ef0f
commit
e3b324e3c8
|
@ -15,6 +15,9 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
using MonoMac.Foundation;
|
||||||
|
using MonoMac.AppKit;
|
||||||
|
using MonoMac.ObjCRuntime;
|
||||||
using SparkleLib;
|
using SparkleLib;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -24,12 +27,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleMacController : SparkleController {
|
public class SparkleMacController : SparkleController {
|
||||||
|
|
||||||
// Creates a .desktop entry in autostart folder to
|
|
||||||
// start SparkleShare automatically at login
|
|
||||||
public override void EnableSystemAutostart ()
|
public override void EnableSystemAutostart ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// N/A
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ namespace SparkleShare {
|
||||||
public override void InstallLauncher ()
|
public override void InstallLauncher ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// N/A
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +59,21 @@ namespace SparkleShare {
|
||||||
public override bool CreateSparkleShareFolder ()
|
public override bool CreateSparkleShareFolder ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!Directory.Exists (SparklePaths.SparklePath)) {
|
||||||
|
|
||||||
|
Directory.CreateDirectory (SparklePaths.SparklePath);
|
||||||
|
|
||||||
|
NSWorkspace.SharedWorkspace.SetIconforFile (NSImage.ImageNamed ("sparkleshare.icns"),
|
||||||
|
SparklePaths.SparklePath, 0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,14 @@ namespace SparkleShare {
|
||||||
public static List <SparkleLog> OpenLogs;
|
public static List <SparkleLog> OpenLogs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SparkleUI ()
|
public SparkleUI ()
|
||||||
{
|
{
|
||||||
|
|
||||||
NSApplication.Init ();
|
NSApplication.Init ();
|
||||||
|
|
||||||
NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns");
|
NSApplication.SharedApplication.applicationIconImage
|
||||||
|
= NSImage.ImageNamed ("sparkleshare.icns");
|
||||||
|
|
||||||
OpenLogs = new List <SparkleLog> ();
|
OpenLogs = new List <SparkleLog> ();
|
||||||
StatusIcon = new SparkleStatusIcon ();
|
StatusIcon = new SparkleStatusIcon ();
|
||||||
|
|
Loading…
Reference in a new issue