]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
contrib: fix bobToolz loading
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 03:30:11 +0000 (05:30 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 03:30:11 +0000 (05:30 +0200)
contrib/bobtoolz/CMakeLists.txt
contrib/bobtoolz/bobToolz-GTK.h
contrib/bobtoolz/dialogs/dialogs-gtk.cpp

index c9b83cb74e68326dfc7863cb13f4943435f6be2b..3425a1dfd5516a43e935abbb1f37a5526cc617c8 100644 (file)
@@ -2,7 +2,7 @@ radiant_plugin(bobtoolz
         dialogs/dialogs-gtk.cpp dialogs/dialogs-gtk.h
 
         bobToolz.h
-        bobToolz-GTK.cpp
+        bobToolz-GTK.cpp bobToolz-GTK.h
         bsploader.cpp bsploader.h
         cportals.cpp CPortals.h
         ctfresource_gtk.h
index e7dcce25ff58b8da5820e24a26ca8d65e69768a7..5e6b3d963730a92b0ea23b8f72457343c0facefb 100644 (file)
@@ -3,6 +3,6 @@
 
 #include <uilib/uilib.h>
 
-extern ui::Widget g_pRadiantWnd;
+static ui::Window main_window{ui::null};
 
 #endif
index be0e4add1c7f463d4e9ec3dace5007318cecbbd3..cfbf12c4071a757587a918d521be3c6256ffcce5 100644 (file)
@@ -213,7 +213,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
        int loop = 1;
 
        auto window = ui::Window( ui::window_type::TOP );
-       gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
+       gtk_window_set_transient_for( GTK_WINDOW( window ), main_window );
        window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL );
        window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_title( window, lpCaption );
@@ -408,7 +408,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
        int loop = 1;
 
        auto window = ui::Window( ui::window_type::TOP );
-       gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
+       gtk_window_set_transient_for( GTK_WINDOW( window ), main_window );
 
        window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL );
        window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
@@ -1278,7 +1278,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs, ui::Window main_window
        int loop = 1;
 
        auto window = main_window.create_dialog_window( "Texture Reset", G_CALLBACK( custom_dialog_delete_callback ), &dialog );
-       gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
+       gtk_window_set_transient_for( GTK_WINDOW( window ), main_window );
        gtk_window_set_modal( GTK_WINDOW( window ), TRUE );
 
        window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );