From fe7b2040d450eb6ca7f59e2dbdcd0654a0436ed6 Mon Sep 17 00:00:00 2001 From: spog Date: Mon, 20 Mar 2006 23:51:04 +0000 Subject: [PATCH] copy/paste face textures; fixed gtk assert on linux git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@36 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- CHANGES | 5 +++++ radiant/brushmanip.cpp | 5 +++++ radiant/brushmanip.h | 1 + radiant/entityinspector.cpp | 10 ++++++++-- radiant/mainframe.cpp | 4 ++-- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index effb8454..9c9726b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ This is the changelog for developers, != changelog for the end user that we distribute with the binaries. (see changelog) +20/03/2006 +SPoG +- Changed Copy/Paste to work on face textures if any faces are selected. +- Fixed GTK_WIDGET_REALIZED assert when selecting entities (linux). + 28/02/2006 namespace, SPoG - Added drag-resizing for doom3/quake4 light_radius boxes. diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index fbe92910..e9f6ca21 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -1686,6 +1686,11 @@ void FaceInstance_pasteTexture(FaceInstance& faceInstance) SceneChangeNotify(); } +bool SelectedFaces_empty() +{ + return g_SelectedFaceInstances.empty(); +} + void SelectedFaces_pasteTexture() { UndoableCommand command("facePasteTexture"); diff --git a/radiant/brushmanip.h b/radiant/brushmanip.h index d357464c..9c41f7a3 100644 --- a/radiant/brushmanip.h +++ b/radiant/brushmanip.h @@ -74,6 +74,7 @@ void Brush_constructMenu(GtkMenu* menu); extern Callback g_texture_lock_status_changed; +bool SelectedFaces_empty(); void SelectedFaces_copyTexture(); void SelectedFaces_pasteTexture(); void FaceTextureClipboard_setDefault(); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index a3e445ba..db64da1d 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1010,7 +1010,10 @@ void EntityClassList_selectEntityClass(EntityClass* eclass) GtkTreeView* view = g_entityClassList; GtkTreePath* path = gtk_tree_model_get_path(model, &iter); gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); - gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); + if(GTK_WIDGET_REALIZED(view)) + { + gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); + } gtk_tree_path_free(path); good = FALSE; } @@ -1361,7 +1364,10 @@ static gint EntityClassList_keypress(GtkWidget* widget, GdkEventKey* event, gpoi { GtkTreePath* path = gtk_tree_model_get_path(model, &iter); gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); - gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); + if(GTK_WIDGET_REALIZED(view)) + { + gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); + } gtk_tree_path_free(path); count = 1; } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 87b8d752..d0b90001 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -668,7 +668,7 @@ void Selection_Paste() void Copy() { - if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) + if(SelectedFaces_empty()) { Selection_Copy(); } @@ -680,7 +680,7 @@ void Copy() void Paste() { - if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) + if(SelectedFaces_empty()) { UndoableCommand undo("paste"); -- 2.39.2