summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-09-09 08:07:20 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-09-09 08:07:20 -0400
commitbce8d771a2643d9c8a9a0c4b1343202cf90368fb (patch)
tree799f5039a00409747138378ee89ac97a56b3e237 /demos
parent9da0aa5d4071df88568555f303ad440e3230ddde (diff)
downloadgtk+-bce8d771a2643d9c8a9a0c4b1343202cf90368fb.tar.gz
gtk-demo: Make --autoquit a simple option
No real need to specify the amount of delay, just make this a plain boolean.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index f6e4fbf5c1..6bb7548990 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -1057,7 +1057,7 @@ command_line (GApplication *app,
{
GVariantDict *options;
const gchar *name = NULL;
- gint autoquit = 0;
+ gboolean autoquit = FALSE;
Demo *d, *c;
GDoDemoFunc func = 0;
GtkWidget *window, *demo;
@@ -1066,7 +1066,7 @@ command_line (GApplication *app,
options = g_application_command_line_get_options_dict (cmdline);
g_variant_dict_lookup (options, "run", "&s", &name);
- g_variant_dict_lookup (options, "autoquit", "i", &autoquit);
+ g_variant_dict_lookup (options, "autoquit", "b", &autoquit);
if (name == NULL)
goto out;
@@ -1104,8 +1104,8 @@ out:
gtk_window_set_modal (GTK_WINDOW (demo), TRUE);
}
- if (autoquit > 0)
- g_timeout_add_seconds (autoquit, auto_quit, app);
+ if (autoquit)
+ g_timeout_add_seconds (1, auto_quit, app);
}
int
@@ -1134,7 +1134,7 @@ main (int argc, char **argv)
app);
g_application_add_main_option (G_APPLICATION (app), "run", 0, 0, G_OPTION_ARG_STRING, "Run an example", "EXAMPLE");
- g_application_add_main_option (G_APPLICATION (app), "autoquit", 0, 0, G_OPTION_ARG_INT, "Quit after a delay", "SECONDS");
+ g_application_add_main_option (G_APPLICATION (app), "autoquit", 0, 0, G_OPTION_ARG_NONE, "Quit after a delay", NULL);
g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);