From: Thomas Debesse Date: Tue, 21 Jun 2022 03:21:49 +0000 (+0200) Subject: Merge commit '87f4eea939309a5ea1972323e237d23afdf01104' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ef95e672ce206374ddb021de7771751e18099f4a;p=xonotic%2Fnetradiant.git Merge commit '87f4eea939309a5ea1972323e237d23afdf01104' into master-merge --- ef95e672ce206374ddb021de7771751e18099f4a diff --cc contrib/bobtoolz/dialogs/dialogs-gtk.cpp index a5732ff5,ad444679..be0e4add --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@@ -211,7 -212,8 +213,8 @@@ EMessageBoxReturn DoMessageBox( const c int loop = 1; auto window = ui::Window( ui::window_type::TOP ); + gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); - window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + 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 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); @@@ -405,8 -407,9 +408,9 @@@ EMessageBoxReturn DoPolygonBox( Polygon int loop = 1; auto window = ui::Window( ui::window_type::TOP ); + gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); - window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + 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, "Polygon Builder" ); @@@ -1272,10 -1278,14 +1277,12 @@@ EMessageBoxReturn DoResetTextureBox( Re EMessageBoxReturn ret; int loop = 1; - auto window = ui::Window( ui::window_type::TOP ); + 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_modal( GTK_WINDOW( window ), TRUE ); - window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); - gtk_window_set_title( window, "Texture Reset" ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); diff --cc contrib/brushexport/interface.cpp index 068325ea,ec661495..ead26789 --- a/contrib/brushexport/interface.cpp +++ b/contrib/brushexport/interface.cpp @@@ -4,7 -4,7 +4,8 @@@ #include "debugging/debugging.h" #include "callbacks.h" #include "support.h" +#include "gtkutil/dialog.h" + #include "plugin.h" #define GLADE_HOOKUP_OBJECT( component,widget,name ) \ g_object_set_data_full( G_OBJECT( component ), name, \ @@@ -14,12 -14,14 +15,14 @@@ g_object_set_data( G_OBJECT( component ), name, (void *) widget ) // created by glade -ui::Widget create_w_plugplug2( void ){ +ui::Widget create_w_plugplug2( ui::Window main_window ){ GSList *r_collapse_group = NULL; + ModalDialog dialog; - auto w_plugplug2 = ui::Window( ui::window_type::TOP ); + auto w_plugplug2 = main_window.create_dialog_window( "BrushExport", G_CALLBACK( dialog_delete_callback ), &dialog ); gtk_widget_set_name( w_plugplug2, "w_plugplug2" ); - gtk_window_set_title( w_plugplug2, "BrushExport-Plugin 3.0 by namespace" ); + gtk_window_set_position( GTK_WINDOW( w_plugplug2 ), GTK_WIN_POS_CENTER_ON_PARENT ); + gtk_window_set_transient_for( GTK_WINDOW( w_plugplug2 ), GTK_WINDOW( g_pRadiantWnd ) ); gtk_window_set_destroy_with_parent( w_plugplug2, TRUE ); auto vbox1 = ui::VBox( FALSE, 0 ); diff --cc contrib/brushexport/plugin.h index a2dc6cb6,b0f4b058..5808cd98 --- a/contrib/brushexport/plugin.h +++ b/contrib/brushexport/plugin.h @@@ -22,7 -22,8 +22,11 @@@ #if !defined( INCLUDED_BRUSH_EXPORT_H ) #define INCLUDED_BRUSH_EXPORT_H + #include + +#define PLUGIN_NAME "BrushExport" +#define PLUGIN_VERSION "2.0" + + extern ui::Widget g_pRadiantWnd; + #endif diff --cc contrib/prtview/ConfigDialog.cpp index 688a66b1,3b3e80c0..d030b55e --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@@ -61,7 -58,10 +59,9 @@@ static int DoColor( PackedColour *c ) clr.green = (guint16) (GetBValue(*c) * (65535 / 255)); auto dlg = ui::Widget::from(gtk_color_selection_dialog_new( "Choose Color" )); - gtk_window_set_transient_for( GTK_WINDOW( dlg ), config_dialog ); - + gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) ); + gtk_window_set_position( GTK_WINDOW( dlg ),GTK_WIN_POS_CENTER_ON_PARENT ); + gtk_window_set_modal( GTK_WINDOW( dlg ), TRUE ); gtk_color_selection_set_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), &clr ); dlg.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); dlg.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); @@@ -237,16 -237,22 +237,18 @@@ static void OnClip(ui::Widget widget, g SceneChangeNotify(); } -void DoConfigDialog(){ +void DoConfigDialog( ui::Window main_window ){ int loop = 1, ret = IDCANCEL; + ModalDialog dialog; - auto dlg = main_window.create_dialog_window( "Portal Viewer Configuration", G_CALLBACK( custom_dialog_delete_callback ), &dialog ); - - dlg.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); + auto dlg = ui::Window( ui::window_type::TOP ); - - gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) ); - gtk_window_set_position( GTK_WINDOW( dlg ),GTK_WIN_POS_CENTER_ON_PARENT ); - gtk_window_set_modal( GTK_WINDOW( dlg ), TRUE ); - + gtk_window_set_title( dlg, "Portal Viewer Configuration" ); + dlg.connect( "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + dlg.connect( "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); - config_dialog = dlg; auto vbox = ui::VBox( FALSE, 5 ); vbox.show(); diff --cc contrib/prtview/prtview.cpp index 14aeec13,fe6bf41a..b99d2086 --- a/contrib/prtview/prtview.cpp +++ b/contrib/prtview/prtview.cpp @@@ -198,12 -203,11 +198,14 @@@ static const char *PLUGIN_COMMANDS Q3R_CMD_LOAD; + ui::Widget g_pRadiantWnd{ui::null}; const char* QERPlug_Init( void *hApp, void* pMainWidget ){ + g_pRadiantWnd = ui::Window::from(pMainWidget); - return "Portal Viewer for Q3Radiant"; + main_window = ui::Window::from(pMainWidget); + ASSERT_TRUE( main_window ); + + return PLUGIN_NAME " for " RADIANT_NAME; } const char* QERPlug_GetName(){ diff --cc contrib/prtview/prtview.h index e6942cc9,96b77b5d..00282102 --- a/contrib/prtview/prtview.h +++ b/contrib/prtview/prtview.h @@@ -20,10 -20,9 +20,12 @@@ #if !defined( INCLUDED_PRTVIEW_H ) #define INCLUDED_PRTVIEW_H + #include + -#define MSG_PREFIX "Portal Viewer plugin: " +#define PLUGIN_NAME "Portal Viewer" +#define PLUGIN_VERSION "1.0" + +#define MSG_PREFIX PLUGIN_NAME " plugin: " void InitInstance(); void SaveConfig(); diff --cc radiant/mainframe.cpp index f1263dfd,01399dfb..6aa3e9f7 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -2432,8 -2355,8 +2436,8 @@@ ui::MenuItem create_help_menu() create_game_help_menu( menu ); create_menu_item_with_mnemonic( menu, "Bug report", makeCallbackF(OpenBugReportURL) ); - create_menu_item_with_mnemonic( menu, "Shortcuts list", makeCallbackF(DoCommandListDlg) ); + create_menu_item_with_mnemonic( menu, "Shortcuts", makeCallbackF(DoCommandListDlg) ); - create_menu_item_with_mnemonic( menu, "_About", makeCallbackF(DoAbout) ); + create_menu_item_with_mnemonic( menu, "_About...", makeCallbackF(DoAbout) ); return help_menu_item; } diff --cc radiant/xywindow.cpp index 63ef5973,f1d3888a..5024d68f --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@@ -827,11 -822,12 +827,11 @@@ gboolean xywnd_expose( ui::Widget widge return FALSE; } - void XYWnd_CameraMoved( XYWnd& xywnd ){ - if ( g_xywindow_globals_private.m_bCamXYUpdate ) { + // if ( g_xywindow_globals_private.m_bCamXYUpdate ) { //XYWnd_Update( xywnd ); xywnd.UpdateCameraIcon(); - } + // } } XYWnd::XYWnd() :