tomboy r1815 - in trunk: . Tomboy Tomboy/Notebooks



Author: kkubasik
Date: Mon Jan 28 22:53:58 2008
New Revision: 1815
URL: http://svn.gnome.org/viewvc/tomboy?rev=1815&view=rev

Log:
* Tomboy/Notebooks/NotebookApplicationAddin.cs,
  Tomboy/ActionManager.cs: Load our placeholder icons.

Modified:
   trunk/ChangeLog
   trunk/Tomboy/ActionManager.cs
   trunk/Tomboy/Notebooks/NotebookApplicationAddin.cs

Modified: trunk/Tomboy/ActionManager.cs
==============================================================================
--- trunk/Tomboy/ActionManager.cs	(original)
+++ trunk/Tomboy/ActionManager.cs	Mon Jan 28 22:53:58 2008
@@ -46,15 +46,34 @@
 		private Gtk.ActionGroup main_window_actions =
 		        new Gtk.ActionGroup ("MainWindow");
 
+		public static Gdk.Pixbuf newNote;
 		public ActionManager ()
 		{
 			PopulateActionGroups ();
+			newNote  = GuiUtils.GetIcon("tomboy-new-note",22);
 		}
 
 		public void LoadInterface ()
 		{
 			ui.AddUiFromResource ("UIManagerLayout.xml");
 			Gtk.Window.DefaultIconName = "tomboy";
+			Gtk.ImageMenuItem imageitem = Tomboy.ActionManager.GetWidget (
+				"/MainWindowMenubar/FileMenu/FileMenuNewNotePlaceholder/NewNote") as Gtk.ImageMenuItem;
+			if (imageitem != null) {
+				if (imageitem is Gtk.ImageMenuItem) {
+					Gtk.ImageMenuItem imageItem = imageitem as Gtk.ImageMenuItem;
+					(imageItem.Image as Gtk.Image).Pixbuf = newNote;
+				}
+			}
+			
+			imageitem = Tomboy.ActionManager.GetWidget (
+				"/TrayIconMenu/TrayNewNotePlaceholder/TrayNewNote") as Gtk.ImageMenuItem;
+			if (imageitem != null) {
+				if (imageitem is Gtk.ImageMenuItem) {
+					Gtk.ImageMenuItem imageItem = imageitem as Gtk.ImageMenuItem;
+					(imageItem.Image as Gtk.Image).Pixbuf = newNote;
+				}
+			}
 		}
 		
 		/// <summary>
@@ -165,6 +184,8 @@
 			main_window_actions.GetAction ("DeleteNoteAction").Sensitive = false;
 
 			ui.InsertActionGroup (main_window_actions, 0);
+				
+			
 		}
 
 		public Gtk.Action FindActionByName (string action_name)

Modified: trunk/Tomboy/Notebooks/NotebookApplicationAddin.cs
==============================================================================
--- trunk/Tomboy/Notebooks/NotebookApplicationAddin.cs	(original)
+++ trunk/Tomboy/Notebooks/NotebookApplicationAddin.cs	Mon Jan 28 22:53:58 2008
@@ -11,11 +11,12 @@
 		static uint notebookUi = 0;
 		static Gdk.Pixbuf notebookIcon;
 		static Gdk.Pixbuf newNotebookIcon;
-
+		
 		static NotebookApplicationAddin ()
 		{
 			notebookIcon = GuiUtils.GetIcon ("tomboy-notebook", 22);
 			newNotebookIcon = GuiUtils.GetIcon ("tomboy-new-notebook", 22);
+			
 		}
 
 		bool initialized;
@@ -90,8 +91,8 @@
 			
 			Tomboy.ActionManager.UI.InsertActionGroup (actionGroup, 0);
 			
-			Gtk.MenuItem item = Tomboy.ActionManager.GetWidget (
-				"/TrayIconMenu/TrayNewNotePlaceholder/TrayNewNotebookMenu") as Gtk.MenuItem;
+			Gtk.ImageMenuItem item = Tomboy.ActionManager.GetWidget (
+				"/TrayIconMenu/TrayNewNotePlaceholder/TrayNewNotebookMenu") as Gtk.ImageMenuItem;
 			if (item != null) {
 				if (item is Gtk.ImageMenuItem) {
 					Gtk.ImageMenuItem imageItem = item as Gtk.ImageMenuItem;
@@ -99,19 +100,32 @@
 				}
 				trayNotebookMenu = new Gtk.Menu ();
 				item.Submenu = trayNotebookMenu;
+				
 				trayNotebookMenu.Shown += OnTrayNotebookMenuShown;
 				trayNotebookMenu.Hidden += OnTrayNotebookMenuHidden;
 			}
 			
-			item = Tomboy.ActionManager.GetWidget (
-				"/MainWindowMenubar/FileMenu/FileMenuNewNotePlaceholder/NewNotebookMenu") as Gtk.MenuItem;
-			if (item != null) {
+			Gtk.ImageMenuItem imageitem = Tomboy.ActionManager.GetWidget (
+				"/MainWindowMenubar/FileMenu/FileMenuNewNotePlaceholder/NewNotebookMenu") as Gtk.ImageMenuItem;
+			if (imageitem != null) {
+				if (imageitem is Gtk.ImageMenuItem) {
+					Gtk.ImageMenuItem imageItem = imageitem as Gtk.ImageMenuItem;
+					(imageItem.Image as Gtk.Image).Pixbuf = newNotebookIcon;
+				}
 				mainWindowNotebookMenu = new Gtk.Menu ();
-				item.Submenu = mainWindowNotebookMenu;
+				imageitem.Submenu = mainWindowNotebookMenu;
+				
 				mainWindowNotebookMenu.Shown += OnNewNotebookMenuShown;
 				mainWindowNotebookMenu.Hidden += OnNewNotebookMenuHidden;
 			}
-			
+			 imageitem = Tomboy.ActionManager.GetWidget (
+				"/NotebooksTreeContextMenu/NewNotebookNote") as Gtk.ImageMenuItem;
+			if (imageitem != null) {
+				if (imageitem is Gtk.ImageMenuItem) {
+					Gtk.ImageMenuItem imageItem = imageitem as Gtk.ImageMenuItem;
+					(imageItem.Image as Gtk.Image).Pixbuf = ActionManager.newNote;
+				}
+			}
 			initialized = true;
 		}
 



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