예제 #1
0
        private static void UpdateLocalNote(Note localNote, NoteUpdate serverNote, NoteSyncType syncType)
        {
            // In each case, update existingNote's content and revision
            try {
                localNote.LoadForeignNoteXml(serverNote.XmlContent, ChangeType.OtherDataChanged);
            } catch {}             // TODO: Handle exception in case that serverNote.XmlContent is invalid XML
            client.SetRevision(localNote, serverNote.LatestRevision);

            // Update dialog's sync status
            if (syncUI != null)
            {
                syncUI.NoteSynchronized(localNote.Title, syncType);
            }
        }
예제 #2
0
        public void NoteSynchronized(string noteTitle, NoteSyncType type)
        {
            // This event handler will be called by the synchronization thread
            // so we have to use the delegate here to manipulate the GUI.
            Gtk.Application.Invoke(delegate {
                // FIXME: Change these strings to be more user-friendly
                // TODO: Update status for a note when status changes ("Uploading" -> "Uploaded", etc)
                string statusText = string.Empty;
                switch (type)
                {
                case NoteSyncType.DeleteFromClient:
                    statusText = Catalog.GetString("Deleted locally");
                    break;

                case NoteSyncType.DeleteFromServer:
                    statusText = Catalog.GetString("Deleted from server");
                    break;

                case NoteSyncType.DownloadModified:
                    statusText = Catalog.GetString("Updated");
                    break;

                case NoteSyncType.DownloadNew:
                    statusText = Catalog.GetString("Added");
                    break;

                case NoteSyncType.UploadModified:
                    statusText = Catalog.GetString("Uploaded changes to server");
                    break;

                case NoteSyncType.UploadNew:
                    statusText = Catalog.GetString("Uploaded new note to server");
                    break;
                }
                AddUpdateItem(noteTitle, statusText);
            });
        }
예제 #3
0
		public void NoteSynchronized (string noteTitle, NoteSyncType type)
		{
			// This event handler will be called by the synchronization thread
			// so we have to use the delegate here to manipulate the GUI.
			Gtk.Application.Invoke (delegate {
				// FIXME: Change these strings to be more user-friendly
				// TODO: Update status for a note when status changes ("Uploading" -> "Uploaded", etc)
				string statusText = string.Empty;
				switch (type) {
				case NoteSyncType.DeleteFromClient:
					statusText = Catalog.GetString ("Deleted locally");
					break;
				case NoteSyncType.DeleteFromServer:
					statusText = Catalog.GetString ("Deleted from server");
					break;
				case NoteSyncType.DownloadModified:
					statusText = Catalog.GetString ("Updated");
					break;
				case NoteSyncType.DownloadNew:
					statusText = Catalog.GetString ("Added");
					break;
				case NoteSyncType.UploadModified:
					statusText = Catalog.GetString ("Uploaded changes to server");
					break;
				case NoteSyncType.UploadNew:
					statusText = Catalog.GetString ("Uploaded new note to server");
					break;
				}
				AddUpdateItem (noteTitle, statusText);
			});
		}
예제 #4
0
파일: SyncManager.cs 프로젝트: oluc/tomboy
		private static void UpdateLocalNote (Note localNote, NoteUpdate serverNote, NoteSyncType syncType)
		{
			// In each case, update existingNote's content and revision
			try {
				localNote.LoadForeignNoteXml (serverNote.XmlContent, ChangeType.OtherDataChanged);
			} catch {} // TODO: Handle exception in case that serverNote.XmlContent is invalid XML
			client.SetRevision (localNote, serverNote.LatestRevision);

			// Update dialog's sync status
			if (syncUI != null)
				syncUI.NoteSynchronized (localNote.Title, syncType);
		}
예제 #5
0
 public void NoteSynchronized(string noteTitle, NoteSyncType type)
 {
     Logger.Debug("SilentUI: NoteSynchronized, Title: {0}, Type: {1}", noteTitle, type);
 }
예제 #6
0
		public void NoteSynchronized (string noteTitle, NoteSyncType type)
		{
			Logger.Debug ("SilentUI: NoteSynchronized, Title: {0}, Type: {1}", noteTitle, type);
		}