diff --git a/mediainfo/src/mi-app.vala b/mediainfo/src/mi-app.vala index 74da379b77..38b6e3e731 100644 --- a/mediainfo/src/mi-app.vala +++ b/mediainfo/src/mi-app.vala @@ -25,8 +25,13 @@ public class MediaInfo.App : Window private FileChooserWidget chooser; private Info info; - public App() + public string directory { get; set; } + + public App(string? directory) { + GLib.Object (type : WindowType.TOPLEVEL); + this.directory = directory; + // configure the window set_title (_("GStreamer Media Info")); set_default_size (500, 350); @@ -45,7 +50,10 @@ public class MediaInfo.App : Window chooser = new FileChooserWidget (FileChooserAction.OPEN); paned.pack1 (chooser, true, true); - chooser.set_current_folder (GLib.Environment.get_home_dir ()); + if (directory != null) { + //chooser.set_current_folder (GLib.Environment.get_home_dir ()); + chooser.set_current_folder (directory); + } chooser.set_show_hidden (false); chooser.selection_changed.connect (on_update_preview); diff --git a/mediainfo/src/mi.vala b/mediainfo/src/mi.vala index f5b14ef7f2..3df94234dd 100644 --- a/mediainfo/src/mi.vala +++ b/mediainfo/src/mi.vala @@ -51,7 +51,13 @@ main(string[] args) return (0); } - App app = new App (); + // take remaining arg and use as default dir + string directory = null; + if (args.length > 1) { + directory=args[1]; + } + + App app = new App (directory); app.show_all (); Gtk.main ();