diff options
Diffstat (limited to 'bin/gui/control.c')
-rw-r--r-- | bin/gui/control.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/gui/control.c b/bin/gui/control.c index ea150f3..9653bb3 100644 --- a/bin/gui/control.c +++ b/bin/gui/control.c @@ -746,16 +746,19 @@ main (int argc, char *argv[]) GtkBuilder *builder; GOptionContext *context; GError *error = NULL; + static gchar *camera_name = NULL; static GOptionEntry entries[] = { { "mem-size", 'm', 0, G_OPTION_ARG_INT, &mem_size, "Memory in megabytes to allocate for frame storage", "M" }, + { "camera", 'c', 0, G_OPTION_ARG_STRING, &camera_name, "Default camera (skips choice window)", "NAME" }, { NULL } }; context = g_option_context_new ("- control libuca cameras"); g_option_context_add_main_entries (context, entries, NULL); g_option_context_add_group (context, gtk_get_option_group (TRUE)); + if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("Option parsing failed: %s\n", error->message); return 1; @@ -773,9 +776,13 @@ main (int argc, char *argv[]) } plugin_manager = uca_plugin_manager_new (); - create_choice_window (builder); gtk_builder_connect_signals (builder, NULL); + if (camera_name != NULL) + create_main_window (builder, camera_name); + else + create_choice_window (builder); + gdk_threads_enter (); gtk_main (); gdk_threads_leave (); |