diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-07-17 10:23:39 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-07-17 10:23:39 +0200 |
commit | c852392d9e27d244ee48238e056f7dac5bc7e131 (patch) | |
tree | 3edd0f46ca460651a65e0aeccede27f31f7c5a49 /bin/gui | |
parent | 75cf94de86e3d6daa1bc270852eec512ce1085b2 (diff) | |
download | uca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.gz uca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.bz2 uca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.xz uca-c852392d9e27d244ee48238e056f7dac5bc7e131.zip |
Add -c/--camera flag to uca-camera-control
Diffstat (limited to 'bin/gui')
-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 (); |