Re: [Muine] NEW PRELEASE: 0.8.1pre1



On Sat, 22 Jan 2005 16:23:46 +0200, Jorn Baayen <jbaayen gnome org> wrote:

> > > For now, yes. But I'll accept patches introducing a gconf key making
> > > this behaviour optional, for poor souls like you who have their tags
> > > etched into stone :)

Attached proposed patch (against 0.8.pre1). Config.Get placement is
probably not optimal, though.

> >
> > (...)
> >
> > > Again, I'll accept a patch introducing a simple ensure_track_number
> > > function in metadata.c, which, if track_number is -1, tries to atoi ()
> > > it from the first one or two chars from the filename.

Attached.

> Main purpose: The button being bigger, easier to spot and hit, as it is
> one of the most frequently clicked buttons.
> And personally, I don't find it ugly.

I get the reasoning why the play button should be bigger, but I still
don't like the label...

I remember that older versions used to have wider icon on the play
button, I liked that better. Well, duh. :-)

-- 
Andrew.
--- libmuine/metadata.c.orig	2005-01-16 18:32:12.000000000 +0300
+++ libmuine/metadata.c	2005-01-22 18:22:48.000000000 +0300
@@ -299,6 +299,23 @@
 	return utf8;
 }
 
+static int
+ensure_track_number (int track_number, const char *filename) 
+{
+	char *p;
+	
+	if (track_number == -1 || track_number == 0) {		
+	
+		p = (char *)&filename[strlen(filename)-1];
+		
+		while (*(p-1) != '/' && p > filename) { p--; }
+
+		return atoi(p);
+	} else {
+		return track_number;
+	}
+}
+
 static Metadata *
 assign_metadata_mp3 (const char *filename,
 		     GnomeVFSFileInfo *info,
@@ -374,6 +391,8 @@
 	parse_raw_track_number (metadata, track_number_raw);
 	g_free (track_number_raw);
 
+	metadata->track_number = ensure_track_number(metadata->track_number, filename);
+
         disc_number_raw = get_mp3_comment_value (tag, "TPOS", 0);
         if (disc_number_raw != NULL)
                 metadata->disc_number = atoi (disc_number_raw);
@@ -542,6 +561,8 @@
 
 	assign_metadata_vorbiscomment (metadata, comment);
 
+	metadata->track_number = ensure_track_number(metadata->track_number, filename);
+
 	metadata->duration = ov_time_total (&vf, -1);
 
 	*error_message_return = NULL;


--- data/muine.schemas.in.orig	2005-01-22 19:08:53.000000000 +0300
+++ data/muine.schemas.in	2005-01-22 19:09:33.000000000 +0300
@@ -188,6 +188,17 @@
         <short>Amazon site to use for album images</short>
 	<long>Which Amazon site to use for fetching album images, "us", "uk", "de", or "jp".</long>
       </locale>
+	 </schema>
+    <schema>
+      <key>/schemas/apps/muine/display_hidden_items</key>
+      <applyto>/apps/muine/display_hidden_items</applyto>
+      <owner>muine</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Display hidden items</short>
+        <long>Force display of initially hidden items (like incomplete albums)</long>
+      </locale>
     </schema>
   </schemalist>
 </gconfschemafile>

--- src/AddWindow.cs.orig	2005-01-22 19:27:38.000000000 +0300
+++ src/AddWindow.cs	2005-01-22 19:26:53.000000000 +0300
@@ -58,6 +58,10 @@
 		// Objects
 		private ICollection items;
 
+		// GConf
+		private const string GConfKeyDisplayHiddenItems = "/apps/muine/display_hidden_items";
+		private const bool GConfDefaultDisplayHiddenItems = false;		
+
 		// Variables
 		private string gconf_key_width, gconf_key_height;
 		private int gconf_default_width, gconf_default_height;
@@ -66,6 +70,7 @@
 		private uint search_idle_id = 0;
 
 		private bool enable_speed_hacks = false;
+		private bool display_hidden_items = false;
 
 		// Constructor
 		public AddWindow () : base (IntPtr.Zero)
@@ -226,6 +231,9 @@
 
 			int max_len = -1;
 
+			display_hidden_items = (bool) Config.Get(GConfKeyDisplayHiddenItems, 
+					GConfDefaultDisplayHiddenItems);
+
 			// Show max. FakeLength songs if < MinQueryLength chars are entered. 
 			// This is to fake speed.
 			if (enable_speed_hacks && entry.Text.Length < entry.MinQueryLength)
@@ -246,7 +254,7 @@
 					}
 				} else {
 					foreach (Item item in items) {
-						if (!item.Public)
+						if (!item.Public && !display_hidden_items)
 							continue;
 
 						l.Append (item.Handle);



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