mac: initial code for adding the SparkleShare folder to the Finder sidebar. Waiting for NSMutableArray/Dictionary support in MonoMac
This commit is contained in:
parent
cf7372a94c
commit
fcd7868633
|
@ -79,7 +79,30 @@ namespace SparkleShare {
|
|||
// list of bookmarked places
|
||||
public override void AddToBookmarks ()
|
||||
{
|
||||
// TODO
|
||||
// TODO: Waiting for NSMutableArray/Dictionary support
|
||||
/* NSDictionary sidebar_plist = NSUserDefaults.StandardUserDefaults.PersistentDomainForName ("com.apple.sidebarlists");
|
||||
|
||||
foreach (object sidebar_item in sidebar_plist.Keys) {
|
||||
if (sidebar_item.ToString ().Equals ("useritems")) {
|
||||
NSDictionary user_items = (NSDictionary) sidebar_plist.ValueForKey (new NSString (sidebar_item.ToString ()));
|
||||
|
||||
foreach (NSObject user_item in user_items.Keys) {
|
||||
if (user_item.ToString ().Equals ("CustomListItems")) {
|
||||
NSArray custom_items = (NSArray) user_items.ValueForKey (new NSString (user_item.ToString ()));
|
||||
|
||||
NSDictionary new_dictionary = new NSDictionary ();
|
||||
new dictionary.SetValueForKey (new NSString ("Test"), new NSString ("Name"));
|
||||
|
||||
custom_items.SetValueForKey (new_dictionary, new NSString ("Item 6"));
|
||||
user_items.SetValueForKey (custom_items, new NSString (user_item.ToString ()));
|
||||
}
|
||||
}
|
||||
|
||||
sidebar_plist.SetValueForKey (user_items, new NSString (sidebar_item.ToString ()));
|
||||
}
|
||||
}
|
||||
|
||||
NSUserDefaults.StandardUserDefaults.SetPersistentDomain (sidebar_plist, "com.apple.sidebarlists"); */
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,6 +112,7 @@ namespace SparkleShare {
|
|||
if (!Directory.Exists (SparklePaths.SparklePath)) {
|
||||
Directory.CreateDirectory (SparklePaths.SparklePath);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue