From: TimePath Date: Sun, 30 Jul 2017 05:04:52 +0000 (+1000) Subject: Rebase onto master X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d1fc083d53ce4fd04949c76b590b4bdf6db73a70;p=xonotic%2Fnetradiant.git Rebase onto master --- diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 824af8ce..f2517224 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -11,10 +11,17 @@ namespace ui { - void init(int argc, char *argv[]) + bool init(int *argc, char **argv[], char const *parameter_string, char const **error) { gtk_disable_setlocale(); - gtk_init(&argc, &argv); + static GOptionEntry entries[] = {{NULL}}; + char const *translation_domain = NULL; + GError *gerror = NULL; + bool ret = gtk_init_with_args(argc, argv, parameter_string, entries, translation_domain, &gerror) != 0; + if (!ret) { + *error = gerror->message; + } + return ret; } void main() diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 72470990..511a40c3 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -76,7 +76,7 @@ struct ModalDialog; namespace ui { - void init(int argc, char *argv[]); + bool init(int *argc, char **argv[], char const *parameter_string, char const **error); void main(); diff --git a/radiant/main.cpp b/radiant/main.cpp index 975cb208..f86b1895 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -558,15 +558,10 @@ int main( int argc, char* argv[] ){ } #endif - static GOptionEntry entries[] = { - { NULL } - }; - GError *error = NULL; const char* mapname = NULL; - - gtk_disable_setlocale(); - if ( !gtk_init_with_args( &argc, &argv, "", entries, NULL, &error) ) { - g_print( "%s\n", error->message ); + char const *error = NULL; + if ( !ui::init( &argc, &argv, "", &error) ) { + g_print( "%s\n", error ); return -1; }