X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Fxywindow.cpp;h=6788f04453b1c9271759973f82d8a02ea0d8b550;hp=582d7105897b4582d8a2b89823ad65d56b79d2b9;hb=4850894c4bcdde654920195b7326cfa979ccd773;hpb=fea0d2e6575b21945c4800805d66e43a2247ded5 diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 582d7105..6788f044 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -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 ); }