From 781273c236c9a17d13d813e5689f72bac6053818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sat, 19 Feb 2011 13:22:06 +0100 Subject: Open files from command line. --- src/logdiag.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/logdiag.c') diff --git a/src/logdiag.c b/src/logdiag.c index 99aa8de..fd871f2 100644 --- a/src/logdiag.c +++ b/src/logdiag.c @@ -19,7 +19,6 @@ int main (int argc, char *argv[]) { - GtkWidget *window; GError *error; #ifdef _WIN32 gchar *install_dir; @@ -48,11 +47,15 @@ main (int argc, char *argv[]) return 1; } - /* TODO: Open the file in the parameter, if present. */ gtk_window_set_default_icon_name (PROJECT_NAME); - window = ld_window_main_new (); - gtk_main (); + /* TODO: Accept multiple files. */ + if (argc < 2) + ld_window_main_new (NULL); + else + ld_window_main_new (argv[1]); + + gtk_main (); return 0; } -- cgit v1.2.3