]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '87f4eea939309a5ea1972323e237d23afdf01104' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 03:21:49 +0000 (05:21 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 03:21:49 +0000 (05:21 +0200)
15 files changed:
1  2 
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/funchandlers-GTK.cpp
contrib/brushexport/interface.cpp
contrib/brushexport/plugin.cpp
contrib/brushexport/plugin.h
contrib/gtkgensurf/plugin.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
radiant/camwindow.cpp
radiant/mainframe.cpp
radiant/mainframe.h
radiant/preferences.cpp
radiant/xywindow.cpp
radiant/xywindow.h

index a5732ff5cb30b00b87a9dd79221bb8905f0680ff,ad4446795e45386b418ad7f697df927d55ccefe4..be0e4add1c7f463d4e9ec3dace5007318cecbbd3
@@@ -211,7 -212,8 +213,8 @@@ EMessageBoxReturn DoMessageBox( const c
        int loop = 1;
  
        auto window = ui::Window( ui::window_type::TOP );
 -      window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
 +      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 );
Simple merge
index 068325ea2bbf88b6a56d00026bfaa5806e162822,ec661495ede3ee4a76e9b0add6a031b9686588bb..ead267890a0326d55f109f274e996afe93cf0bf1
@@@ -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, \
        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 );
Simple merge
index a2dc6cb63edc734f2af1377da84862ecde7d85f5,b0f4b05861e6c89eb7f11c5bd8702baff9afa0e9..5808cd98d8578a1ad9977dc5302905c1d69e5896
  #if !defined( INCLUDED_BRUSH_EXPORT_H )
  #define INCLUDED_BRUSH_EXPORT_H
  
+ #include <uilib/uilib.h>
 +#define PLUGIN_NAME "BrushExport"
 +#define PLUGIN_VERSION "2.0"
 +
+ extern ui::Widget g_pRadiantWnd;
  #endif
Simple merge
index 688a66b18f20223bf611af831e12dee113208642,3b3e80c05b8d1b4b52041ce984f1df9411ebf6f4..d030b55ee327bfcb05ad012c8c777c2b4cd6f1be
@@@ -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();
index 14aeec1325bb80feec981cda000f8170d6c21bb0,fe6bf41a8ba47798c57c137c5a5c6aa1d22daa2d..b99d2086f66b3a37cce1e7be0320ddd1b942f598
@@@ -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 ){
 -      return "Portal Viewer for Q3Radiant";
+       g_pRadiantWnd = ui::Window::from(pMainWidget);
 +      main_window = ui::Window::from(pMainWidget);
 +      ASSERT_TRUE( main_window );
 +
 +      return PLUGIN_NAME " for " RADIANT_NAME;
  }
  
  const char* QERPlug_GetName(){
index e6942cc99ea3811b0ad7b6bd94c407c9b7092f68,96b77b5dcaf43412b75b654035a91c95c65994eb..0028210252742d41e6665b182525ab2dd36fd7db
  #if !defined( INCLUDED_PRTVIEW_H )
  #define INCLUDED_PRTVIEW_H
  
 -#define MSG_PREFIX "Portal Viewer plugin: "
+ #include <uilib/uilib.h>
 +#define PLUGIN_NAME "Portal Viewer"
 +#define PLUGIN_VERSION "1.0"
 +
 +#define MSG_PREFIX PLUGIN_NAME " plugin: "
  
  void InitInstance();
  void SaveConfig();
Simple merge
index f1263dfd031efb40a9aa489ad0942b8d0e578f30,01399dfb8896f13486277d7876e2d4374b0c5182..6aa3e9f7bde6c5ad370bbd686a560b989daec6ec
@@@ -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;
  }
Simple merge
Simple merge
index 63ef5973b107e3eb25f175ef1775795d639086c6,f1d3888a74c1eb9ba8c275b6a8cab361a2b564c6..5024d68f69246e5652d6ee7272db05eef3166cee
@@@ -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() :
Simple merge