[Muine] The complete mail this time...Fwd: Patches for various things



Sorry, I hit send too soon...

Attached are patches for the following:

1: Set fixed row height in the playlist window. This was in the code
// FIXME: Re-enable when Gnome Bugzilla #165017, #165034 are fixed
Those bugs are fixed...

2: Change the way the window title is made up when a song is playing.
It used to be <songname> - Muine Music Player.
Generally I don't care what the program is called, so the patch changes it to
<songname> by <Artistnames>
I'm guessing that translating the "by" might be different depending on
the language but I don't know enough to do that.

3: Add a popup menu to the playlist. The popup is added through the
UIManager so plugins and whatnot can add themselves to it. I envisage
things like the Muinescrobbler plugin adding a "Love" "Hate" feature
on this menu, or a "Tag this song/album/artist" item.

4: Completely rearrange the menu layout :D
(I don't expect this to even be considered, but I thought I'd throw it
out for comment).

It occurred to me one day that all the options in the file menu were
operations on either songs or playlists...so I moved them into those
menus. The menu layout in the patch is

Playlist
  Add Songs (was File->Play Song)
  Add Albums (was File->Play Albums)
  --------------
  Open...
  Save As...
  --------------
  Remove Song
  Remove Played Songs
  Clear
  ---------------
  Repeat
  Shuffle

Song
  Import Songs (was File->Import...)
  (Rest is same)

Tools
  <external plugins put their menu items here>

Help
   <same> (although locally I remove it...but thats a whole new can of
worms I'm not gonna open)

---------------------------------
The only menu item I can't find a place for is Quit, although
technically it could just go in the Playlist menu, as thts the first
menu.
The only other difference is that any plugin that puts items in the
file menu would need to move it to the tools menu, but I think tools
is a better place than the weird File menu.

File->Play Song and Play Album were moved into Playlist and renamed
Add Song and Add Album as really, their main operation isn't playing,
but adding to the playlist.

Anyway, sorry for the half finished mail earlier.
I'm not expecting much in the way of them being integrated at all...

iain
Index: src/HandleView.cs
===================================================================
RCS file: /cvs/gnome/muine/src/HandleView.cs,v
retrieving revision 1.42
diff -U2 -r1.42 HandleView.cs
--- src/HandleView.cs	27 Apr 2005 20:48:23 -0000	1.42
+++ src/HandleView.cs	22 Feb 2006 00:28:50 -0000
@@ -42,5 +42,6 @@
 
 			// FIXME: Re-enable when Gnome Bugzilla #165017, #165034 are fixed
-			// SetProperty ("fixed_height_mode", new GLib.Value (true));
+			// As of 21-12-05 these are fixed.
+			SetProperty ("fixed_height_mode", new GLib.Value (true));
 		}
 













Index: src/PlaylistWindow.cs
===================================================================
RCS file: /cvs/gnome/muine/src/PlaylistWindow.cs,v
retrieving revision 1.242
diff -U2 -r1.242 PlaylistWindow.cs
--- src/PlaylistWindow.cs	30 Jan 2006 01:31:24 -0000	1.242
+++ src/PlaylistWindow.cs	22 Feb 2006 00:35:24 -0000
@@ -91,5 +91,5 @@
 		// Strings :: Window Titles
 		private static readonly string string_title_main =
-			Catalog.GetString ("{0} - Muine Music Player");
+			Catalog.GetString ("{0} by {1}");
 
 		// Strings :: Tooltips
@@ -1151,5 +1152,5 @@
                                         StringUtils.EscapeForPango (StringUtils.JoinHumanReadable (song.Artists)));
 
-				this.Title = String.Format (string_title_main, song.Title);
+				this.Title = String.Format (string_title_main, song.Title, StringUtils.JoinHumanReadable (song.Artists));
 
 				if (player.Song != song || restart)












Index: data/ui/PlaylistWindow.xml
===================================================================
RCS file: /cvs/gnome/muine/data/ui/PlaylistWindow.xml,v
retrieving revision 1.6
diff -U2 -r1.6 PlaylistWindow.xml
--- data/ui/PlaylistWindow.xml	4 May 2005 19:05:43 -0000	1.6
+++ data/ui/PlaylistWindow.xml	22 Feb 2006 00:33:39 -0000
@@ -37,3 +37,10 @@
     </menu>
   </menubar>
+
+  <popup action="PlaylistPopup">
+    <menuitem action="Remove" />
+    <placeholder name="ExtraPlaylistActions">
+	    <separator />
+    </placeholder>
+  </popup>
 </ui>
Index: src/PlaylistWindow.cs
===================================================================
RCS file: /cvs/gnome/muine/src/PlaylistWindow.cs,v
retrieving revision 1.242
diff -U2 -r1.242 PlaylistWindow.cs
--- src/PlaylistWindow.cs	30 Jan 2006 01:31:24 -0000	1.242
+++ src/PlaylistWindow.cs	22 Feb 2006 00:33:39 -0000
@@ -183,5 +183,5 @@
 		[Glade.Widget] private EventBox playlist_label_event_box;
 
-		private HandleView playlist;
+		private PlaylistView playlist;
 
 		// Windows
@@ -859,9 +859,9 @@
 			tooltips.SetTip (volume_button     , string_tooltip_volume     , null);
 		}
-
+			
 		// Methods :: Private :: SetupPlaylist
 		private void SetupPlaylist ()
 		{
-			playlist = new HandleView ();
+			playlist = new PlaylistView ();
 
 			playlist.Selection.Mode = SelectionMode.Multiple;
@@ -891,5 +891,6 @@
 			playlist.DragDataGet      += new DragDataGetHandler      (OnPlaylistDragDataGet     );
 			playlist.DragDataReceived += new DragDataReceivedHandler (OnPlaylistDragDataReceived);
-
+			
+			playlist.PopupMenu += new PopupMenuHandler (OnPlaylistPopupMenu);
 			playlist.Show ();
 
@@ -2102,5 +2103,15 @@
 			Drag.Finish (args.Context, success, false, args.Time);
 		}
-		
+
+		// Handlers :: PopupMenu
+		private void OnPlaylistPopupMenu (object o, PopupMenuArgs args)
+		{
+			Gtk.Menu menu = (Gtk.Menu) Global.Actions.UIManager.GetWidget ("/PlaylistPopup");
+
+			if (menu != null) {
+				menu.Popup ();
+			}
+		}
+
 		// Delegate Functions
 		// Delegate Functions :: PixbufCellDataFunc
@@ -2176,4 +2187,41 @@
 			public TreeViewDropPosition Position;
 			public bool                 First   ;
+		}
+
+		private class PlaylistView : HandleView
+		{
+			protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
+			{
+				// Call base class function if not right-click
+				if (evnt.Button != 3) {
+					return base.OnButtonPressEvent (evnt);
+				}
+				
+				// Single click with right mouse button?
+				if (evnt.Type == Gdk.EventType.ButtonPress &&
+				    evnt.Button == 3) {
+					TreePath path;
+					GetPathAtPos ((int) evnt.X, (int) evnt.Y, out path);
+					if (path == null) {
+						// If there is no item, 
+						// no popup menu
+						return true;
+					} else if (!this.Selection.PathIsSelected (path)) {
+						// If the item isn't selected,
+						// select only it
+						this.Selection.UnselectAll ();
+						this.Selection.SelectPath (path);
+					}
+
+					// Create and popup menu
+					Gtk.Menu menu = (Gtk.Menu) Global.Actions.UIManager.GetWidget ("/PlaylistPopup");
+
+					if (menu != null) {
+						menu.Popup ();
+					}
+				}
+				
+				return true;
+			}
 		}
 	}












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