From: Thomas Debesse Date: Mon, 22 Feb 2021 23:19:21 +0000 (+0100) Subject: Merge commit '0261afc6df181092b7d57751fec84e21d3ac593c' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=667d3275589dac91b5bfe96f0244183007be6efd;p=xonotic%2Fnetradiant.git Merge commit '0261afc6df181092b7d57751fec84e21d3ac593c' into garux-merge --- 667d3275589dac91b5bfe96f0244183007be6efd diff --cc plugins/mapq3/write.cpp index 4bfbbe78,f7becfee..cbf0ec05 --- a/plugins/mapq3/write.cpp +++ b/plugins/mapq3/write.cpp @@@ -72,12 -70,14 +72,16 @@@ bool pre( scene::Node &node ) const Entity* entity = Node_getEntity( node ); if ( entity != 0 ) { + if( entity->isContainer() && Node_getTraversable( node )->empty() && !string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ){ + globalErrorStream() << "discarding empty group entity: # = " << g_count_entities << "; classname = " << entity->getKeyValue( "classname" ) << "\n"; + return false; + } - m_writer.writeToken( "//" ); - m_writer.writeToken( "entity" ); - m_writer.writeUnsigned( g_count_entities++ ); - m_writer.nextLine(); + if ( m_writeComments ) { + m_writer.writeToken( "//" ); + m_writer.writeToken( "entity" ); + m_writer.writeUnsigned( g_count_entities++ ); + m_writer.nextLine(); + } m_writer.writeToken( "{" ); m_writer.nextLine(); diff --cc radiant/entityinspector.cpp index 81bcd06c,45232943..a2291f8f --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@@ -1216,8 -1233,8 +1216,8 @@@ static gint EntityClassList_keypress( u } // select the entity that starts with the key pressed - if ( code <= 'Z' && code >= 'A' ) { + if ( code <= 'Z' && code >= 'A' && event->state == 0 ) { - GtkTreeView* view = g_entityClassList; + auto view = ui::TreeView(g_entityClassList); GtkTreeModel* model; GtkTreeIter iter; if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE diff --cc radiant/mainframe.cpp index 61c364e0,75662b23..133b4a75 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -2620,36 -2454,40 +2620,40 @@@ ui::Toolbar create_main_toolbar( MainFr return toolbar; } -GtkWidget* create_main_statusbar( GtkWidget *pStatusLabel[c_count_status] ){ - GtkTable* table = GTK_TABLE( gtk_table_new( 1, c_count_status, FALSE ) ); - gtk_widget_show( GTK_WIDGET( table ) ); +ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){ + auto table = ui::Table( 1, c_count_status, FALSE ); + table.show(); { - GtkLabel* label = GTK_LABEL( gtk_label_new( "Label" ) ); + auto label = ui::Label( "Label" ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); gtk_misc_set_padding( GTK_MISC( label ), 4, 2 ); - gtk_widget_show( GTK_WIDGET( label ) ); - gtk_table_attach_defaults( table, GTK_WIDGET( label ), 0, 1, 0, 1 ); - pStatusLabel[c_command_status] = GTK_WIDGET( label ); + label.show(); + table.attach(label, {0, 1, 0, 1}); + pStatusLabel[c_command_status] = ui::Widget(label ); } - for ( int i = 1; i < c_count_status; ++i ) + for (unsigned int i = 1; (int) i < c_count_status; ++i) { - GtkFrame* frame = GTK_FRAME( gtk_frame_new( 0 ) ); - gtk_widget_show( GTK_WIDGET( frame ) ); - gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 ); + auto frame = ui::Frame(); + frame.show(); + table.attach(frame, {i, i + 1, 0, 1}); gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN ); - GtkLabel* label = GTK_LABEL( gtk_label_new( "Label" ) ); + auto label = ui::Label( "Label" ); - gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END ); + if( i == c_texture_status ) + gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_START ); + else + gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END ); + gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); gtk_misc_set_padding( GTK_MISC( label ), 4, 2 ); - gtk_widget_show( GTK_WIDGET( label ) ); - gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( label ) ); - pStatusLabel[i] = GTK_WIDGET( label ); + label.show(); + frame.add(label); + pStatusLabel[i] = ui::Widget(label ); } - return GTK_WIDGET( table ); + return ui::Widget(table ); } #if 0 diff --cc radiant/map.cpp index fa19512d,73fceb5d..e52a3d18 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@@ -2204,10 -2107,9 +2204,10 @@@ public BrushFindIndexWalker( const scene::Node& node, std::size_t& count ) : m_node( &node ), m_count( count ){ } + - bool pre( const scene::Path& path, scene::Instance& instance ) const { - if ( Node_isPrimitive( path.top() ) ) { - if ( m_node == path.top().get_pointer() ) { + bool pre( scene::Node& node ) const { + if ( Node_isPrimitive( node ) ) { + if ( m_node == &node ) { m_node = 0; } if ( m_node ) { @@@ -2226,10 -2128,9 +2226,10 @@@ public EntityFindIndexWalker( const scene::Node& node, std::size_t& count ) : m_node( &node ), m_count( count ){ } + - bool pre( const scene::Path& path, scene::Instance& instance ) const { - if ( Node_isEntity( path.top() ) ) { - if ( m_node == path.top().get_pointer() ) { + bool pre( scene::Node& node ) const { + if ( Node_isEntity( node ) ) { + if ( m_node == &node ) { m_node = 0; } if ( m_node ) {