]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Suppress GTK warnings and errors
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 3 Jan 2018 11:45:33 +0000 (22:45 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 3 Jan 2018 11:45:33 +0000 (22:45 +1100)
18 files changed:
libs/gtkutil/filechooser.cpp
libs/gtkutil/toolbar.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/autosave.cpp
radiant/commands.cpp
radiant/console.cpp
radiant/entityinspector.cpp
radiant/gtkdlgs.cpp
radiant/main.cpp
radiant/mainframe.cpp
radiant/patchdialog.cpp
radiant/preferences.cpp
radiant/qe3.cpp
radiant/texwindow.cpp
radiant/url.cpp
radiant/watchbsp.cpp
radiant/xywindow.cpp

index 38b6636e59af8c0a84345381960b1d4dd843bdb3..2e7a921a11bf08431e86b8e09832e6fe5a461f5a 100644 (file)
@@ -271,9 +271,9 @@ const char* file_dialog( ui::Window parent, bool open, const char* title, const
                const char* file = file_dialog_show( parent, open, title, path, pattern, want_load, want_import, want_save );
 
                if ( open
-                        || file == 0
+                        || !file
                         || !file_exists( file )
-                        || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::Question ) == ui::alert_response::YES ) {
+                        || ui::alert(parent, "The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::Question ) == ui::alert_response::YES ) {
                        return file;
                }
        }
index 7ff7f9a8c197664c35f3ab33962bedd50a12a7aa..049d05ec1fc62fd4684ecb79661fb54077a70551 100644 (file)
@@ -57,13 +57,13 @@ ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* descripti
        return toolbar_append_button( toolbar, description, icon, command.m_callback );
 }
 
-void toggle_button_set_active_callback(ui::ToggleToolButton& button, bool active ){
+void toggle_button_set_active_callback(void *it, bool active ){
+       auto button = ui::ToggleToolButton::from(it);
        toggle_button_set_active_no_signal( button, active );
 }
-using ToggleButtonSetActiveCaller = ReferenceCaller<ui::ToggleToolButton, void(bool), toggle_button_set_active_callback>;
 
 ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle ){
        auto button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback );
-       toggle.m_exportCallback( ToggleButtonSetActiveCaller( button ) );
+       toggle.m_exportCallback( PointerCaller<void, void(bool), toggle_button_set_active_callback>( button._handle ) );
        return button;
 }
index 1b19229146ead12332f04c0f374cac2fa1434528..1f4acb1fc7fec334f8501cd33d285bea319d40e3 100644 (file)
@@ -36,8 +36,6 @@ namespace ui {
         }
     }
 
-    Widget root{ui::null};
-
 #define IMPL(T, F) template<> _IMPL(T, F)
 #define _IMPL(T, F) struct verify<T *> { using self = T; static self test(self it) { return self::from(F(it)); } }
 
@@ -145,31 +143,6 @@ namespace ui {
     )))
     {}
 
-    alert_response IWindow::alert(std::string text, std::string title, alert_type type, alert_icon icon)
-    {
-        auto ret = gtk_MessageBox(this, text.c_str(),
-                                  title.c_str(),
-                                  type == alert_type::OK ? eMB_OK :
-                                  type == alert_type::OKCANCEL ? eMB_OKCANCEL :
-                                  type == alert_type::YESNO ? eMB_YESNO :
-                                  type == alert_type::YESNOCANCEL ? eMB_YESNOCANCEL :
-                                  type == alert_type::NOYES ? eMB_NOYES :
-                                  eMB_OK,
-                                  icon == alert_icon::Default ? eMB_ICONDEFAULT :
-                                  icon == alert_icon::Error ? eMB_ICONERROR :
-                                  icon == alert_icon::Warning ? eMB_ICONWARNING :
-                                  icon == alert_icon::Question ? eMB_ICONQUESTION :
-                                  icon == alert_icon::Asterisk ? eMB_ICONASTERISK :
-                                  eMB_ICONDEFAULT
-        );
-        return
-                ret == eIDOK ? alert_response::OK :
-                ret == eIDCANCEL ? alert_response::CANCEL :
-                ret == eIDYES ? alert_response::YES :
-                ret == eIDNO ? alert_response::NO :
-                alert_response::OK;
-    }
-
     Window IWindow::create_dialog_window(const char *title, void func(), void *data, int default_w, int default_h)
     {
         return Window(::create_dialog_window(this, title, func, data, default_w, default_h));
@@ -468,4 +441,33 @@ namespace ui {
 #endif
     }
 
+    // global
+
+    Window root{ui::null};
+
+    alert_response alert(Window parent, std::string text, std::string title, alert_type type, alert_icon icon)
+    {
+        auto ret = gtk_MessageBox(parent, text.c_str(),
+                                  title.c_str(),
+                                  type == alert_type::OK ? eMB_OK :
+                                  type == alert_type::OKCANCEL ? eMB_OKCANCEL :
+                                  type == alert_type::YESNO ? eMB_YESNO :
+                                  type == alert_type::YESNOCANCEL ? eMB_YESNOCANCEL :
+                                  type == alert_type::NOYES ? eMB_NOYES :
+                                  eMB_OK,
+                                  icon == alert_icon::Default ? eMB_ICONDEFAULT :
+                                  icon == alert_icon::Error ? eMB_ICONERROR :
+                                  icon == alert_icon::Warning ? eMB_ICONWARNING :
+                                  icon == alert_icon::Question ? eMB_ICONQUESTION :
+                                  icon == alert_icon::Asterisk ? eMB_ICONASTERISK :
+                                  eMB_ICONDEFAULT
+        );
+        return
+                ret == eIDOK ? alert_response::OK :
+                ret == eIDCANCEL ? alert_response::CANCEL :
+                ret == eIDYES ? alert_response::YES :
+                ret == eIDNO ? alert_response::NO :
+                alert_response::OK;
+    }
+
 }
index 7409913b5648ab3ca7c4811ba04b52846e05d432..d795b75834659eff96b1e79d1514837f152b3d32 100644 (file)
@@ -84,31 +84,6 @@ namespace ui {
 
     void process();
 
-    extern class Widget root;
-
-    enum class alert_type {
-        OK,
-        OKCANCEL,
-        YESNO,
-        YESNOCANCEL,
-        NOYES,
-    };
-
-    enum class alert_icon {
-        Default,
-        Error,
-        Warning,
-        Question,
-        Asterisk,
-    };
-
-    enum class alert_response {
-        OK,
-        CANCEL,
-        YES,
-        NO,
-    };
-
     enum class window_type {
         TOP,
         POPUP
@@ -167,8 +142,8 @@ namespace ui {
         };
     }
 
-    extern struct Null {} null;
-    extern struct New_t {} New;
+    const struct Null {} null = {};
+    const struct New_t {} New = {};
 
     class Object :
             public details::Convertible<Object, _GtkObject *, details::Convert::Explicit>,
@@ -213,9 +188,9 @@ namespace ui {
         using self = name *; \
         using native = T *; \
     protected: \
-        explicit name(native h) : super(reinterpret_cast<super::native>(h)) {} \
+        explicit name(native h) noexcept : super(reinterpret_cast<super::native>(h)) {} \
     public: \
-        explicit name(Null n) : name((native) nullptr) {} \
+        explicit name(Null n) noexcept : name((native) nullptr) {} \
         explicit name(New_t); \
         static name from(native h) { return name(h); } \
         static name from(void *ptr) { return name((native) ptr); } \
@@ -288,13 +263,6 @@ namespace ui {
     WRAP(Window, Bin, _GtkWindow, (),
          explicit Window(window_type type);
     ,
-         alert_response alert(
-                 std::string text,
-                 std::string title = "NetRadiant",
-                 alert_type type = alert_type::OK,
-                 alert_icon icon = alert_icon::Default
-         );
-
          Window create_dialog_window(
                  const char *title,
                  void func(),
@@ -587,6 +555,41 @@ namespace ui {
 
 #undef WRAP
 
+    // global
+
+    enum class alert_response {
+        OK,
+        CANCEL,
+        YES,
+        NO,
+    };
+
+    enum class alert_type {
+        OK,
+        OKCANCEL,
+        YESNO,
+        YESNOCANCEL,
+        NOYES,
+    };
+
+    enum class alert_icon {
+        Default,
+        Error,
+        Warning,
+        Question,
+        Asterisk,
+    };
+
+    extern class Window root;
+
+    alert_response alert(
+            Window parent,
+            std::string text,
+            std::string title = "NetRadiant",
+            alert_type type = alert_type::OK,
+            alert_icon icon = alert_icon::Default
+    );
+
     // callbacks
 
     namespace {
index c3eaf7660bc347f5aa587adb6735413d89a7c0a3..9921d4be4d9cd100e6b109cabab3b87fc3345f0c 100644 (file)
@@ -93,7 +93,7 @@ void Map_Snapshot(){
        {
                StringOutputStream strMsg( 256 );
                strMsg << "Snapshot save failed.. unabled to create directory\n" << snapshotsDir.c_str();
-               MainFrame_getWindow().alert( strMsg.c_str() );
+               ui::alert( MainFrame_getWindow(), strMsg.c_str() );
        }
 }
 /*
index f5148e09242ec7074b82f9742e74cc182936f846..9c1b7682246febb16f70c082faba1da1b418dbd2 100644 (file)
@@ -306,7 +306,7 @@ public:
                        StringOutputStream msg;
                        msg << "The command " << name << " is already assigned to the key " << accelerator << ".\n\n"
                                << "Do you want to unassign " << name << " first?";
-                       auto r = widget.window().alert( msg.c_str(), "Key already used", ui::alert_type::YESNOCANCEL );
+                       auto r = ui::alert( widget.window(), msg.c_str(), "Key already used", ui::alert_type::YESNOCANCEL );
                        if ( r == ui::alert_response::YES ) {
                                // clear the ACTUAL accelerator too!
                                disconnect_accelerator( name );
index 55c13772db6a0e51122ad70ddb998aff62e7f687..82b08e3c2ab5468ca1919e0a094dd0a99af7a9e7 100644 (file)
@@ -67,7 +67,7 @@ void Sys_LogFile( bool enable ){
                                                                 << "This is NetRadiant '" RADIANT_VERSION "' compiled " __DATE__ "\n" RADIANT_ABOUTMSG "\n";
                }
                else{
-                       ui::root.window().alert( "Failed to create log file, check write permissions in Radiant directory.\n",
+                       ui::alert( ui::root, "Failed to create log file, check write permissions in Radiant directory.\n",
                                                        "Console logging", ui::alert_type::OK, ui::alert_icon::Error );
                }
        }
index b91d14cce54197f918436d8979bda86b1bbc3436..e74dd3f0834f637719ed9c0c2d9fcda4b72d0638 100644 (file)
@@ -1089,7 +1089,7 @@ void EntityClassList_createEntity(){
        GtkTreeModel* model;
        GtkTreeIter iter;
        if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( g_entityClassList ), &model, &iter ) == FALSE ) {
-               view.window().alert( "You must have a selected class to create an entity", "info" );
+               ui::alert( view.window(), "You must have a selected class to create an entity", "info" );
                return;
        }
 
@@ -1117,14 +1117,14 @@ void EntityInspector_applyKeyValue(){
 
        // TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity
        if ( !strcmp( key.c_str(), "classname" ) && !strcmp( value.c_str(), "worldspawn" ) ) {
-               g_entityKeyEntry.window().alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
+               ui::alert( g_entityKeyEntry.window(), "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
                return;
        }
 
 
        // RR2DO2: we don't want spaces in entity keys
        if ( strstr( key.c_str(), " " ) ) {
-               g_entityKeyEntry.window().alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
+               ui::alert( g_entityKeyEntry.window(), "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
                return;
        }
 
index 1bb44cf1d1f8f8a4fcc9b6cb40337c174430b6d9..a7e3fbce744b6186b970cb5136e720132e191ddd 100644 (file)
@@ -673,7 +673,7 @@ static ui::Window text_editor{ui::null};
 static ui::Widget text_widget{ui::null}; // slave, text widget from the gtk editor
 
 static gint editor_delete( ui::Widget widget, gpointer data ){
-       if ( widget.window().alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+       if ( ui::alert( widget.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return TRUE;
        }
 
@@ -687,7 +687,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
        gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
 
        if ( f == 0 ) {
-               ui::Widget::from(data).window().alert( "Error saving file !" );
+               ui::alert( ui::Widget::from(data).window(), "Error saving file !" );
                return;
        }
 
@@ -697,7 +697,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
 }
 
 static void editor_close( ui::Widget widget, gpointer data ){
-       if ( text_editor.window().alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+       if ( ui::alert( text_editor.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return;
        }
 
index bad501209f8fe39ae0f2af1e1f657299c3099c4f..0fea7c2bc4cfc7218d3e32ddc01474e6f592af5a 100644 (file)
@@ -304,7 +304,7 @@ bool handleMessage(){
                ScopedLock lock( m_lock );
 #if GDEF_DEBUG
                m_buffer << "Break into the debugger?\n";
-               bool handled = ui::root.window().alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::Error ) == ui::alert_response::NO;
+               bool handled = alert( ui::root, m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::Error ) == ui::alert_response::NO;
                m_buffer.clear();
                return handled;
 #else
@@ -418,7 +418,7 @@ void create_global_pid(){
                if ( remove( g_pidFile.c_str() ) == -1 ) {
                        StringOutputStream msg( 256 );
                        msg << "WARNING: Could not delete " << g_pidFile.c_str();
-                       ui::root.window().alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
+                       ui::alert( ui::root, msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
                }
 
                // in debug, never prompt to clean registry, turn console logging auto after a failed start
@@ -459,7 +459,7 @@ void remove_global_pid(){
        if ( remove( g_pidFile.c_str() ) == -1 ) {
                StringOutputStream msg( 256 );
                msg << "WARNING: Could not delete " << g_pidFile.c_str();
-               ui::root.window().alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
+               ui::alert( ui::root, msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
        }
 }
 
@@ -477,7 +477,7 @@ void create_local_pid(){
                if ( remove( g_pidGameFile.c_str() ) == -1 ) {
                        StringOutputStream msg;
                        msg << "WARNING: Could not delete " << g_pidGameFile.c_str();
-                       ui::root.window().alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
+                       ui::alert( ui::root, msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
                }
 
                // in debug, never prompt to clean registry, turn console logging auto after a failed start
index 39db3b90166fbed306caef5a0d273e330160a8e3..0baee4873e703dd6e5abd6ba448a65f9fdfdaba2 100644 (file)
@@ -2655,15 +2655,15 @@ void MainFrame::OnSleep(){
 
 
 ui::Window create_splash(){
-       ui::Window window = ui::Window( ui::window_type::TOP );
-       gtk_window_set_decorated( window, FALSE );
-       gtk_window_set_resizable( window, FALSE );
-       gtk_window_set_modal( window, TRUE );
-       gtk_window_set_default_size( window, -1, -1 );
-       gtk_window_set_position( window, GTK_WIN_POS_CENTER );
-       gtk_container_set_border_width( GTK_CONTAINER( window ), 0 );
-
-       auto image = new_local_image( "splash.png" );
+       auto window = ui::Window( ui::window_type::TOP );
+       gtk_window_set_decorated(window, false);
+       gtk_window_set_resizable(window, false);
+       gtk_window_set_modal(window, true);
+       gtk_window_set_default_size(window, -1, -1);
+       gtk_window_set_position(window, GTK_WIN_POS_CENTER);
+       gtk_container_set_border_width(window, 0);
+
+       auto image = new_local_image("splash.png");
        image.show();
        window.add(image);
 
index 906c47081683152c439fa58f40ca1f3fec8fe579..6a29298d592f8de1a599863a37669c572c66af22 100644 (file)
@@ -491,7 +491,7 @@ static void OnSpinChanged(ui::Adjustment adj, gpointer data ){
        }
 
        // update the point-by-point view
-       OnSelchangeComboColRow( ui::root ,0 );
+       OnSelchangeComboColRow( ui::root0 );
 }
 
 static gint OnDialogKey( ui::Widget widget, GdkEventKey* event, gpointer data ){
index 4c3e0e15df3609a69194c757ac3fb8d2487a8d48..091a88f36324bb884e4c203bebe28b374995a009 100644 (file)
@@ -475,7 +475,7 @@ CGameDialog g_GamesDialog;
 
 static void OnButtonClean( ui::Widget widget, gpointer data ){
        // make sure this is what the user wants
-       if ( g_Preferences.GetWidget().alert( "This will close Radiant and clean the corresponding registry entries.\n"
+       if ( ui::alert( g_Preferences.GetWidget(), "This will close Radiant and clean the corresponding registry entries.\n"
                                                                                                                                  "Next time you start Radiant it will be good as new. Do you wish to continue?",
                                                 "Reset Registry", ui::alert_type::YESNO, ui::alert_icon::Asterisk ) == ui::alert_response::YES ) {
                PrefsDlg *dlg = (PrefsDlg*)data;
@@ -913,7 +913,7 @@ void PreferencesDialog_showDialog(){
                        {
                                message << ( *i ) << '\n';
                        }
-                       MainFrame_getWindow().alert( message.c_str() );
+                       ui::alert( MainFrame_getWindow(), message.c_str() );
                        g_restart_required.clear();
                }
        }
index b2b61791c02bb76cee32af1e0930dc16fa098f2e..7d39afe628a1c55d7d59d48f7e9f46bc55cd6cbf 100644 (file)
@@ -143,7 +143,7 @@ bool ConfirmModified( const char* title ){
                return true;
        }
 
-       auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question );
+       auto result = ui::alert( MainFrame_getWindow(), "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question );
        if ( result == ui::alert_response::CANCEL ) {
                return false;
        }
index 34a9f9260663cbb0bc07bbd0a15cc026808c74b4..cc31400e9ac20e308591ce7657f789f75886cbd5 100644 (file)
@@ -259,7 +259,7 @@ CopiedString shader;
 ui::Window m_parent{ui::null};
 ui::GLArea m_gl_widget{ui::null};
 ui::Widget m_texture_scroll{ui::null};
-ui::TreeView m_treeViewTree{ui::null};
+ui::TreeView m_treeViewTree{ui::New};
 ui::TreeView m_treeViewTags{ui::null};
 ui::Frame m_tag_frame{ui::null};
 ui::ListStore m_assigned_store{ui::null};
@@ -1586,7 +1586,6 @@ void TreeView_onRowActivated( ui::TreeView treeview, ui::TreePath path, ui::Tree
 }
 
 void TextureBrowser_createTreeViewTree(){
-       g_TextureBrowser.m_treeViewTree = ui::TreeView(ui::New);
        gtk_tree_view_set_enable_search(g_TextureBrowser.m_treeViewTree, FALSE );
 
        gtk_tree_view_set_headers_visible(g_TextureBrowser.m_treeViewTree, FALSE );
@@ -2321,7 +2320,7 @@ void TextureBrowser_renameTag(){
        }
        else
        {
-               g_TextureBrowser.m_parent.alert( "Select a single tag for renaming." );
+               ui::alert( g_TextureBrowser.m_parent, "Select a single tag for renaming." );
        }
 }
 
@@ -2332,7 +2331,7 @@ void TextureBrowser_deleteTag(){
        gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
 
        if ( g_slist_length( selected ) == 1 ) { // we only delete a single tag
-               auto result = g_TextureBrowser.m_parent.alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question );
+               auto result = ui::alert( g_TextureBrowser.m_parent, "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question );
 
                if ( result == ui::alert_response::YES ) {
                        GtkTreeIter iterSelected;
@@ -2361,7 +2360,7 @@ void TextureBrowser_deleteTag(){
                }
        }
        else {
-               g_TextureBrowser.m_parent.alert( "Select a single tag for deletion." );
+               ui::alert( g_TextureBrowser.m_parent, "Select a single tag for deletion." );
        }
 }
 
@@ -2453,7 +2452,7 @@ void TextureBrowser_showAll(){
 }
 
 void TextureBrowser_showUntagged(){
-       auto result = g_TextureBrowser.m_parent.alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning );
+       auto result = ui::alert( g_TextureBrowser.m_parent, "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning );
 
        if ( result == ui::alert_response::YES ) {
                g_TextureBrowser.m_found_shaders.clear();
index 425948f8ca5bf00d426a1a49e9294090208c4391..f49cb88664623315c2b08c51e9255d8e5f1fdd94 100644 (file)
@@ -57,6 +57,6 @@ void OpenURL( const char *url ){
        // let's put a little comment
        globalOutputStream() << "OpenURL: " << url << "\n";
        if ( !open_url( url ) ) {
-               MainFrame_getWindow().alert( "Failed to launch browser!" );
+               ui::alert( MainFrame_getWindow(), "Failed to launch browser!" );
        }
 }
index 8cc81fb11ed918f132574a628047fe35c66559bc..bbae3fab77af86854c191e8d4656fd249961213e 100644 (file)
@@ -516,7 +516,7 @@ void CWatchBSP::DoEBeginStep(){
        if ( SetupListening() == false ) {
                const char* msg = "Failed to get a listening socket on port 39000.\nTry running with Build monitoring disabled if you can't fix this.\n";
                globalOutputStream() << msg;
-               MainFrame_getWindow().alert( msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
+               ui::alert( MainFrame_getWindow(), msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }
        // set the timer for timeouts and step cancellation
@@ -533,7 +533,7 @@ void CWatchBSP::DoEBeginStep(){
                        msg << reinterpret_cast<const char*>( g_ptr_array_index( m_pCmd, m_iCurrentStep ) );
                        msg << "\nCheck that the file exists and that you don't run out of system resources.\n";
                        globalOutputStream() << msg.c_str();
-                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
+                       ui::alert( MainFrame_getWindow(), msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                        return;
                }
                // re-initialise the debug window
@@ -613,7 +613,7 @@ void CWatchBSP::RoutineProcessing(){
        case EBeginStep:
                // timeout: if we don't get an incoming connection fast enough, go back to idle
                if ( g_timer_elapsed( m_pTimer, NULL ) > g_WatchBSP_Timeout ) {
-                       MainFrame_getWindow().alert(  "The connection timed out, assuming the build process failed\nMake sure you are using a networked version of Q3Map?\nOtherwise you need to disable BSP Monitoring in prefs.", "BSP process monitoring", ui::alert_type::OK );
+                       ui::alert( MainFrame_getWindow(), "The connection timed out, assuming the build process failed\nMake sure you are using a networked version of Q3Map?\nOtherwise you need to disable BSP Monitoring in prefs.", "BSP process monitoring", ui::alert_type::OK );
                        EndMonitoringLoop();
 #if 0
                        if ( m_bBSPPlugin ) {
@@ -746,7 +746,7 @@ void CWatchBSP::RoutineProcessing(){
                                                        StringOutputStream msg;
                                                        msg << "Failed to execute the following command: " << cmd.c_str() << cmdline.c_str();
                                                        globalOutputStream() << msg.c_str();
-                                                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
+                                                       ui::alert( MainFrame_getWindow(), msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                                                }
                                        }
                                        EndMonitoringLoop();
@@ -774,7 +774,7 @@ void CWatchBSP::DoMonitoringLoop( GPtrArray *pCmd, const char *sBSPName ){
        if ( m_eState != EIdle ) {
                globalOutputStream() << "WatchBSP got a monitoring request while not idling...\n";
                // prompt the user, should we cancel the current process and go ahead?
-               if ( MainFrame_getWindow().alert( "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?",
+               if ( ui::alert( MainFrame_getWindow(), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?",
                                                         "Build process monitoring", ui::alert_type::YESNO ) == ui::alert_response::YES ) {
                        // disconnect and set EIdle state
                        Reset();
index bff13b367d3001030994bcea494a22aeb36118e9..54d121f3907975f9205bcc95a43e5e6f21f7264d 100644 (file)
@@ -1488,7 +1488,7 @@ void XYWnd::XY_DisableBackground( void ){
 void WXY_BackgroundSelect( void ){
        bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
        if ( !brushesSelected ) {
-               ui::root.window().alert( "You have to select some brushes to get the bounding box for.\n",
+               ui::alert( ui::root, "You have to select some brushes to get the bounding box for.\n",
                                                "No selection", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }