A few tweaks to the dialog and code

This commit is contained in:
Veronica K. B. Olsen
2020-02-26 18:02:37 +01:00
parent 6b3e652440
commit 0587099d36
2 changed files with 10 additions and 4 deletions
+5 -1
View File
@@ -39,7 +39,7 @@ class GuiProjectLoad(QDialog):
self.outerBox = QHBoxLayout()
self.innerBox = QVBoxLayout()
self.setWindowTitle("Manage Projects")
self.setWindowTitle("Open Project")
self.setLayout(self.outerBox)
self.guiDeco = self.theParent.theTheme.loadDecoration("nwicon", (128, 128))
@@ -147,6 +147,7 @@ class GuiProjectLoad(QDialog):
listData[theTime] = [theTitle, theWords, projPath]
self.listBox.clear()
hasSelection = False
for timeStamp in sorted(listOrder, reverse=True):
newItem = QTreeWidgetItem([""]*4)
newItem.setText(0, listData[timeStamp][0])
@@ -155,6 +156,9 @@ class GuiProjectLoad(QDialog):
newItem.setText(3, listData[timeStamp][2])
newItem.setTextAlignment(1, Qt.AlignRight)
self.listBox.addTopLevelItem(newItem)
if not hasSelection:
newItem.setSelected(True)
hasSelection = True
self.listBox.resizeColumnToContents(0)
self.listBox.resizeColumnToContents(1)