]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/main.cpp
Rebase onto master
[xonotic/netradiant.git] / radiant / main.cpp
index 6620d662ab655410ab6033feb77e5ea1e983f70a..f86b18951048f3313831b64686a602fd58ba19b9 100644 (file)
@@ -70,7 +70,6 @@
 #include "iundo.h"
 
 #include "uilib/uilib.h"
 #include "iundo.h"
 
 #include "uilib/uilib.h"
-#include <gtk/gtk.h>
 
 #include "cmdlib.h"
 #include "os/file.h"
 
 #include "cmdlib.h"
 #include "os/file.h"
@@ -397,7 +396,7 @@ bool check_version(){
                msg << "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n"
                                "Make sure you run the right/latest editor binary you installed\n"
                        << AppPath_get();
                msg << "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n"
                                "Make sure you run the right/latest editor binary you installed\n"
                        << AppPath_get();
-               ui::alert( 0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONDEFAULT );
+               ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Default);
        }
        return bVerIsGood;
 #else
        }
        return bVerIsGood;
 #else
@@ -435,7 +434,7 @@ void create_global_pid(){
                           "The failure may be related to current global preferences.\n"
                           "Do you want to reset global preferences to defaults?";
 
                           "The failure may be related to current global preferences.\n"
                           "Do you want to reset global preferences to defaults?";
 
-               if ( ui::root.alert( msg.c_str(), "Radiant - Startup Failure", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::YES ) {
+               if ( ui::root.alert( msg.c_str(), "Radiant - Startup Failure", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::YES ) {
                        g_GamesDialog.Reset();
                }
 
                        g_GamesDialog.Reset();
                }
 
@@ -494,7 +493,7 @@ void create_local_pid(){
                           "The failure may be caused by current preferences.\n"
                           "Do you want to reset all preferences to defaults?";
 
                           "The failure may be caused by current preferences.\n"
                           "Do you want to reset all preferences to defaults?";
 
-               if ( ui::root.alert( msg.c_str(), "Radiant - Startup Failure", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::YES ) {
+               if ( ui::root.alert( msg.c_str(), "Radiant - Startup Failure", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::YES ) {
                        Preferences_Reset();
                }
 
                        Preferences_Reset();
                }
 
@@ -559,15 +558,10 @@ int main( int argc, char* argv[] ){
        }
 #endif
 
        }
 #endif
 
-       static GOptionEntry entries[] = {
-               { NULL }
-       };
-       GError *error = NULL;
        const char* mapname = NULL;
        const char* mapname = NULL;
-
-       gtk_disable_setlocale();
-       if ( !gtk_init_with_args( &argc, &argv, "<filename.map>", entries, NULL, &error) ) {
-               g_print( "%s\n", error->message );
+    char const *error = NULL;
+       if ( !ui::init( &argc, &argv, "<filename.map>", &error) ) {
+               g_print( "%s\n", error );
                return -1;
        }
 
                return -1;
        }
 
@@ -642,8 +636,6 @@ int main( int argc, char* argv[] ){
 
        Radiant_Initialise();
 
 
        Radiant_Initialise();
 
-       global_accel_init();
-
        user_shortcuts_init();
 
        g_pParentWnd = 0;
        user_shortcuts_init();
 
        g_pParentWnd = 0;
@@ -687,8 +679,6 @@ int main( int argc, char* argv[] ){
 
        user_shortcuts_save();
 
 
        user_shortcuts_save();
 
-       global_accel_destroy();
-
        Radiant_Shutdown();
 
        // close the log file if any
        Radiant_Shutdown();
 
        // close the log file if any