=== modified file 'Do.Addins/AssemblyInfo.cs' --- Do.Addins/AssemblyInfo.cs 2007-10-13 21:55:22 +0000 +++ Do.Addins/AssemblyInfo.cs 2007-12-11 13:05:11 +0000 @@ -6,7 +6,6 @@ // // change them to the information which is associated with the assembly // you compile. - [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -22,7 +21,6 @@ // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): - [assembly: AssemblyVersion("1.0.*")] // The following attributes specify the key for the sign of your assembly. See the === modified file 'Do.Addins/src/Do.Addins/ContactItemStore.cs' --- Do.Addins/src/Do.Addins/ContactItemStore.cs 2007-11-01 18:36:01 +0000 +++ Do.Addins/src/Do.Addins/ContactItemStore.cs 2007-12-11 13:06:08 +0000 @@ -25,66 +25,65 @@ namespace Do.Addins { - public class ContactItemStore - { static Dictionary contacts; static Dictionary contacts_by_name; static Dictionary contacts_by_email; static Dictionary contacts_by_aim; static Dictionary contacts_by_jabber; - - static ContactItemStore () { + + static ContactItemStore () + { contacts = new Dictionary (); contacts_by_name = new Dictionary (); contacts_by_email = new Dictionary (); contacts_by_aim = new Dictionary (); contacts_by_jabber = new Dictionary (); } - + public static bool SynchronizeContactWithStore (ref ContactItem contact) { ContactItem match; - + match = null; if (contact.name != null) { contacts_by_name.TryGetValue (contact.Name.ToLower(), out match); if (match != null) goto got_match; } - + foreach (string email in contact.Emails) { contacts_by_email.TryGetValue (email.ToLower(), out match); if (match != null) goto got_match; } - + foreach (string aim in contact.AIMs) { contacts_by_aim.TryGetValue (aim.ToLower(), out match); if (match != null) goto got_match; } - + foreach (string jabber in contact.Jabbers) { contacts_by_jabber.TryGetValue (jabber.ToLower(), out match); if (match != null) goto got_match; } - - // New contact data. + + // New contact data. AddContactData (contact); - return false; - got_match: + return false; + got_match: MergeContactIntoContact (contact, match); AddContactData (match); contact = match; return true; } - + static void MergeContactIntoContact (ContactItem source, ContactItem dest) { // This is a very delicate line; the distinction between fields // and properties is essential. if (dest.name == null && source.name != null) dest.Name = source.Name; - + // If dest has no photo, give it source's photo. if (dest.Photo == null) { dest.Photo = source.Photo; @@ -93,19 +92,19 @@ } else if (source.Photo != null && File.Exists (dest.Photo) && File.Exists (source.Photo)) { long source_photo_size, dest_photo_size; - + source_photo_size = new FileInfo (source.Photo).Length; dest_photo_size = new FileInfo (dest.Photo).Length; if (source_photo_size > dest_photo_size) { dest.Photo = source.Photo; } } - + AddMissingListElements (source.Emails, dest.Emails); AddMissingListElements (source.AIMs, dest.AIMs); AddMissingListElements (source.Jabbers, dest.Jabbers); } - + static void AddMissingListElements (List source, List dest) { foreach (T member in source) { @@ -113,27 +112,28 @@ dest.Add (member); } } - + public static void AddContactData (ContactItem c) { if (c == null) return; - + contacts[c] = true; - + if (c.name != null) contacts_by_name[c.name.ToLower()] = c; - + foreach (string email in c.Emails) contacts_by_email[email.ToLower()] = c; - + foreach (string aim in c.AIMs) contacts_by_aim[aim.ToLower()] = c; - + foreach (string jabber in c.Jabbers) contacts_by_jabber[jabber.ToLower()] = c; } - - public static ICollection Contacts { + + public static ICollection Contacts + { get { return contacts.Keys; } === modified file 'Do.Addins/src/Do.Addins/Util.cs' --- Do.Addins/src/Do.Addins/Util.cs 2007-10-20 22:32:05 +0000 +++ Do.Addins/src/Do.Addins/Util.cs 2007-12-11 13:05:52 +0000 @@ -45,6 +45,6 @@ public static PixbufFromIconNameDelegate PixbufFromIconName; public static StringTransformationDelegate MarkupSafeString; public static PopupMainMenuAtPositionDelegate PopupMainMenuAtPosition; - } + } } } === modified file 'Do.Addins/src/Do.Universe/ApplicationItem.cs' --- Do.Addins/src/Do.Universe/ApplicationItem.cs 2007-10-20 22:32:05 +0000 +++ Do.Addins/src/Do.Universe/ApplicationItem.cs 2007-12-11 12:45:01 +0000 @@ -25,7 +25,6 @@ namespace Do.Universe { - /// /// If this exception is thrown in the ApplicationItem constructor, the /// ApplicationItemSource will catch it and discard the item. @@ -39,7 +38,6 @@ public class ApplicationItem : IRunnableItem { - protected string desktopFile; protected IntPtr desktopFilePtr; protected string name, description, icon; @@ -56,11 +54,13 @@ this.desktopFile = desktopFile; desktopFilePtr = gnome_desktop_item_new_from_file (desktopFile, 0, IntPtr.Zero); - if (desktopFilePtr == IntPtr.Zero) { - throw new ApplicationDetailMissingException("Failed to load launcher"); - } - name = gnome_desktop_item_get_string(desktopFilePtr, "Name"); - description = gnome_desktop_item_get_string(desktopFilePtr, "Comment"); + if (desktopFilePtr == IntPtr.Zero) { + throw new ApplicationDetailMissingException("Failed to load launcher"); + } + // Gets the i18n name and description + name = gnome_desktop_item_get_localestring(desktopFilePtr, "Name"); + description = gnome_desktop_item_get_localestring(desktopFilePtr, "Comment"); + // Not sure if it works 100% with i18n, so using get_string for the moment icon = gnome_desktop_item_get_string(desktopFilePtr, "Icon"); if (icon == null || icon == "") { @@ -69,15 +69,18 @@ } } - public string Name { + public string Name + { get { return name; } } - public string Description { + public string Description + { get { return description; } } - public string Icon { + public string Icon + { get { return icon; } } @@ -85,20 +88,24 @@ /// Executes the application by launching the desktop item given in the /// constructor. /// - public void Run () { + public void Run () + { if (desktopFilePtr != IntPtr.Zero) { gnome_desktop_item_launch(desktopFilePtr, IntPtr.Zero, 0, IntPtr.Zero); } } - [DllImport ("libgnome-desktop-2.so.2")] private static extern IntPtr gnome_desktop_item_new_from_file(string file, int flags, IntPtr error); [DllImport ("libgnome-desktop-2.so.2")] private static extern int gnome_desktop_item_launch(IntPtr item, IntPtr args, int flags, IntPtr error); - - [DllImport("libgnome-desktop-2.so.2")] + + [DllImport ("libgnome-desktop-2.so.2")] + private static extern string gnome_desktop_item_get_localestring(IntPtr item, string id); + + // Do we really need this? isn't localestring enough? + [DllImport ("libgnome-desktop-2.so.2")] private static extern string gnome_desktop_item_get_string(IntPtr item, string id); } } === modified file 'Do.Addins/src/Do.Universe/ApplicationItemSource.cs' --- Do.Addins/src/Do.Universe/ApplicationItemSource.cs 2007-12-08 01:32:57 +0000 +++ Do.Addins/src/Do.Universe/ApplicationItemSource.cs 2007-12-11 13:06:58 +0000 @@ -26,7 +26,6 @@ { public class ApplicationItemSource : IItemSource { - /// /// Locations to search for .desktop files. /// @@ -36,39 +35,43 @@ "/usr/share/gdm/applications", "/usr/local/share/applications", }; - + private List apps; static ApplicationItemSource () { Gnome.Vfs.Vfs.Initialize (); } - + public ApplicationItemSource () { - apps = new List (); + apps = new List (); UpdateItems (); } - - public Type[] SupportedItemTypes { + + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (ApplicationItem), }; } } - - public string Name { + + public string Name + { get { return "Applications"; } } - - public string Description { + + public string Description + { get { return "Finds applications in many locations."; } } - - public string Icon { + + public string Icon + { get { return "gnome-applications"; } } - + /// /// Given an absolute path to a directory, scan that directory for /// .desktop files, creating an ApplicationItem for each desktop file @@ -81,11 +84,11 @@ private void LoadDesktopFiles (string desktop_files_dir) { ApplicationItem app; - + if (!Directory.Exists (desktop_files_dir)) return; foreach (string filename in Directory.GetFiles (desktop_files_dir)) { if (!filename.EndsWith (".desktop")) continue; - + try { app = new ApplicationItem (filename); } catch { @@ -93,9 +96,8 @@ } apps.Add(app); } - } - + public void UpdateItems () { apps.Clear (); @@ -103,14 +105,13 @@ LoadDesktopFiles (dir); } } - + public ICollection Items { get { return apps; } } - + public ICollection ChildrenOfItem (IItem item) { return null; } - } } === modified file 'Do.Addins/src/Do.Universe/BookmarkItem.cs' --- Do.Addins/src/Do.Universe/BookmarkItem.cs 2007-10-20 22:32:05 +0000 +++ Do.Addins/src/Do.Universe/BookmarkItem.cs 2007-12-11 13:07:14 +0000 @@ -23,14 +23,12 @@ namespace Do.Universe { - /// /// Simple base class for representing bookmarks. /// A bookmark is any item with a name and URL. /// public class BookmarkItem : IURLItem { - protected string name, url; /// @@ -48,19 +46,23 @@ this.url = url; } - public string Name { + public string Name + { get { return name; } } - public string Description { + public string Description + { get { return url; } } - public string Icon { + public string Icon + { get { return "www"; } } - public string URL { + public string URL + { get { return url; } } === modified file 'Do.Addins/src/Do.Universe/ContactItem.cs' --- Do.Addins/src/Do.Universe/ContactItem.cs 2007-11-01 18:36:01 +0000 +++ Do.Addins/src/Do.Universe/ContactItem.cs 2007-12-11 13:07:28 +0000 @@ -42,7 +42,8 @@ jabbers = new List (); } - public string Name { + public string Name + { get { if (name != null) return name; if (emails.Count > 0) return emails[0]; @@ -53,12 +54,14 @@ set { name = value; } } - public string Photo { + public string Photo + { get { return photo; } set { photo = value; } } - public string Description { + public string Description + { get { if (emails.Count > 0) return emails[0]; if (aims.Count > 0) return "AIM: " + aims[0]; @@ -67,7 +70,8 @@ } } - public string Icon { + public string Icon + { get { return Photo ?? "stock_person"; } === modified file 'Do.Addins/src/Do.Universe/DefineWordCommand.cs' --- Do.Addins/src/Do.Universe/DefineWordCommand.cs 2007-11-08 08:00:24 +0000 +++ Do.Addins/src/Do.Universe/DefineWordCommand.cs 2007-12-11 13:07:56 +0000 @@ -28,7 +28,6 @@ /// public class DefineWordCommand : ICommand { - /// /// Should match those and only those strings that can be /// looked up in a dictionary. @@ -48,15 +47,18 @@ get { return "Define"; } } - public string Description { + public string Description + { get { return "Define a given word."; } } - public string Icon { + public string Icon + { get { return "accessories-dictionary.png"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (ITextItem), @@ -64,7 +66,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } } @@ -78,7 +81,8 @@ /// A indicating whether or not IITem /// can be defined. /// - public bool SupportsItem (IItem item) { + public bool SupportsItem (IItem item) + { string word; word = null; @@ -115,8 +119,5 @@ } } } - - } - } === modified file 'Do.Addins/src/Do.Universe/FileItem.cs' --- Do.Addins/src/Do.Universe/FileItem.cs 2007-11-17 19:47:16 +0000 +++ Do.Addins/src/Do.Universe/FileItem.cs 2007-12-11 13:08:34 +0000 @@ -24,7 +24,6 @@ namespace Do.Universe { - /// /// FileItem is an item describing a file. FileItem subclasses /// can be created and registered with FileItem for instantiation @@ -32,7 +31,6 @@ /// public class FileItem : IFileItem { - static Hashtable extensionTypes; static FileItem () @@ -116,7 +114,8 @@ /// /// A containing the abbreviated path. /// - public static string ShortUri (string uri) { + public static string ShortUri (string uri) + { string home; uri = (uri == null ? "" : uri); @@ -150,11 +149,13 @@ } } - public virtual string Name { + public virtual string Name + { get { return name; } } - public virtual string Description { + public virtual string Description + { get { string uri_short; @@ -167,18 +168,20 @@ } } - public virtual string Icon { + public virtual string Icon + { get { return icon; } } - public string URI { + public string URI + { get { return uri; } } - public string MimeType { + public string MimeType + { get { return mime_type; } } - } public class DirectoryFileItem : FileItem === modified file 'Do.Addins/src/Do.Universe/FileItemSource.cs' --- Do.Addins/src/Do.Universe/FileItemSource.cs 2007-11-14 01:34:07 +0000 +++ Do.Addins/src/Do.Universe/FileItemSource.cs 2007-12-11 13:09:11 +0000 @@ -75,7 +75,7 @@ parts = line.Trim ().Split (':'); if (parts.Length != 2) continue; dirs.Add (new DirectoryLevelPair (parts[0].Trim (), - int.Parse (parts[1].Trim ()))); + int.Parse (parts[1].Trim ()))); } } catch (Exception e) { Console.Error.WriteLine ("Error reading FileItemSource config file {0}: {1}", kConfigFile, e.Message); @@ -97,7 +97,8 @@ } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (FileItem), }; @@ -117,23 +118,28 @@ UpdateItems (); } - public string Name { + public string Name + { get { return "Directory Scanner"; } } - public string Description { + public string Description + { get { return string.Format("Catalog files in user-specified directories."); } } - public string Icon { + public string Icon + { get { return "folder"; } } - public ICollection Items { + public ICollection Items + { get { return items; } } - public ICollection ChildrenOfItem (IItem item) { + public ICollection ChildrenOfItem (IItem item) + { List children; children = new List (); === modified file 'Do.Addins/src/Do.Universe/FirefoxBookmarkItemSource.cs' --- Do.Addins/src/Do.Universe/FirefoxBookmarkItemSource.cs 2007-11-28 19:08:34 +0000 +++ Do.Addins/src/Do.Universe/FirefoxBookmarkItemSource.cs 2007-12-11 13:09:46 +0000 @@ -29,7 +29,6 @@ { public class FirefoxBookmarkItemSource : IItemSource { - const string BeginProfileName = "Path="; const string BeginDefaultProfile = "Name=default"; const string BeginURL = "
Items { + public ICollection Items + { get { return bookmarks; } } - public ICollection ChildrenOfItem (IItem item) { + public ICollection ChildrenOfItem (IItem item) + { return null; } @@ -128,7 +133,6 @@ path = System.IO.Path.Combine (path, profile); path = System.IO.Path.Combine (path, "bookmarks.html"); return path; - } /// @@ -185,6 +189,5 @@ } return list; } - } } === modified file 'Do.Addins/src/Do.Universe/GNOMESpecialLocationsItemSource.cs' --- Do.Addins/src/Do.Universe/GNOMESpecialLocationsItemSource.cs 2007-12-08 01:32:57 +0000 +++ Do.Addins/src/Do.Universe/GNOMESpecialLocationsItemSource.cs 2007-12-11 13:10:55 +0000 @@ -24,11 +24,8 @@ namespace Do.Universe { - - public class GNOMESpecialLocationsItemSource : IItemSource { - List items; class GNOMEURIItem : IURIItem @@ -50,20 +47,20 @@ class GNOMETrashURIItem : GNOMEURIItem { - static readonly string kTrashDirectory; static GNOMETrashURIItem () { kTrashDirectory = "~/.Trash".Replace ("~", - System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal)); + System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal)); } public GNOMETrashURIItem () : base ("trash://", "Trash", null) { } - override public string Icon { + override public string Icon + { get { if (System.IO.Directory.Exists (kTrashDirectory) && System.IO.Directory.GetFileSystemEntries (kTrashDirectory).Length > 0) { @@ -89,7 +86,8 @@ public string Description { get { return "Special locations in GNOME, such as Computer and Network."; } } public string Icon { get { return "user-home"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (IURIItem), === modified file 'Do.Addins/src/Do.Universe/IItemSource.cs' --- Do.Addins/src/Do.Universe/IItemSource.cs 2007-10-22 01:44:12 +0000 +++ Do.Addins/src/Do.Universe/IItemSource.cs 2007-12-11 13:11:18 +0000 @@ -22,7 +22,6 @@ namespace Do.Universe { - /// /// A source of IItems. /// Example: A "EpiphanyBookmarkItemSource" could provide IItems representing @@ -30,7 +29,6 @@ /// public interface IItemSource : IObject { - /// /// IItem sub-types provided/supported by this source. These include any /// types of items provided by the Items property, and the types of items === modified file 'Do.Addins/src/Do.Universe/ImageFileItem.cs' --- Do.Addins/src/Do.Universe/ImageFileItem.cs 2007-10-22 01:44:12 +0000 +++ Do.Addins/src/Do.Universe/ImageFileItem.cs 2007-12-11 13:11:27 +0000 @@ -52,7 +52,8 @@ /// /// ImageFileItems use their image files as their icons! /// - public override string Icon { + public override string Icon + { get { return URI; } } } === modified file 'Do.Addins/src/Do.Universe/MailtoCommand.cs' --- Do.Addins/src/Do.Universe/MailtoCommand.cs 2007-11-01 18:36:01 +0000 +++ Do.Addins/src/Do.Universe/MailtoCommand.cs 2007-12-11 13:12:02 +0000 @@ -23,23 +23,25 @@ namespace Do.Universe { - - - public class MailtoCommand : ICommand { - - public string Name { + public class MailtoCommand : ICommand + { + public string Name + { get { return "Email"; } } - public string Description { + public string Description + { get { return "Compose a new email to a friend."; } } - public string Icon { + public string Icon + { get { return "email"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (ContactItem), @@ -47,7 +49,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } } === modified file 'Do.Addins/src/Do.Universe/OpenCommand.cs' --- Do.Addins/src/Do.Universe/OpenCommand.cs 2007-11-17 15:59:31 +0000 +++ Do.Addins/src/Do.Universe/OpenCommand.cs 2007-12-11 13:12:23 +0000 @@ -24,30 +24,32 @@ namespace Do.Universe { - /// /// A command providing "open" semantics to many kinds of items. /// public class OpenCommand : ICommand { - public OpenCommand () { } - public string Name { + public string Name + { get { return "Open"; } } - public string Description { + public string Description + { get { return "Opens many kinds of items."; } } - public string Icon { + public string Icon + { get { return "gtk-open"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (IOpenableItem), @@ -56,7 +58,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } @@ -89,6 +92,5 @@ Util.Environment.Open (open_item, out error_message); } } - } } === modified file 'Do.Addins/src/Do.Universe/OpenTerminalHereCommand.cs' --- Do.Addins/src/Do.Universe/OpenTerminalHereCommand.cs 2007-11-11 21:26:23 +0000 +++ Do.Addins/src/Do.Universe/OpenTerminalHereCommand.cs 2007-12-11 13:12:52 +0000 @@ -25,27 +25,29 @@ namespace Do.Universe { - public class OpenTerminalHereCommand : ICommand { - public OpenTerminalHereCommand () { } - public string Name { + public string Name + { get { return "Open Terminal Here"; } } - public string Description { + public string Description + { get { return "Opens a Terminal in a given location."; } } - public string Icon { + public string Icon + { get { return "gnome-terminal"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (FileItem), @@ -53,7 +55,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } @@ -74,14 +77,14 @@ GConf.Client client; Process term; FileItem fi; - string dir, exec; + string dir, exec; client = new GConf.Client(); - try { - exec = client.Get ("/desktop/gnome/applications/terminal/exec") as string; - } catch { - exec = "gnome-terminal"; - } + try { + exec = client.Get ("/desktop/gnome/applications/terminal/exec") as string; + } catch { + exec = "gnome-terminal"; + } fi = items[0] as FileItem; dir = fi.URI; @@ -93,6 +96,5 @@ term.StartInfo.FileName = exec; term.Start (); } - } } === modified file 'Do.Addins/src/Do.Universe/OpenURLCommand.cs' --- Do.Addins/src/Do.Universe/OpenURLCommand.cs 2007-10-30 01:09:11 +0000 +++ Do.Addins/src/Do.Universe/OpenURLCommand.cs 2007-12-11 13:13:19 +0000 @@ -23,10 +23,8 @@ namespace Do.Universe { - public class OpenURLCommand : ICommand { - const string urlPattern = @"(^\w+:\/\/\w+)|(\w+\.\w+)"; Regex urlRegex; @@ -36,19 +34,23 @@ urlRegex = new Regex (urlPattern, RegexOptions.Compiled); } - public string Name { + public string Name + { get { return "Open URL"; } } - public string Description { + public string Description + { get { return "Opens bookmarks and manually-typed URLs."; } } - public string Icon { + public string Icon + { get { return "web-browser"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (IURLItem), @@ -57,13 +59,15 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } } - public bool SupportsItem (IItem item) { + public bool SupportsItem (IItem item) + { if (item is ITextItem) { return urlRegex.IsMatch ((item as ITextItem).Text); } else if (item is IURLItem) { @@ -100,6 +104,5 @@ } } } - } } === modified file 'Do.Addins/src/Do.Universe/RecentFileItemSource.cs' --- Do.Addins/src/Do.Universe/RecentFileItemSource.cs 2007-10-21 21:01:30 +0000 +++ Do.Addins/src/Do.Universe/RecentFileItemSource.cs 2007-12-11 13:13:44 +0000 @@ -23,10 +23,8 @@ namespace Do.Universe { - public class RecentFileItemSource : IItemSource { - List files; public RecentFileItemSource() @@ -42,22 +40,26 @@ ForceUpdateItems (); } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (FileItem), }; } } - public string Name { + public string Name + { get { return "Recent Files"; } } - public string Description { + public string Description + { get { return "Finds recently-opened files."; } } - public string Icon { + public string Icon + { get { return "document"; } } @@ -82,6 +84,5 @@ } */ } - } } === modified file 'Do.Addins/src/Do.Universe/RunCommand.cs' --- Do.Addins/src/Do.Universe/RunCommand.cs 2007-11-05 01:14:58 +0000 +++ Do.Addins/src/Do.Universe/RunCommand.cs 2007-12-11 13:14:07 +0000 @@ -22,23 +22,25 @@ namespace Do.Universe { - public class RunCommand : ICommand { - - public string Name { + public string Name + { get { return "Run"; } } - public string Description { + public string Description + { get { return "Run an application, script, or other executable."; } } - public string Icon { + public string Icon + { get { return "gnome-run"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (IRunnableItem), @@ -46,7 +48,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return null; } } @@ -73,7 +76,5 @@ } } } - - } } === modified file 'Do.Addins/src/Do.Universe/RunInShellCommand.cs' --- Do.Addins/src/Do.Universe/RunInShellCommand.cs 2007-10-21 21:01:30 +0000 +++ Do.Addins/src/Do.Universe/RunInShellCommand.cs 2007-12-11 13:14:31 +0000 @@ -22,13 +22,11 @@ namespace Do.Universe { - /// /// Runs text commands in a shell. /// public class RunInShellCommand : ICommand { - public static bool CommandLineIsFoundOnPath (string command_line) { string path, command, command_file; @@ -63,15 +61,18 @@ return false; } - public string Name { + public string Name + { get { return "Run in Shell"; } } - public string Description { + public string Description + { get { return "Run a command in a shell."; } } - public string Icon { + public string Icon + { get { return "gnome-terminal"; } } @@ -125,8 +126,5 @@ } } } - - } - } === modified file 'Do.Addins/src/Do.Universe/TextItem.cs' --- Do.Addins/src/Do.Universe/TextItem.cs 2007-10-21 21:01:30 +0000 +++ Do.Addins/src/Do.Universe/TextItem.cs 2007-12-11 13:14:46 +0000 @@ -23,13 +23,11 @@ namespace Do.Universe { - /// /// A concrete implementation of the ITextItem interface. /// public class TextItem : ITextItem { - protected string text; public TextItem (string text) @@ -37,22 +35,25 @@ this.text = text; } - public string Name { + public string Name + { get { return text; } } - public string Description { + public string Description + { get { return "Raw input text"; } } - public string Icon { + public string Icon + { get { return "gnome-mime-text"; } } - public string Text { + public string Text + { get { return text; } set { text = value; } } - } } === modified file 'Do.Addins/src/Do.Universe/VoidCommand.cs' --- Do.Addins/src/Do.Universe/VoidCommand.cs 2007-10-21 21:01:30 +0000 +++ Do.Addins/src/Do.Universe/VoidCommand.cs 2007-12-11 13:15:13 +0000 @@ -22,23 +22,25 @@ namespace Do.Universe { - public class VoidCommand : ICommand { - - public string Name { + public string Name + { get { return "Do Nothing"; } } - public string Description { + public string Description + { get { return "Does absolutely nothing."; } } - public string Icon { + public string Icon + { get { return "gtk-stop"; } } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (IItem) @@ -46,7 +48,8 @@ } } - public Type[] SupportedModifierItemTypes { + public Type[] SupportedModifierItemTypes + { get { return new Type[] { typeof (IItem) @@ -56,7 +59,7 @@ public bool SupportsItem (IItem item) { - return true; + return true; } public bool SupportsModifierItemForItems (IItem[] items, IItem modItem) @@ -67,6 +70,5 @@ public void Perform (IItem[] items, IItem[] modifierItems) { } - } } === modified file 'Do.DBus/src/AssemblyInfo.cs' --- Do.DBus/src/AssemblyInfo.cs 2007-11-07 18:34:44 +0000 +++ Do.DBus/src/AssemblyInfo.cs 2007-12-11 13:15:36 +0000 @@ -6,7 +6,6 @@ // // change them to the information which is associated with the assembly // you compile. - [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -22,7 +21,6 @@ // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): - [assembly: AssemblyVersion("1.0.*")] // The following attributes specify the key for the sign of your assembly. See the === modified file 'Do.DBus/src/DBusRegistrar.cs' --- Do.DBus/src/DBusRegistrar.cs 2007-11-07 18:34:44 +0000 +++ Do.DBus/src/DBusRegistrar.cs 2007-12-11 13:15:58 +0000 @@ -24,14 +24,12 @@ namespace Do.DBusLib { - /// /// DBusRegistrar is used for getting DBus-ready classes on and off the /// session bus. /// public class DBusRegistrar { - public static readonly string BusName = "org.gnome.Do"; public static readonly string BaseItemPath = "/org/gnome/Do"; @@ -45,7 +43,6 @@ } } - /// /// Get an instace of T if it exists on the session bus. /// Returns null if there is no such instance. @@ -56,7 +53,8 @@ /// /// A instance if it was found on the bus; null otherwise. /// - public static T GetInstance (string objectPath) { + public static T GetInstance (string objectPath) + { try { if (!Bus.Session.NameHasOwner (BusName)) { return default (T); @@ -82,7 +80,8 @@ /// /// A instance registered on the bus if successful; null otherwise. /// - public static T Register (T busItem, string objectPath) { + public static T Register (T busItem, string objectPath) + { try { Bus.Session.RequestName (BusName); Bus.Session.Register (BusName, new ObjectPath (objectPath), busItem); @@ -116,6 +115,5 @@ { return Register (commander, CommanderItemPath); } - } } === modified file 'Do.DBus/src/ICommander.cs' --- Do.DBus/src/ICommander.cs 2007-11-07 18:34:44 +0000 +++ Do.DBus/src/ICommander.cs 2007-12-11 13:16:04 +0000 @@ -32,5 +32,4 @@ /// void Show (); } - -} \ No newline at end of file +} === modified file 'Do/src/AssemblyInfo.cs' --- Do/src/AssemblyInfo.cs 2007-09-27 00:23:50 +0000 +++ Do/src/AssemblyInfo.cs 2007-12-11 12:54:15 +0000 @@ -11,7 +11,6 @@ // // change them to the information which is associated with the assembly // you compile. - [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -27,7 +26,6 @@ // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): - [assembly: AssemblyVersion("1.0.*")] // The following attributes specify the key for the sign of your assembly. See the === modified file 'Do/src/DefaultCommander.cs' --- Do/src/DefaultCommander.cs 2007-11-23 09:08:37 +0000 +++ Do/src/DefaultCommander.cs 2007-12-11 12:54:37 +0000 @@ -22,11 +22,9 @@ using Do.UI; namespace Do -{ - +{ public class DefaultCommander : Commander { - private Gtk.Window window; public DefaultCommander () === modified file 'Do/src/Do.Core/Commander.cs' --- Do/src/Do.Core/Commander.cs 2007-11-11 01:44:49 +0000 +++ Do/src/Do.Core/Commander.cs 2007-12-11 12:59:24 +0000 @@ -1,4 +1,4 @@ -/* ${FileName} +/* Commander.cs * * GNOME Do is the legal property of its developers. Please refer to the * COPYRIGHT file distributed with this @@ -27,7 +27,6 @@ namespace Do.Core { - public delegate void OnCommanderStateChange (); public delegate void VisibilityChangedHandler (bool visible); @@ -39,8 +38,8 @@ SecondSearchComplete } - public abstract class Commander : ICommander { - + public abstract class Commander : ICommander + { const string kActivateKeybinding = "space"; protected Tomboy.GConfXKeybinder keybinder; @@ -55,7 +54,8 @@ public event VisibilityChangedHandler VisibilityChanged; - public Commander () { + public Commander () + { keybinder = new Tomboy.GConfXKeybinder (); SetSearchingItemsStateEvent = SetSearchingItemsState; @@ -117,16 +117,16 @@ protected virtual void SetupKeybindings () { GConf.Client client; - string binding; + string binding; client = new GConf.Client(); - try { - binding = client.Get ("/apps/gnome-do/preferences/key_binding") as string; - } catch { - binding = kActivateKeybinding; - client.Set ("/apps/gnome-do/preferences/key_binding", binding); - } - keybinder.Bind ("/apps/gnome-do/preferences/key_binding", binding, OnActivate); + try { + binding = client.Get ("/apps/gnome-do/preferences/key_binding") as string; + } catch { + binding = kActivateKeybinding; + client.Set ("/apps/gnome-do/preferences/key_binding", binding); + } + keybinder.Bind ("/apps/gnome-do/preferences/key_binding", binding, OnActivate); } private void OnActivate (object sender, EventArgs args) === modified file 'Do/src/Do.Core/DoCommand.cs' --- Do/src/Do.Core/DoCommand.cs 2007-12-06 14:50:17 +0000 +++ Do/src/Do.Core/DoCommand.cs 2007-12-11 12:59:59 +0000 @@ -25,28 +25,30 @@ namespace Do.Core { - public class DoCommand : DoObject, ICommand { public const string kDefaultCommandIcon = "gnome-run"; - + protected ICommand command; - + public DoCommand (ICommand command): base (command) { this.command = command; } - - public override string Icon { + + public override string Icon + { get { return command.Icon ?? kDefaultCommandIcon; } } - - public Type[] SupportedItemTypes { + + public Type[] SupportedItemTypes + { get { return (command.SupportedItemTypes == null ? new Type[0] : command.SupportedItemTypes); } } - - public Type[] SupportedModifierItemTypes { + + public Type[] SupportedModifierItemTypes + { get { return (command.SupportedModifierItemTypes == null ? new Type[0] : command.SupportedModifierItemTypes); } } @@ -55,7 +57,7 @@ bool type_ok; type_ok = false; - item = EnsureIItem (item); + item = EnsureIItem (item); foreach (Type item_type in SupportedItemTypes) { if (item_type.IsAssignableFrom (item.GetType ())) { type_ok = true; @@ -65,13 +67,13 @@ if (!type_ok) return false; return command.SupportsItem (item); } - + public bool SupportsModifierItemForItems (IItem[] items, IItem modItem) { items = EnsureIItemArray (items); return command.SupportsModifierItemForItems (items, EnsureIItem (modItem)); } - + public void Perform (IItem[] items, IItem[] modItems) { items = EnsureIItemArray (items); @@ -79,7 +81,7 @@ new Thread ((ThreadStart) delegate { Gdk.Threads.Enter (); - + try { InternalItemSource.LastItem.IItem = items[0]; // TODO: Create a command performed event and move this. command.Perform (items, modItems); @@ -89,7 +91,7 @@ Gdk.Threads.Leave (); }).Start (); } - + /// /// Returns the inner item if the static type of given /// item is an DoItem subtype. Returns the argument otherwise. @@ -106,7 +108,7 @@ item = (item as DoItem).IItem; return item; } - + /// /// Like EnsureItem but for arrays of IItems. /// @@ -120,7 +122,7 @@ IItem[] EnsureIItemArray (IItem[] items) { IItem[] inner_items; - + inner_items = items.Clone () as IItem[]; for (int i = 0; i < items.Length; ++i) { if (items[i] is DoItem) { @@ -129,13 +131,13 @@ } return inner_items; } - - public bool AcceptsOnlyText { + + public bool AcceptsOnlyText + { get { return SupportedItemTypes.Length == 1 && typeof (ITextItem).IsAssignableFrom (SupportedItemTypes[0]); } } - } } === modified file 'Do/src/Do.Core/DoItemSource.cs' --- Do/src/Do.Core/DoItemSource.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Core/DoItemSource.cs 2007-12-11 13:00:26 +0000 @@ -37,15 +37,18 @@ enabled = true; } - public IItemSource IItemSource { + public IItemSource IItemSource + { get { return source; } } - public void UpdateItems () { + public void UpdateItems () + { source.UpdateItems (); } - public ICollection Items { + public ICollection Items + { get { List items; @@ -63,7 +66,8 @@ } } - public ICollection ChildrenOfItem (IItem item) { + public ICollection ChildrenOfItem (IItem item) + { ICollection children; List doChildren; @@ -85,7 +89,8 @@ return doChildren; } - public bool Enabled { + public bool Enabled + { get { return enabled; } set { enabled = value; } } === modified file 'Do/src/Do.Core/DoObject.cs' --- Do/src/Do.Core/DoObject.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Core/DoObject.cs 2007-12-11 13:00:52 +0000 @@ -29,7 +29,6 @@ { public abstract class DoObject : IObject { - public const string kDefaultName = "No name"; public const string kDefaultDescription = "No description."; public const string kDefaultIcon = "empty"; @@ -66,19 +65,23 @@ this.inner = inner; } - public virtual string Name { + public virtual string Name + { get { return inner.Name ?? kDefaultName; } } - public virtual string Description { + public virtual string Description + { get { return inner.Description ?? kDefaultDescription; } } - public virtual string Icon { + public virtual string Icon + { get { return inner.Icon ?? kDefaultIcon; } } - public string UID { + public string UID + { get { return string.Format ("{0}___{1}___{2}", inner.GetType (), Name, Description); } @@ -89,7 +92,8 @@ return UID.GetHashCode (); } - public int Score { + public int Score + { get { return _score; } set { _score = value; } } @@ -112,7 +116,8 @@ } } - public class DoObjectScoreComparer : IComparer { + public class DoObjectScoreComparer : IComparer + { public int Compare (IObject x, IObject y) { float xscore, yscore; @@ -128,6 +133,5 @@ else return xscore > yscore ? -1 : 1; } - } } === modified file 'Do/src/Do.Core/RelevanceSorter.cs' --- Do/src/Do.Core/RelevanceSorter.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Core/RelevanceSorter.cs 2007-12-11 13:01:02 +0000 @@ -36,13 +36,15 @@ this.searchString = searchString; } - public int Compare (IObject x, IObject y) { + public int Compare (IObject x, IObject y) + { int xScore = (x as DoObject).Score = (x as DoObject).ScoreForAbbreviation (searchString); int yScore = (y as DoObject).Score = (y as DoObject).ScoreForAbbreviation (searchString); return (xScore - yScore); } - public List NarrowResults (List broadResults) { + public List NarrowResults (List broadResults) + { List results = new List (); //First throw out the non-zero items, there's no point wasting sorting time on them === modified file 'Do/src/Do.Core/SearchContext.cs' --- Do/src/Do.Core/SearchContext.cs 2007-12-04 01:07:40 +0000 +++ Do/src/Do.Core/SearchContext.cs 2007-12-11 13:02:06 +0000 @@ -25,7 +25,6 @@ namespace Do.Core { - public class SearchContext { const int MOD_ITEMS = 1; @@ -57,7 +56,8 @@ } } - public void Build () { + public void Build () + { SearchTypes = new Type[0]; flag = 0; items = new List (); @@ -69,7 +69,8 @@ query = ""; } - public SearchContext Clone () { + public SearchContext Clone () + { SearchContext clonedContext = new SearchContext (); clonedContext.Command = command; clonedContext.Items = items; @@ -85,7 +86,8 @@ return clonedContext; } - public SearchContext LastContext { + public SearchContext LastContext + { get { return lastContext; } @@ -94,7 +96,8 @@ } } - public SearchContext ParentContext { + public SearchContext ParentContext + { get { return parentContext; } @@ -103,7 +106,8 @@ } } - public List Items { + public List Items + { get { return items; } @@ -112,7 +116,8 @@ } } - public List ModifierItems { + public List ModifierItems + { get { return modifierItems; } @@ -121,7 +126,8 @@ } } - public DoCommand Command { + public DoCommand Command + { get { return command; } @@ -130,7 +136,8 @@ } } - public string Query { + public string Query + { get { return query; } @@ -139,7 +146,8 @@ } } - public IObject[] Results { + public IObject[] Results + { get { return results; } @@ -156,7 +164,8 @@ //This returns an array of the inner items, based on the list of DoItems //This is necessary because SearchContext stores its items as DoItems, but sometimes //methods like ActivateCommand want the IItems associated with DoItems - public IItem[] IItems { + public IItem[] IItems + { get { IItem[] returnItems = new IItem [items.Count]; int i = 0; @@ -168,7 +177,8 @@ } } - public IItem[] ModIItems { + public IItem[] ModIItems + { get { IItem[] returnItems = new IItem [modifierItems.Count]; int i = 0; @@ -180,7 +190,8 @@ } } - public bool Equivalent (SearchContext test) { + public bool Equivalent (SearchContext test) + { //If its null, return false right away so a null exception isn't thrown if (test == null) return false; @@ -239,7 +250,8 @@ } } - public bool ModItemsSearch { + public bool ModItemsSearch + { get { return ((flag & MOD_ITEMS) == MOD_ITEMS); } @@ -251,7 +263,8 @@ } } - public bool FindingChildren { + public bool FindingChildren + { get { return ((flag & GET_CHILDREN) == GET_CHILDREN); } @@ -263,7 +276,8 @@ } } - public bool FindingParent { + public bool FindingParent + { get { return ((flag & GET_PARENT) == GET_PARENT); } @@ -275,7 +289,8 @@ } } - public bool Independent { + public bool Independent + { get { return (!(CommandSearch || ItemsSearch || ModItemsSearch)); } @@ -288,7 +303,8 @@ command = null; } - public IObject GenericObject { + public IObject GenericObject + { set { if (value is DoItem) { Items = new List (); @@ -300,7 +316,8 @@ } } - public Type[] SearchTypes { + public Type[] SearchTypes + { get { return searchTypes; } @@ -309,7 +326,8 @@ } } - public IObject ParentObject { + public IObject ParentObject + { get { return parentObject; } @@ -318,7 +336,8 @@ } } - public int Cursor { + public int Cursor + { get { return cursor; } @@ -327,13 +346,15 @@ } } - public SearchContext EquivalentPreviousContextIfExists () { + public SearchContext EquivalentPreviousContextIfExists () + { if (Equivalent (LastContext.LastContext)) return LastContext.LastContext; return null; } - public SearchContext GetContinuedContext () { + public SearchContext GetContinuedContext () + { SearchContext clone; clone = Clone (); clone.LastContext = this; === modified file 'Do/src/Do.Core/UniverseManager.cs' --- Do/src/Do.Core/UniverseManager.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Core/UniverseManager.cs 2007-12-11 13:03:21 +0000 @@ -53,7 +53,8 @@ firstResultsMutex = new Mutex (); } - internal void Initialize () { + internal void Initialize () + { LoadBuiltins (); LoadAddins (); universeMutex.WaitOne (); @@ -68,15 +69,18 @@ //indexThread.Start (); } - internal ICollection ItemSources { + internal ICollection ItemSources + { get { return doItemSources.AsReadOnly (); } } - public void KillIndexThread () { + public void KillIndexThread () + { indexThread.Abort (); } - public void AwakeIndexThread () { + public void AwakeIndexThread () + { Monitor.Enter (indexThread); Monitor.Pulse (indexThread); Monitor.Exit (indexThread); @@ -125,7 +129,7 @@ addin_dirs = new List (); addin_dirs.Add ("~/.do/addins".Replace ("~", - Environment.GetFolderPath (Environment.SpecialFolder.Personal))); + Environment.GetFolderPath (Environment.SpecialFolder.Personal))); foreach (string addin_dir in addin_dirs) { string[] files; @@ -197,7 +201,8 @@ } } - private void BuildUniverse (Dictionary newUniverse) { + private void BuildUniverse (Dictionary newUniverse) + { // Hash commands. foreach (DoCommand command in doCommands) { newUniverse[command.UID.GetHashCode ()] = command; @@ -211,7 +216,8 @@ } } - public SearchContext Search (SearchContext context) { + public SearchContext Search (SearchContext context) + { universeMutex.WaitOne (); firstResultsMutex.WaitOne (); @@ -258,7 +264,8 @@ return context.GetContinuedContext (); } - private SearchContext ParentContext (SearchContext context) { + private SearchContext ParentContext (SearchContext context) + { //Since we are dealing with the parent, turn off the finding parent //flag context.FindingParent = false; @@ -271,7 +278,8 @@ return context; } - private SearchContext ChildContext (SearchContext context) { + private SearchContext ChildContext (SearchContext context) + { IItem[] childItems = new IItem[0]; SearchContext newContext; context.FindingChildren = false; @@ -299,7 +307,8 @@ return newContext.GetContinuedContext (); } - private List DependentResults (SearchContext context) { + private List DependentResults (SearchContext context) + { List results; string query = context.Query.ToLower (); @@ -327,7 +336,8 @@ return results; } - private List InitialDependentResults (SearchContext context) { + private List InitialDependentResults (SearchContext context) + { List results; if (context.ModItemsSearch) @@ -343,7 +353,8 @@ return results; } - private List AddNonUniverseItems (SearchContext context) { + private List AddNonUniverseItems (SearchContext context) + { List results = new List (); //If we're on modifier items, add a text item if its supported @@ -369,7 +380,8 @@ } //This generates a list of modifier items supported by the context in a given initial list - public List GetModItemsFromList (SearchContext context, List initialList) { + public List GetModItemsFromList (SearchContext context, List initialList) + { int itemCount = 0; List results = new List (); @@ -393,7 +405,8 @@ } //Same as GetModItemsFrom list but for items - public List GetItemsFromList (SearchContext context, List initialList) { + public List GetItemsFromList (SearchContext context, List initialList) + { int itemCount = 0; List results = new List (); foreach (IObject iobject in initialList) { @@ -411,7 +424,8 @@ } //This will filter out the results in the previous context that match the current query - private List FilterPreviousList (SearchContext context) { + private List FilterPreviousList (SearchContext context) + { string query = context.Query.ToLower (); RelevanceSorter comparer; List results; @@ -422,7 +436,8 @@ } - private List IndependentResults (SearchContext context) { + private List IndependentResults (SearchContext context) + { string query; RelevanceSorter comparer; List results; @@ -451,7 +466,8 @@ } //This method gives us all the commands that are supported by all the items in the list - private List InitialCommandResults (SearchContext context) { + private List InitialCommandResults (SearchContext context) + { List results = new List (); bool initial = true; @@ -479,9 +495,9 @@ return results; } - //Function to determine whether a type array contains a type - static public bool ContainsType (Type[] typeArray, Type checkType) { + static public bool ContainsType (Type[] typeArray, Type checkType) + { foreach (Type type in typeArray) { if (type.Equals (checkType)) return true; === modified file 'Do/src/Do.UI/IconBox.cs' --- Do/src/Do.UI/IconBox.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.UI/IconBox.cs 2007-12-11 12:53:10 +0000 @@ -26,110 +26,115 @@ namespace Do.UI { - public class IconBox : RoundedFrame { const string captionFormat = "{0}"; const string highlightFormat = "{0}"; - + protected bool isFocused; - + protected string caption; protected Pixbuf pixbuf, emptyPixbuf; protected int iconSize; - + protected VBox vbox; protected Gtk.Image image; protected Label label; - + protected double focusedTransparency = 0.4; protected double unfocusedTransparency = 0.1; - + public IconBox (int iconSize) : base () { this.iconSize = iconSize; Build (); } - + protected virtual void Build () { caption = ""; pixbuf = emptyPixbuf; - + vbox = new VBox (false, 8); vbox.BorderWidth = 10; Add (vbox); vbox.Show (); - + emptyPixbuf = new Pixbuf (Colorspace.Rgb, true, 8, iconSize, iconSize); emptyPixbuf.Fill (uint.MinValue); - + image = new Gtk.Image (); vbox.PackStart (image, false, false, 0); image.Show (); - + label = new Label (); label.Ellipsize = Pango.EllipsizeMode.End; label.ModifyFg (StateType.Normal, Style.White); vbox.PackStart (label, false, false, 0); label.Show (); - + image.SetSizeRequest (iconSize, iconSize); label.SetSizeRequest (iconSize / 4 * 5, -1); // SetSizeRequest (iconSize * 2, iconSize * 2); - + DrawFrame = false; DrawFill = true; FillColor = new Color (byte.MaxValue, byte.MaxValue, byte.MaxValue); - + Realized += OnRealized; UpdateFocus (); } - - public virtual void Clear () { + + public virtual void Clear () + { Pixbuf = emptyPixbuf; Caption = ""; } - + protected virtual void OnRealized (object o, EventArgs args) { UpdateFocus (); } - - public bool IsFocused { + + public bool IsFocused + { get { return isFocused; } set { isFocused = value; UpdateFocus (); } } - - public string Caption { + + public string Caption + { get { return caption; } set { caption = value ?? ""; - label.Markup = string.Format (captionFormat, Util.Appearance.MarkupSafeString (caption)); + label.Markup = string.Format (captionFormat, Util.Appearance.MarkupSafeString (caption)); } } - - public string Icon { + + public string Icon + { set { Pixbuf = Util.Appearance.PixbufFromIconName (value, iconSize); } } - - public Pixbuf Pixbuf { + + public Pixbuf Pixbuf + { get { return pixbuf; } set { pixbuf = value ?? emptyPixbuf; image.Pixbuf = pixbuf; } } - - public IObject DisplayObject { + + public IObject DisplayObject + { set { string name, icon; - + icon = null; name = null; if (value != null) { @@ -140,11 +145,12 @@ Caption = name; } } - - public string Highlight { + + public string Highlight + { set { string highlight; - + if (value != null) { highlight = Util.FormatCommonSubstrings (caption, value, highlightFormat); } else { @@ -153,11 +159,11 @@ Caption = highlight; } } - + protected virtual void UpdateFocus () { FrameAlpha = FillAlpha = (isFocused ? focusedTransparency : unfocusedTransparency); } - + } } === modified file 'Do/src/Do.UI/MainMenu.cs' --- Do/src/Do.UI/MainMenu.cs 2007-11-27 05:43:49 +0000 +++ Do/src/Do.UI/MainMenu.cs 2007-12-11 12:52:29 +0000 @@ -24,17 +24,17 @@ namespace Do.UI { - - public class MainMenu { static MainMenu instance; static MainMenu () { + // Nothing } - public static MainMenu Instance { + public static MainMenu Instance + { get { if (instance == null) { instance = new MainMenu (); @@ -84,7 +84,6 @@ menu.ShowAll(); } - protected void OnMainMenuQuitClicked (object o, EventArgs args) { Application.Quit(); @@ -134,6 +133,5 @@ y = mainMenuY; push_in = true; } - } } === modified file 'Do/src/Do.UI/ResultsWindow.cs' --- Do/src/Do.UI/ResultsWindow.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.UI/ResultsWindow.cs 2007-12-11 12:47:05 +0000 @@ -41,11 +41,13 @@ this.selection = selection; } - public int SelectedIndex { + public int SelectedIndex + { get { return index; } } - public IObject SelectedObject { + public IObject SelectedObject + { get { return selection; } @@ -54,7 +56,6 @@ public class ResultsWindow : Gtk.Window { - const int ResultIconSize = 32; const int NumberResultsDisplayed = 6; const string ResultInfoFormat = "{0}\n{1}"; @@ -194,7 +195,8 @@ results = null; } - public int SelectedIndex { + public int SelectedIndex + { get { return selectedIndex; } set { TreeModel model; @@ -232,7 +234,8 @@ } } - public IObject SelectedObject { + public IObject SelectedObject + { get { if (results != null && 0 <= selectedIndex && selectedIndex < results.Length) { return results[selectedIndex]; @@ -242,7 +245,8 @@ } } - public IObject[] Results { + public IObject[] Results + { get { return results; } set { ListStore store; === modified file 'Do/src/Do.UI/RoundedFrame.cs' --- Do/src/Do.UI/RoundedFrame.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.UI/RoundedFrame.cs 2007-12-11 12:51:37 +0000 @@ -25,10 +25,8 @@ namespace Do.UI { - public class RoundedFrame : Bin { - Rectangle childAlloc; double radius; @@ -50,7 +48,8 @@ fillColor = frameColor = new Color (0, 0, 0); } - public double Radius { + public double Radius + { get { return radius; } set { radius = value; @@ -58,7 +57,8 @@ } } - public bool DrawFrame { + public bool DrawFrame + { get { return drawFrame; } set { drawFrame = value; @@ -66,7 +66,8 @@ } } - public Color FrameColor { + public Color FrameColor + { get { return frameColor; } set { fillColor = new Color ((byte)value.Red, (byte)value.Green, (byte)value.Blue); @@ -74,7 +75,8 @@ } } - public double FrameAlpha { + public double FrameAlpha + { get { return frameAlpha; } set { frameAlpha = value; @@ -82,7 +84,8 @@ } } - public bool DrawFill { + public bool DrawFill + { get { return fill; } set { fill = value; @@ -90,7 +93,8 @@ } } - public Color FillColor { + public Color FillColor + { get { return fillColor; } set { fillColor = new Color ((byte)value.Red, (byte)value.Green, (byte)value.Blue); @@ -98,7 +102,8 @@ } } - public double FillAlpha { + public double FillAlpha + { get { return fillAlpha; } set { fillAlpha = value; === modified file 'Do/src/Do.UI/SymbolDisplayLabel.cs' --- Do/src/Do.UI/SymbolDisplayLabel.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.UI/SymbolDisplayLabel.cs 2007-12-11 12:53:27 +0000 @@ -52,7 +52,8 @@ ModifyFg (StateType.Normal, Style.White); } - public IObject DisplayObject { + public IObject DisplayObject + { set { IObject displayObject; @@ -66,14 +67,16 @@ } } - public void SetDisplayLabel (string name, string description) { + public void SetDisplayLabel (string name, string description) + { this.name = name ?? ""; this.description = description ?? ""; highlight = ""; UpdateText (); } - public string Highlight { + public string Highlight + { get { return highlight; } set { highlight = value ?? ""; === modified file 'Do/src/Do.UI/SymbolWindow.cs' --- Do/src/Do.UI/SymbolWindow.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.UI/SymbolWindow.cs 2007-12-11 12:50:53 +0000 @@ -31,17 +31,17 @@ namespace Do.UI { - public class SymbolWindow : Gtk.Window { - class DefaultIconBoxObject : IObject { + class DefaultIconBoxObject : IObject + { public string Icon { get { return "gtk-find"; } } public string Name { get { return ""; } } public string Description { get { return ""; } } } - class NoResultsFoundObject : IObject { - + class NoResultsFoundObject : IObject + { string query; public NoResultsFoundObject (string query) @@ -52,7 +52,8 @@ public string Icon { get { return "gtk-dialog-question"; } } public string Name { get { return "No results found."; } } - public string Description { + public string Description + { get { return string.Format ("No results found for \"{0}\".", query); } @@ -94,7 +95,8 @@ SetDefaultState (); } - IObject GetCurrentObject (Pane pane) { + IObject GetCurrentObject (Pane pane) + { IObject o; try { @@ -105,7 +107,8 @@ return o; } - Pane CurrentPane { + Pane CurrentPane + { get { return currentPane; } @@ -115,7 +118,8 @@ } } - SearchContext CurrentContext { + SearchContext CurrentContext + { get { return context[(int) currentPane]; } @@ -126,7 +130,8 @@ IconBox CurrentIconBox { get { return iconbox[(int) currentPane]; } } - int CurrentCursor { + int CurrentCursor + { get { return context[(int) currentPane].Cursor; } @@ -217,11 +222,12 @@ public void Reposition () { int monitor; - int extraGap = 1; // why 1? something is wrong with math rounding? + int extraGap = IconBoxRadius-(IconBoxPadding*2); Gdk.Rectangle geo, main, results; - if (currentPane == Pane.First) - extraGap = IconBoxRadius-(IconBoxPadding*2); // Add an additional gap on the first pane + // Do special things for the first Pane + // if (currentPane == Pane.First) + // extraGap = IconBoxRadius-(IconBoxPadding*2); GetPosition (out main.X, out main.Y); GetSize (out main.Width, out main.Height); @@ -592,7 +598,7 @@ iconbox[2] = new IconBox (IconBoxIconSize); iconbox[2].IsFocused = false; iconbox[2].Radius = IconBoxRadius; -// resultsHBox.PackStart (iconbox[2], false, false, 0); + // resultsHBox.PackStart (iconbox[2], false, false, 0); iconbox[2].Show (); align = new Alignment (0.5F, 0.5F, 1, 1); @@ -632,7 +638,5 @@ } return base.OnExposeEvent (evnt); } - } - } === modified file 'Do/src/Do.Universe/InternalItemSource.cs' --- Do/src/Do.Universe/InternalItemSource.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Universe/InternalItemSource.cs 2007-12-11 13:04:15 +0000 @@ -38,22 +38,26 @@ items.Add (LastItem); } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { }; } } - public string Name { + public string Name + { get { return "Internal GNOME Do Items"; } } - public string Description { + public string Description + { get { return "Special items relevant to the inner-workings of GNOME Do."; } } - public string Icon { + public string Icon + { get { return "gnome-system"; } } @@ -62,11 +66,13 @@ { } - public ICollection Items { + public ICollection Items + { get { return items; } } - public ICollection ChildrenOfItem (IItem item) { + public ICollection ChildrenOfItem (IItem item) + { return null; } } === modified file 'Do/src/Do.Universe/ItemSourceItemSource.cs' --- Do/src/Do.Universe/ItemSourceItemSource.cs 2007-12-11 04:04:00 +0000 +++ Do/src/Do.Universe/ItemSourceItemSource.cs 2007-12-11 13:04:35 +0000 @@ -30,7 +30,8 @@ { } - public Type[] SupportedItemTypes { + public Type[] SupportedItemTypes + { get { return new Type[] { typeof (DoItemSource), @@ -39,15 +40,18 @@ } } - public string Name { + public string Name + { get { return "GNOME Do Item Sources"; } } - public string Description { + public string Description + { get { return "Item Sources providing all items GNOME Do knows about."; } } - public string Icon { + public string Icon + { get { return "gnome-run"; } } @@ -55,11 +59,13 @@ { } - public ICollection Items { + public ICollection Items + { get { return null; } } - public ICollection ChildrenOfItem (IItem item) { + public ICollection ChildrenOfItem (IItem item) + { List children; bool parent_is_this; === modified file 'Do/src/Do.cs' --- Do/src/Do.cs 2007-12-08 01:32:57 +0000 +++ Do/src/Do.cs 2007-12-11 12:46:00 +0000 @@ -24,60 +24,61 @@ namespace Do { - - public class Do { - + public class Do + { static Commander commander; static UniverseManager universeManager; - - public static void Main (string[] args) { - DetectInstanceAndExit (); + public static void Main (string[] args) + { + DetectInstanceAndExit (); Gtk.Application.Init (); Log.Initialize (); Util.Initialize (); - + Gdk.Threads.Init (); - + try { Util.SetProcessName ("gnome-do"); } catch (Exception e) { Log.Error ("Failed to set process name: {0}", e.Message); } - + universeManager = new UniverseManager (); universeManager.Initialize (); - - commander = new DefaultCommander (); - DBusRegistrar.RegisterCommander (commander); + + commander = new DefaultCommander (); + DBusRegistrar.RegisterCommander (commander); // Temporary quiet start feature. bool quiet_start = false; foreach (string arg in args) quiet_start |= (arg == "--quiet"); - + if (!quiet_start) commander.Show (); - + Gtk.Application.Run (); - } + } static void DetectInstanceAndExit () { - ICommander dbus_commander; + ICommander dbus_commander; dbus_commander = DBusRegistrar.GetCommanderInstance (); if (dbus_commander != null) { dbus_commander.Show (); System.Environment.Exit (0); } } - - public static Commander Commander { + + public static Commander Commander + { get { return commander; } } - - public static UniverseManager UniverseManager { + + public static UniverseManager UniverseManager + { get { return universeManager; } } } === modified file 'Do/src/TrayLib.cs' --- Do/src/TrayLib.cs 2007-10-20 22:32:05 +0000 +++ Do/src/TrayLib.cs 2007-12-11 12:55:52 +0000 @@ -2,24 +2,24 @@ using System; using System.Runtime.InteropServices; - + using Gtk; using Gdk; - + namespace Egg { public class TrayIcon : Plug { int stamp; Orientation orientation; - + int selection_atom; int manager_atom; int system_tray_opcode_atom; int orientation_atom; IntPtr manager_window; FilterFunc filter; - + public TrayIcon (string name) { Title = name; @@ -28,7 +28,7 @@ AddEvents ((int)EventMask.PropertyChangeMask); filter = new FilterFunc (ManagerFilter); } - + protected override void OnRealized () { base.OnRealized (); @@ -41,7 +41,7 @@ UpdateManagerWindow (); //Screen.RootWindow.AddFilter (filter); } - + protected override void OnUnrealized () { if (manager_window != IntPtr.Zero) @@ -49,11 +49,11 @@ Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window); //gdkwin.RemoveFilter (filter); } - + //Screen.RootWindow.RemoveFilter (filter); base.OnUnrealized (); } - + private void UpdateManagerWindow () { IntPtr xdisplay = gdk_x11_display_get_xdisplay (Display.Handle); @@ -62,15 +62,15 @@ Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window); //gdkwin.RemoveFilter (filter); } - + XGrabServer (xdisplay); - + manager_window = XGetSelectionOwner (xdisplay, selection_atom); if (manager_window != IntPtr.Zero) XSelectInput (xdisplay, manager_window, EventMask.StructureNotifyMask | EventMask.PropertyChangeMask); XUngrabServer (xdisplay); XFlush (xdisplay); - + if (manager_window != IntPtr.Zero) { Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window); //gdkwin.AddFilter (filter); @@ -78,17 +78,17 @@ GetOrientationProperty (); } } - + private void SendDockRequest () { SendManagerMessage (SystemTrayMessage.RequestDock, manager_window, Id, 0, 0); } - + private void SendManagerMessage (SystemTrayMessage message, IntPtr window, uint data1, uint data2, uint data3) { XClientMessageEvent ev = new XClientMessageEvent (); IntPtr display; - + ev.type = XEventName.ClientMessage; ev.window = window; ev.message_type = (IntPtr)system_tray_opcode_atom; @@ -98,24 +98,24 @@ ev.ptr3 = (IntPtr)data1; ev.ptr4 = (IntPtr)data2; ev.ptr5 = (IntPtr)data3; - + display = gdk_x11_display_get_xdisplay (Display.Handle); gdk_error_trap_push (); XSendEvent (display, manager_window, false, EventMask.NoEventMask, ref ev); gdk_error_trap_pop (); } - + private FilterReturn ManagerFilter (IntPtr xevent, Event evnt) { //TODO: Implement; return FilterReturn.Continue; } - + private void GetOrientationProperty () { //TODO: Implement; } - + [DllImport ("gdk-x11-2.0.so.0")] static extern IntPtr gdk_x11_display_get_xdisplay (IntPtr display); [DllImport ("gdk-x11-2.0.so.0")] @@ -124,7 +124,7 @@ static extern void gdk_error_trap_push (); [DllImport ("gdk-x11-2.0.so.0")] static extern void gdk_error_trap_pop (); - + [DllImport ("libX11", EntryPoint="XInternAtom")] extern static int XInternAtom(IntPtr display, string atom_name, bool only_if_exists); [DllImport ("libX11")] @@ -140,7 +140,7 @@ [DllImport ("libX11", EntryPoint="XSendEvent")] extern static int XSendEvent(IntPtr display, IntPtr window, bool propagate, EventMask event_mask, ref XClientMessageEvent send_event); } - + [Flags] internal enum EventMask { NoEventMask = 0, @@ -163,27 +163,27 @@ VisibilityChangeMask = 1<<16, StructureNotifyMask = 1<<17, ResizeRedirectMask = 1<<18, - SubstructureNotifyMask = 1<<19, + SubstructureNotifyMask = 1<<19, SubstructureRedirectMask= 1<<20, FocusChangeMask = 1<<21, PropertyChangeMask = 1<<22, ColormapChangeMask = 1<<23, OwnerGrabButtonMask = 1<<24 } - + internal enum SystemTrayMessage { RequestDock, BeginMessage, CancelMessage } - + internal enum SystemTrayOrientation { Horz, Vert } - + [StructLayout(LayoutKind.Sequential)] internal struct XClientMessageEvent { internal XEventName type; @@ -199,7 +199,7 @@ internal IntPtr ptr4; internal IntPtr ptr5; } - + internal enum XEventName { KeyPress = 2, KeyRelease = 3, @@ -235,7 +235,7 @@ ClientMessage = 33, MappingNotify = 34, TimerNotify = 100, - + LASTEvent } -} \ No newline at end of file +} === modified file 'Do/src/XKeybinder.cs' --- Do/src/XKeybinder.cs 2007-12-02 23:53:14 +0000 +++ Do/src/XKeybinder.cs 2007-12-11 12:57:55 +0000 @@ -16,12 +16,10 @@ static extern void tomboy_keybinder_init (); [DllImport("libtomboy")] - static extern void tomboy_keybinder_bind (string keystring, - BindkeyHandler handler); + static extern void tomboy_keybinder_bind (string keystring, BindkeyHandler handler); [DllImport("libtomboy")] - static extern void tomboy_keybinder_unbind (string keystring, - BindkeyHandler handler); + static extern void tomboy_keybinder_unbind (string keystring, BindkeyHandler handler); public delegate void BindkeyHandler (string key, IntPtr user_data); @@ -55,8 +53,7 @@ } } - public void Bind (string keystring, - EventHandler handler) + public void Bind (string keystring, EventHandler handler) { Binding bind = new Binding (); bind.keystring = keystring; @@ -70,8 +67,7 @@ { foreach (Binding bind in bindings) { if (bind.keystring == keystring) { - tomboy_keybinder_unbind (bind.keystring, - key_handler); + tomboy_keybinder_unbind (bind.keystring, key_handler); bindings.Remove (bind); break; @@ -101,14 +97,14 @@ } public void Bind (string gconf_path, - string default_binding, - EventHandler handler) + string default_binding, + EventHandler handler) { try { Binding binding = new Binding (gconf_path, - default_binding, - handler, - this); + default_binding, + handler, + this); bindings.Add (binding); } catch (Exception e){ Log.Error ("Could not add global keybinding: {0}", e.Message); @@ -133,9 +129,9 @@ GConfXKeybinder parent; public Binding (string gconf_path, - string default_binding, - EventHandler handler, - GConfXKeybinder parent) + string default_binding, + EventHandler handler, + GConfXKeybinder parent) { this.gconf_path = gconf_path; this.key_sequence = default_binding; @@ -175,9 +171,9 @@ return; Log.Info ("Binding key '{0}' for '{1}'." + - " You may change this keybinding with" + - " Configuration Editor (gconf-editor).", - key_sequence, gconf_path); + " You may change this keybinding with" + + " Configuration Editor (gconf-editor).", + key_sequence, gconf_path); parent.Bind (key_sequence, handler); } @@ -188,8 +184,8 @@ return; Log.Info ("Unbinding key '{0}' for '{1}'", - key_sequence, - gconf_path); + key_sequence, + gconf_path); parent.Unbind (key_sequence); }