mirror of
https://github.com/borgbase/vorta
synced 2025-02-20 21:36:58 +00:00
Enable multiselection on source list (#596)
This commit is contained in:
parent
ec374953e7
commit
677734e62a
2 changed files with 9 additions and 2 deletions
|
@ -37,6 +37,9 @@
|
|||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -51,8 +51,12 @@ def receive():
|
|||
dialog.open(receive)
|
||||
|
||||
def source_remove(self):
|
||||
item = self.sourceFilesWidget.takeItem(self.sourceFilesWidget.currentRow())
|
||||
if item:
|
||||
indexes = self.sourceFilesWidget.selectionModel().selectedIndexes()
|
||||
# sort indexes, starting with lowest
|
||||
indexes.sort()
|
||||
# remove each selected entry, starting with highest index (otherways, higher indexes become invalid)
|
||||
for index in reversed(indexes):
|
||||
item = self.sourceFilesWidget.takeItem(index.row())
|
||||
db_item = SourceFileModel.get(dir=item.text())
|
||||
db_item.delete_instance()
|
||||
|
||||
|
|
Loading…
Reference in a new issue