21
21
22
22
from home .CentralBlockTable import *
23
23
from home .InfoPanel import *
24
+ from home .SortingBlockTree import *
24
25
25
26
26
- class HomeWindow (QWidget , HomeWindowCentralBlock , HomeWindowInfoPanel ):
27
+ class HomeWindow (QWidget , HomeWindowCentralBlock , HomeWindowInfoPanel , HomeWindowSortingBlockTree ):
27
28
def __init__ (self , database : bdd .BDD , translation : Lang , env_vars : dict ):
28
29
self .appDir = os .path .dirname (os .path .dirname (os .path .realpath (__file__ )))
29
30
self .currentBook = ''
@@ -41,11 +42,7 @@ def __init__(self, database: bdd.BDD, translation: Lang, env_vars: dict):
41
42
self .HeaderBlockBtnSettings .clicked .connect (self .HeaderBlockBtnSettingsClicked )
42
43
43
44
self .CentralBlockTableDefineSlots ()
44
-
45
- while self .SortingBlockTree .topLevelItem (1 ).childCount () > 0 :
46
- self .SortingBlockTree .topLevelItem (1 ).removeChild (self .SortingBlockTree .topLevelItem (1 ).child (0 ))
47
- while self .SortingBlockTree .topLevelItem (2 ).childCount () > 0 :
48
- self .SortingBlockTree .topLevelItem (2 ).removeChild (self .SortingBlockTree .topLevelItem (2 ).child (0 ))
45
+ self .SortingBlockTreeInit ()
49
46
50
47
self .show () # Show the GUI
51
48
@@ -131,9 +128,9 @@ def newBookTableItem(self, guid: str, type: str, value: str, editable: bool = Tr
131
128
"""
132
129
item = QtWidgets .QTableWidgetItem ()
133
130
if editable is True :
134
- item .setFlags (QtCore .Qt .ItemIsSelectable | QtCore .Qt .ItemIsEditable | QtCore .Qt .ItemIsUserCheckable | QtCore . Qt . ItemIsEnabled )
131
+ item .setFlags (QtCore .Qt .ItemIsSelectable | QtCore .Qt .ItemIsEditable | QtCore .Qt .ItemIsEnabled )
135
132
else :
136
- item .setFlags (QtCore .Qt .ItemIsSelectable | QtCore .Qt .ItemIsUserCheckable | QtCore . Qt . ItemIsEnabled )
133
+ item .setFlags (QtCore .Qt .ItemIsSelectable | QtCore .Qt .ItemIsEnabled )
137
134
item .setTextAlignment (QtCore .Qt .AlignLeading | QtCore .Qt .AlignVCenter )
138
135
item .setData (99 , guid )
139
136
item .setData (100 , type )
0 commit comments