From 939b31ae3d4d1b772b339e526ec6db9c8636e6dd Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 9 Jan 2016 18:06:17 +0000 Subject: [PATCH] #6051: `transmission-gtk --version` shouldn't require display --- gtk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index c8fc6b3ad..3705d31bc 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -643,13 +643,12 @@ main (int argc, char ** argv) #if !GLIB_CHECK_VERSION(2,35,4) g_type_init (); #endif - gtk_init (&argc, &argv); g_set_application_name (_("Transmission")); - gtk_window_set_default_icon_name (MY_CONFIG_NAME); /* parse the command line */ option_context = g_option_context_new (_("[torrent files or urls]")); g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); + g_option_context_add_group (option_context, gtk_get_option_group (FALSE)); g_option_context_set_translation_domain (option_context, GETTEXT_PACKAGE); if (!g_option_context_parse (option_context, &argc, &argv, &error)) { @@ -667,6 +666,8 @@ main (int argc, char ** argv) return 0; } + gtk_window_set_default_icon_name (MY_CONFIG_NAME); + /* init the unit formatters */ tr_formatter_mem_init (mem_K, _ (mem_K_str), _ (mem_M_str), _ (mem_G_str), _ (mem_T_str)); tr_formatter_size_init (disk_K, _ (disk_K_str), _ (disk_M_str), _ (disk_G_str), _ (disk_T_str));