[jokosher-devel] [PATCH] Menu item mnemonics and images



Hello everyone,

Ive been rather busy lately but i hope i can find more time to work on jokosher.

This patch fixes bug #71007 to some degree. The icon used to indicate a piece of audio which can be split is a gtk cut icon.
This is inconsistent. Therefore, i think there should be a split icon made.

All menu items now have mnemonic labels making jokosher more accessible. 

John


Index: EventLaneViewer.py
===================================================================
--- EventLaneViewer.py	(revision 986)
+++ EventLaneViewer.py	(working copy)
@@ -181,18 +181,22 @@
 		
 		# Create context menu on RMB 
 		if mouse.button == 3: 
-			m = gtk.Menu() 
-			items = [	(_("Import Audio File..."), self.CreateEventFromFile, True),
-					("---", None, None),
-					(_("Paste"), self.OnPaste, self.project.clipboardList),
-					(_("Delete"), self.OnDelete, True)
+			m = gtk.Menu()
+			audioimg = gtk.Image() 
+			pixbuf = gtk.gdk.pixbuf_new_from_file("../Instruments/images/audiofile.png").scale_simple(16, 16, gtk.gdk.INTERP_BILINEAR)
+			audioimg.set_from_pixbuf(pixbuf)
+			items = [	(_("_Import Audio File..."), self.CreateEventFromFile, True, audioimg),
+					("---", None, None, None),
+					(_("_Paste"), self.OnPaste, self.project.clipboardList, gtk.image_new_from_stock(gtk.STOCK_PASTE, gtk.ICON_SIZE_MENU)),
+					(_("_Delete"), self.OnDelete, True, gtk.image_new_from_stock(gtk.STOCK_DELETE, gtk.ICON_SIZE_MENU))
 					 ] 
 
-			for i, cb, sensitive in items: 
+			for i, cb, sensitive, image in items: 
 				if i == "---":
 					a = gtk.SeparatorMenuItem()
 				else:
-					a = gtk.MenuItem(label=i)
+					a = gtk.ImageMenuItem(i, True)
+					a.set_image(image)
 					
 				a.set_sensitive(bool(sensitive))
 				a.show() 
Index: EventViewer.py
===================================================================
--- EventViewer.py	(revision 986)
+++ EventViewer.py	(working copy)
@@ -532,18 +532,19 @@
 		
 	def ContextMenu(self,mouse):
 		m = gtk.Menu()
-		items = [	(_("Split"), self.OnSplit, True),
-					("---", None, None),
-					(_("Cut"), self.OnCut, True),
-					(_("Copy"), self.OnCopy, True),
-					(_("Delete"), self.OnDelete, False)
-				] 
+		items = [	(_("_Split"), self.OnSplit, True, None),
+					("---", None, None, None),
+					(_("Cu_t"), self.OnCut, True, gtk.image_new_from_stock(gtk.STOCK_CUT, gtk.ICON_SIZE_MENU)),
+					(_("_Copy"), self.OnCopy, True, gtk.image_new_from_stock(gtk.STOCK_COPY, gtk.ICON_SIZE_MENU)),
+					(_("_Delete"), self.OnDelete, False, gtk.image_new_from_stock(gtk.STOCK_DELETE, gtk.ICON_SIZE_MENU))
+					] 
 
-		for i, cb, sometimes in items: 
+		for i, cb, sometimes, image in items: 
 			if i == "---":
 				a = gtk.SeparatorMenuItem()
 			else:
-				a = gtk.MenuItem(i)
+				a = gtk.ImageMenuItem(i, True)
+				a.set_image(image)
 			
 			if self.event.isLoading and sometimes:
 				a.set_sensitive(False)
Index: Jokosher.glade
===================================================================
--- Jokosher.glade	(revision 986)
+++ Jokosher.glade	(working copy)
@@ -102,7 +102,7 @@
 		    <widget class="GtkMenuItem" id="recentprojects">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Open a recent project</property>
-		      <property name="label" translatable="yes">Recent Projects</property>
+		      <property name="label" translatable="yes">_Recent Projects</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_recent_projects1_activate"/>
 
@@ -122,7 +122,7 @@
 		      <signal name="activate" handler="on_export_activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image166">
+			<widget class="GtkImage" id="image202">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-jump-to</property>
 			  <property name="icon_size">1</property>
@@ -175,7 +175,7 @@
 		      <accelerator key="Z" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image167">
+			<widget class="GtkImage" id="image203">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-undo</property>
 			  <property name="icon_size">1</property>
@@ -198,7 +198,7 @@
 		      <accelerator key="Z" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image168">
+			<widget class="GtkImage" id="image204">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-redo</property>
 			  <property name="icon_size">1</property>
@@ -291,12 +291,12 @@
 		    <widget class="GtkImageMenuItem" id="add_instrument1">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Add an instrument to the project</property>
-		      <property name="label" translatable="yes">Add Instrument</property>
+		      <property name="label" translatable="yes">_Add Instrument</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_AddInstrument_clicked"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image169">
+			<widget class="GtkImage" id="image205">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-add</property>
 			  <property name="icon_size">1</property>
@@ -313,7 +313,7 @@
 		    <widget class="GtkMenuItem" id="changeinstrumenttype">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Change the selected instrument type</property>
-		      <property name="label" translatable="yes">Change Instrument Type</property>
+		      <property name="label" translatable="yes">_Change Instrument Type</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_ChangeInstrumentType_clicked"/>
 		    </widget>
@@ -323,12 +323,12 @@
 		    <widget class="GtkImageMenuItem" id="instrument_connections1">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Manage instrument recording inputs</property>
-		      <property name="label" translatable="yes">Instrument Connections</property>
+		      <property name="label" translatable="yes">_Instrument Connections</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_instrumentconnections_activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image170">
+			<widget class="GtkImage" id="image206">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -345,7 +345,7 @@
 		    <widget class="GtkMenuItem" id="time_format1">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Change the timeline</property>
-		      <property name="label" translatable="yes">Time Format</property>
+		      <property name="label" translatable="yes">_Time Format</property>
 		      <property name="use_underline">True</property>
 
 		      <child>
@@ -355,7 +355,7 @@
 			    <widget class="GtkRadioMenuItem" id="show_as_bars_beats_ticks">
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Change the timeline to show bars, beats and ticks</property>
-			      <property name="label" translatable="yes">Show as Bars, Beats, Ticks</property>
+			      <property name="label" translatable="yes">Show as _Bars, Beats, Ticks</property>
 			      <property name="use_underline">True</property>
 			      <property name="active">True</property>
 			      <signal name="toggled" handler="on_show_as_bars_beats_ticks_toggled"/>
@@ -366,7 +366,7 @@
 			    <widget class="GtkRadioMenuItem" id="show_as_hours_minutes_seconds">
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Change the timeline to show hours, minutes and seconds</property>
-			      <property name="label" translatable="yes">Show as Hours, Minutes, Seconds</property>
+			      <property name="label" translatable="yes">Show as _Hours, Minutes, Seconds</property>
 			      <property name="use_underline">True</property>
 			      <property name="active">True</property>
 			      <property name="group">show_as_bars_beats_ticks</property>
@@ -385,7 +385,7 @@
 	  <child>
 	    <widget class="GtkMenuItem" id="extensionsmenu">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_Extensions</property>
+	      <property name="label" translatable="yes">Ex_tensions</property>
 	      <property name="use_underline">True</property>
 
 	      <child>
@@ -424,12 +424,12 @@
 		    <widget class="GtkImageMenuItem" id="pre-release_notes1">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Notes about this release</property>
-		      <property name="label" translatable="yes">Pre-release Notes</property>
+		      <property name="label" translatable="yes">_Pre-release Notes</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_prereleasenotes_activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image171">
+			<widget class="GtkImage" id="image207">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -446,12 +446,12 @@
 		    <widget class="GtkImageMenuItem" id="contributing_to_jokosher1">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">Find out how you can help</property>
-		      <property name="label" translatable="yes">Contributing to Jokosher</property>
+		      <property name="label" translatable="yes">_Contributing to Jokosher</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_contributing_activate"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image172">
+			<widget class="GtkImage" id="image208">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -510,8 +510,8 @@
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 		  <accessibility>
+		    <atkrelation target="Record" type="flows-to"/>
 		    <atkrelation target="Rewind" type="flows-to"/>
-		    <atkrelation target="Record" type="flows-to"/>
 		  </accessibility>
 		  <signal name="clicked" handler="on_AddInstrument_clicked"/>
 		</widget>
@@ -543,8 +543,8 @@
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 		  <accessibility>
+		    <atkrelation target="Stop" type="flows-to"/>
 		    <atkrelation target="AddInstrument" type="flows-from"/>
-		    <atkrelation target="Stop" type="flows-to"/>
 		  </accessibility>
 		  <signal name="clicked" handler="on_Rewind_clicked"/>
 		</widget>
@@ -564,8 +564,8 @@
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 		  <accessibility>
+		    <atkrelation target="Play" type="flows-to"/>
 		    <atkrelation target="Rewind" type="flows-from"/>
-		    <atkrelation target="Play" type="flows-to"/>
 		  </accessibility>
 		  <signal name="clicked" handler="on_Stop_clicked"/>
 		</widget>
@@ -585,8 +585,8 @@
 		  <property name="is_important">False</property>
 		  <property name="active">False</property>
 		  <accessibility>
+		    <atkrelation target="Forward" type="flows-to"/>
 		    <atkrelation target="Stop" type="flows-from"/>
-		    <atkrelation target="Forward" type="flows-to"/>
 		  </accessibility>
 		  <signal name="toggled" handler="on_Play_toggled"/>
 		</widget>
@@ -605,8 +605,8 @@
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 		  <accessibility>
+		    <atkrelation target="Record" type="flows-to"/>
 		    <atkrelation target="Play" type="flows-from"/>
-		    <atkrelation target="Record" type="flows-to"/>
 		  </accessibility>
 		  <signal name="clicked" handler="on_Forward_clicked"/>
 		</widget>
@@ -3812,16 +3812,27 @@
       <property name="spacing">10</property>
 
       <child>
-	<widget class="GtkTreeView" id="treeview1">
+	<widget class="GtkScrolledWindow" id="scrolledwindow4">
 	  <property name="visible">True</property>
-	  <property name="headers_visible">True</property>
-	  <property name="rules_hint">False</property>
-	  <property name="reorderable">False</property>
-	  <property name="enable_search">True</property>
-	  <property name="fixed_height_mode">False</property>
-	  <property name="hover_selection">False</property>
-	  <property name="hover_expand">False</property>
-	  <signal name="cursor_changed" handler="on_Treeview_selected" last_modification_time="Tue, 31 Oct 2006 22:38:54 GMT"/>
+	  <property name="can_focus">True</property>
+	  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+	  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+	  <property name="shadow_type">GTK_SHADOW_IN</property>
+	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+	  <child>
+	    <widget class="GtkTreeView" id="treeview1">
+	      <property name="visible">True</property>
+	      <property name="headers_visible">True</property>
+	      <property name="rules_hint">False</property>
+	      <property name="reorderable">False</property>
+	      <property name="enable_search">True</property>
+	      <property name="fixed_height_mode">False</property>
+	      <property name="hover_selection">False</property>
+	      <property name="hover_expand">False</property>
+	      <signal name="cursor_changed" handler="on_Treeview_selected" last_modification_time="Tue, 31 Oct 2006 22:38:54 GMT"/>
+	    </widget>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>


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