]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
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 effb8454ff7c430efb1fd7c5156c1d4b0e2b728e..9c9726b3d30e43799099102a8f738b20c2218b71 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 fbe92910937e26811be9af7912b072204d16f42f..e9f6ca212ffe9a02e10c82b8fdf4b13cf027a2d1 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 d357464cccfa35563be6251670376f35e674edcb..9c41f7a3037117d783b24e9aab37d0b47df756ee 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 a3e445baecf65340d4f814523ac76ea3b2909e93..db64da1dbd94fbfa92e8b5cb4baf45fcfbbf859b 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 87b8d7522fcef406508e2e1d204907d54bee2181..d0b900012f9c197f7c29773a4ee9937a3f7da2da 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");