From c852392d9e27d244ee48238e056f7dac5bc7e131 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 17 Jul 2013 10:23:39 +0200 Subject: Add -c/--camera flag to uca-camera-control --- bin/gui/control.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin') 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 (); -- cgit v1.2.3