From abe637f399d84a9368e79bc8d3c950629d48e4db Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 8 Nov 2010 10:38:39 +0200 Subject: [PATCH] maintenance: code cleanups and addition TODO: comments --- mediainfo/README | 8 ++++++-- mediainfo/src/mi-app.vala | 6 ++++++ mediainfo/src/mi-info.vala | 18 +++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/mediainfo/README b/mediainfo/README index 5117db13bb..651884efac 100644 --- a/mediainfo/README +++ b/mediainfo/README @@ -67,9 +67,13 @@ Duration: == unsorted == - handle chapters -- if there is a "language-code" in the tags (or subtitles?) use flag icons +- tag lists + - if there is a "language-code" in the tags (or subtitles?) use flag icons + - handle album art in tag lists + - make urls clickable + - geo-tags: map-widget?, link to google-maps? + - artist: links to {last.fm,wikipedia} = TODO for discoverer = - get duration per stream - this would need individual queries on the demuxer src pads - diff --git a/mediainfo/src/mi-app.vala b/mediainfo/src/mi-app.vala index 38b6e3e731..f6387e04dc 100644 --- a/mediainfo/src/mi-app.vala +++ b/mediainfo/src/mi-app.vala @@ -78,11 +78,17 @@ public class MediaInfo.App : Window sub_menu = new Menu (); item.set_submenu (sub_menu); + + // TODO: add "open uri" item + // -> dialog with text entry + // -> discover that uri and clear selection in browser item = new ImageMenuItem.from_stock (STOCK_QUIT, accel_group); sub_menu.append (item); item.activate.connect (Gtk.main_quit); + // TODO: add "help" menu with "about" item + return (menu_bar); } diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala index 89ac8762ad..4f9e301099 100644 --- a/mediainfo/src/mi-info.vala +++ b/mediainfo/src/mi-info.vala @@ -290,7 +290,7 @@ public class MediaInfo.Info : VBox table.attach (label, 1, 2, row, row+1, fill_exp, 0, 3, 1); row++; - // TODO: add named resolutions: (640x480=VGA) + // add named resolutions: (640x480=VGA) label = new Label ("Resolution:"); label.set_alignment (1.0f, 0.5f); table.attach (label, 0, 1, row, row+1, fill, 0, 0, 0); @@ -349,8 +349,7 @@ public class MediaInfo.Info : VBox label = new Label ("Tags:"); label.set_alignment (1.0f, 0.0f); table.attach (label, 0, 1, row, row+1, fill, fill, 0, 0); - str = s.to_string (); - str = str[8:-1].compress().replace(",","\n"); + str = build_taglist_info (s); label = new Label(str); label.set_ellipsize (Pango.EllipsizeMode.END); label.set_alignment (0.0f, 0.5f); @@ -440,8 +439,7 @@ public class MediaInfo.Info : VBox label = new Label ("Tags:"); label.set_alignment (1.0f, 0.0f); table.attach (label, 0, 1, row, row+1, fill, fill, 0, 0); - str = s.to_string (); - str = str[8:-1].compress().replace(",","\n"); + str = build_taglist_info (s); label = new Label(str); label.set_ellipsize (Pango.EllipsizeMode.END); label.set_alignment (0.0f, 0.5f); @@ -526,4 +524,14 @@ public class MediaInfo.Info : VBox ((GLib.Object)pb).set_property ("current-audio", (int)page_num); } } + + private string build_taglist_info (Structure s) + { + // FIXME: properly loop over taglist items and serialize them + // this allows to properly newline them and to avoid the types in the result + string str = s.to_string (); + str = str[8:-1].compress().replace(",","\n"); + + return str; + } }