]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/xywindow.cpp
radiant/xywindow: center background select error message on main window
[xonotic/netradiant.git] / radiant / xywindow.cpp
index 582d7105897b4582d8a2b89823ad65d56b79d2b9..6788f04453b1c9271759973f82d8a02ea0d8b550 100644 (file)
@@ -792,7 +792,7 @@ XYWnd::XYWnd() :
        m_gl_widget( glwidget_new( FALSE ) ),
        m_deferredDraw( WidgetQueueDrawCaller( m_gl_widget ) ),
        m_deferred_motion( xywnd_motion, this ),
-       m_parent( 0 ),
+       m_parent( ui::null ),
        m_window_observer( NewWindowObserver() ),
        m_XORRectangle( m_gl_widget ),
        m_chasemouse_handler( 0 ){
@@ -1487,14 +1487,19 @@ void XYWnd::XY_DisableBackground( void ){
 
 void WXY_BackgroundSelect( void ){
        bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
+
+       ui::Window main_window = MainFrame_getWindow();
+
        if ( !brushesSelected ) {
-               ui::root.window().alert( "You have to select some brushes to get the bounding box for.\n",
+               ui::alert( main_window, "You have to select some brushes to get the bounding box for.\n",
                                                "No selection", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }
 
-       const char *filename = MainFrame_getWindow().file_dialog( TRUE, "Background Image", NULL, NULL );
+       const char *filename = main_window.file_dialog( TRUE, "Background Image", NULL, NULL );
+
        g_pParentWnd->ActiveXY()->XY_DisableBackground();
+
        if ( filename ) {
                g_pParentWnd->ActiveXY()->XY_LoadBackgroundImage( filename );
        }