Bladeren bron

- in ObjectCollection class, made sure that renaming an object in Project View does not result in an empty name. If new name is blank the rename is cancelled.
- made ObjectCOllection.TreeItem() inherit KeySensitiveListVIew and implicitly QTreeView (in the hope that the theme applied on app will be applied on the tree items, too (for MacOs new DarkUI theme)

Marius Stanciu 6 jaren geleden
bovenliggende
commit
ac64f56240
2 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 3 3
      ObjectCollection.py
  2. 6 1
      README.md

+ 3 - 3
ObjectCollection.py

@@ -118,13 +118,13 @@ class KeySensitiveListView(QtWidgets.QTreeView):
             event.ignore()
 
 
-class TreeItem:
+class TreeItem(KeySensitiveListView):
     """
     Item of a tree model
     """
 
     def __init__(self, data, icon=None, obj=None, parent_item=None):
-
+        super(TreeItem, self).__init__(parent_item)
         self.parent_item = parent_item
         self.item_data = data  # Columns string data
         self.icon = icon  # Decoration
@@ -399,7 +399,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
             if obj:
                 old_name = str(obj.options['name'])
                 new_name = str(data)
-                if old_name != new_name:
+                if old_name != new_name and new_name != '':
                     # rename the object
                     obj.options["name"] = str(data)
 

+ 6 - 1
README.md

@@ -9,11 +9,16 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+30.04.2019
+
+- in ObjectCollection class, made sure that renaming an object in Project View does not result in an empty name. If new name is blank the rename is cancelled.
+- made ObjectCOllection.TreeItem() inherit KeySensitiveListVIew and implicitly QTreeView (in the hope that the theme applied on app will be applied on the tree items, too (for MacOs new DarkUI theme)
+
 29.04.2019
 
 - solved bug in Gerber Editor: the '0' aperture (the region aperture) had no size which created errors. Made the size to be zero.
 - solved bug in editors: the canvas selection shape was not deleted on mouse release if the grid snap was OFF
-- solved bug in Excellon Editor: when selecting a drill hole on canvas the selected row in the Tools Table was not the correct onw but the next highest row
+- solved bug in Excellon Editor: when selecting a drill hole on canvas the selected row in the Tools Table was not the correct one but the next highest row
 - finished the Silkscreen Tool but there are some limitations (some wires fragments from silkscreen are lost)
 - solved the issue in Silkscreen Tool with losing some fragments of wires from silkscreen