[Goodies-commits] r7418 - in xfce4-notes-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Sun May 24 17:35:07 CEST 2009


Author: mmassonnet
Date: 2009-05-24 15:35:07 +0000 (Sun, 24 May 2009)
New Revision: 7418

Modified:
   xfce4-notes-plugin/trunk/ChangeLog
   xfce4-notes-plugin/trunk/panel-plugin/window.vala
Log:
Fill the missing gaps in Xnp.Window

Modified: xfce4-notes-plugin/trunk/ChangeLog
===================================================================
--- xfce4-notes-plugin/trunk/ChangeLog	2009-05-24 15:16:27 UTC (rev 7417)
+++ xfce4-notes-plugin/trunk/ChangeLog	2009-05-24 15:35:07 UTC (rev 7418)
@@ -1,5 +1,14 @@
 2009-05-24  Mike Massonnet <mmassonnet at xfce.org>
 
+Fill the missing gaps in Xnp.Window
+	* panel-plugin/window.vala:
+	  - Remove the timeout on finalize.
+	  - Display an arrow beneath the current note in the menu Go.
+	  - On Properties item activate send a signal action.
+	  - Add more accelerators.
+
+2009-05-24  Mike Massonnet <mmassonnet at xfce.org>
+
 Unshade the window before it is hidden
 	* panel-plugin/window.vala:
 	  - On hide_cb unshade the window.

Modified: xfce4-notes-plugin/trunk/panel-plugin/window.vala
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/window.vala	2009-05-24 15:16:27 UTC (rev 7417)
+++ xfce4-notes-plugin/trunk/panel-plugin/window.vala	2009-05-24 15:35:07 UTC (rev 7418)
@@ -131,6 +131,9 @@
 			title_evbox.add (this.title_label);
 			title_box.pack_start (title_evbox, true, true, 0);
 			var close_box = new Gtk.Button ();
+			close_box.add_accelerator ("clicked", this.accel_group, 0xff1b, // GDK_Escape in gdk/gdkkeysyms.h
+				0, Gtk.AccelFlags.MASK);
+			close_box.tooltip_text = Gtk.accelerator_get_label (0xff1b, 0);
 			close_box.set_relief (Gtk.ReliefStyle.NONE);
 			close_box.can_focus = false;
 			var close_label = new Gtk.Label ("<b>x</b>");
@@ -155,6 +158,10 @@
 			/* Build navigation toolbar */
 			this.navigation_box = new Gtk.HBox (false, 2);
 			this.goleft_box = new Gtk.Button ();
+			/* NOTE: does not work if the widget is hidden */
+			//this.goleft_box.add_accelerator ("clicked", this.accel_group, 0xff55, // GDK_Page_Up in gdk/gdkkeysyms.h
+			//	Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.MASK);
+			this.goleft_box.tooltip_text = Gtk.accelerator_get_label (0xff55, Gdk.ModifierType.CONTROL_MASK);
 			this.goleft_box.set_relief (Gtk.ReliefStyle.NONE);
 			this.goleft_box.can_focus = false;
 			this.goleft_box.sensitive = false;
@@ -179,6 +186,9 @@
 			del_box.add (del_label);
 			this.navigation_box.pack_start (del_box, true, false, 0);
 			this.goright_box = new Gtk.Button ();
+			//this.goright_box.add_accelerator ("clicked", this.accel_group, 0xff56, // GDK_Page_Down in gdk/gdkkeysyms.h
+			//	Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.MASK);
+			this.goright_box.tooltip_text = Gtk.accelerator_get_label (0xff56, Gdk.ModifierType.CONTROL_MASK);
 			this.goright_box.set_relief (Gtk.ReliefStyle.NONE);
 			this.goright_box.can_focus = false;
 			this.goright_box.sensitive = false;
@@ -254,6 +264,11 @@
 			};
 		}
 
+		~Window () {
+			if (this.navigation_timeout != 0)
+				Source.remove (this.navigation_timeout);
+		}
+
 		/*
 		 * Signal callbacks
 		 */
@@ -519,6 +534,7 @@
 
 			/* Properties */
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_PROPERTIES, null);
+			mi.activate += () => { action ("properties"); };
 			menu.append (mi);
 
 			/* Note items */
@@ -540,6 +556,8 @@
 			mi = new Gtk.ImageMenuItem.with_mnemonic ("_Rename");
 			var image = new Gtk.Image.from_stock (Gtk.STOCK_EDIT, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
+			mi.add_accelerator ("activate", this.accel_group, 0xffbf, // GDK_F2 in gdk/gdkkeysyms.h
+				0, Gtk.AccelFlags.MASK);
 			mi.activate += () => { rename_current_note (); };
 			menu.append (mi);
 
@@ -596,10 +614,16 @@
 						mi.sensitive = false;
 						menu.append (mi);
 
+						int current_page = this.notebook.get_current_page ();
+						var current_note = (Xnp.Note)(this.notebook.get_nth_page (current_page));
 						int n_pages = this.notebook.get_n_pages ();
 						for (int p = 0; p < n_pages; p++) {
 							var note = (Xnp.Note)(this.notebook.get_nth_page (p));
-							mi = new Gtk.MenuItem.with_label (note.name);
+							mi = new Gtk.ImageMenuItem.with_label (note.name);
+							if (note == current_note) {
+								image = new Gtk.Image.from_stock (Gtk.STOCK_GO_FORWARD, Gtk.IconSize.MENU);
+								((Gtk.ImageMenuItem)mi).set_image (image);
+							}
 							mi.set_data ("page", (void*)p);
 							mi.activate += (i) => {
 								int page = (int)i.get_data ("page");
@@ -629,8 +653,8 @@
 			mi = new Gtk.ImageMenuItem.with_mnemonic ("_Rename group");
 			image = new Gtk.Image.from_stock (Gtk.STOCK_EDIT, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
-			//mi.add_accelerator ("activate", this.accel_group, '<F2>',
-			//	Gdk.ModifierType.SHIFT_MASK, Gtk.AccelFlags.MASK);
+			mi.add_accelerator ("activate", this.accel_group, 0xffbf, // GDK_F2 in gdk/gdkkeysyms.h
+				Gdk.ModifierType.SHIFT_MASK, Gtk.AccelFlags.MASK);
 			mi.activate += () => { action ("rename"); };
 			menu.append (mi);
 




More information about the Goodies-commits mailing list