[tomboy] Add initial support for "pinned" state.



commit 3567317ff482abdf8a6af5a76375287b6a794fe3
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Tue May 19 12:54:06 2009 -0700

    Add initial support for "pinned" state.
---
 Tomboy/Addins/WebSyncService/Api/NoteInfo.cs |    7 +++++++
 Tomboy/Addins/WebSyncService/NoteConvert.cs  |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Tomboy/Addins/WebSyncService/Api/NoteInfo.cs b/Tomboy/Addins/WebSyncService/Api/NoteInfo.cs
index c8c0186..dead098 100644
--- a/Tomboy/Addins/WebSyncService/Api/NoteInfo.cs
+++ b/Tomboy/Addins/WebSyncService/Api/NoteInfo.cs
@@ -73,6 +73,8 @@ namespace Tomboy.WebSync.Api
 				note.LastSyncRevision = (int) val;
 			if (jsonObj.TryGetValue (OpenOnStartupElementName, out val))
 				note.OpenOnStartup = (bool) val;
+			if (jsonObj.TryGetValue (PinnedElementName, out val))
+				note.Pinned = (bool) val;
 			
 			if (jsonObj.TryGetValue (TagsElementName, out val)) {
 				Hyena.Json.JsonArray tagsJsonArray =
@@ -130,6 +132,8 @@ namespace Tomboy.WebSync.Api
 //				noteUpdateObj [LastSyncRevisionElementName] = LastSyncRevision;
 			if (OpenOnStartup.HasValue)
 				noteUpdateObj [OpenOnStartupElementName] = OpenOnStartup.Value;
+			if (Pinned.HasValue)
+				noteUpdateObj [PinnedElementName] = Pinned.Value;
 
 			if (Tags != null) {
 				Hyena.Json.JsonArray tagArray =
@@ -166,6 +170,8 @@ namespace Tomboy.WebSync.Api
 		
 		public bool? OpenOnStartup { get; set; }
 		
+		public bool? Pinned { get; set; }
+		
 		public List<string> Tags { get; set; }
 
 		public string Command { get; set; }
@@ -184,6 +190,7 @@ namespace Tomboy.WebSync.Api
 		private const string CreateDateElementName = "create-date";
 		private const string LastSyncRevisionElementName = "last-sync-revision";
 		private const string OpenOnStartupElementName = "open-on-startup";
+		private const string PinnedElementName = "pinned";
 		private const string TagsElementName = "tags";
 		private const string CommandElementName = "command";
 
diff --git a/Tomboy/Addins/WebSyncService/NoteConvert.cs b/Tomboy/Addins/WebSyncService/NoteConvert.cs
index 8301100..a5a9421 100644
--- a/Tomboy/Addins/WebSyncService/NoteConvert.cs
+++ b/Tomboy/Addins/WebSyncService/NoteConvert.cs
@@ -41,6 +41,7 @@ namespace Tomboy.WebSync
 			noteInfo.Guid = note.Id;
 			noteInfo.Title = note.Title;
 			noteInfo.OpenOnStartup = note.IsOpenOnStartup;
+			noteInfo.Pinned = note.IsPinned;
 			noteInfo.CreateDate = note.CreateDate;
 			noteInfo.LastChangeDate = note.ChangeDate;
 			noteInfo.LastMetadataChangeDate = note.MetadataChangeDate;
@@ -81,6 +82,7 @@ namespace Tomboy.WebSync
 			noteData.MetadataChangeDate = noteInfo.LastMetadataChangeDate.Value;
 			noteData.CreateDate = noteInfo.CreateDate.Value;
 			noteData.IsOpenOnStartup = noteInfo.OpenOnStartup.Value;
+			// TODO: support Pinned
 
 			foreach (string tagName in noteInfo.Tags) {
 				Tag tag = TagManager.GetOrCreateTag (tagName);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]