copy/paste face textures; fixed gtk assert on linux
authorspog <spog>
Mon, 20 Mar 2006 23:51:04 +0000 (23:51 +0000)
committerspog <spog>
Mon, 20 Mar 2006 23:51:04 +0000 (23:51 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@36 8a3a26a2-13c4-0310-b231-cf6edde360e5

CHANGES
radiant/brushmanip.cpp
radiant/brushmanip.h
radiant/entityinspector.cpp
radiant/mainframe.cpp

diff --git a/CHANGES b/CHANGES
index effb845..9c9726b 100644 (file)
--- 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.
index fbe9291..e9f6ca2 100644 (file)
@@ -1686,6 +1686,11 @@ void FaceInstance_pasteTexture(FaceInstance& faceInstance)
   SceneChangeNotify();
 }
 
+bool SelectedFaces_empty()
+{
+  return g_SelectedFaceInstances.empty();
+}
+
 void SelectedFaces_pasteTexture()
 {
   UndoableCommand command("facePasteTexture");
index d357464..9c41f7a 100644 (file)
@@ -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();
index a3e445b..db64da1 100644 (file)
@@ -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;
       }
index 87b8d75..d0b9000 100644 (file)
@@ -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");