1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-01-03 05:36:19 +00:00

support checking a single (selected) archive, fixes #33

For mount the behavior is to mount the selected archive if one is
selected and the whole repo when none is selected. The same behavior
was now implemented for check as well.
This commit is contained in:
Thomas Waldmann 2018-11-23 14:33:31 +01:00
parent 65214b8e73
commit 8066156f98

View file

@ -91,12 +91,23 @@ def populate_from_profile(self):
def check_action(self):
params = BorgCheckThread.prepare(self.profile())
if params['ok']:
thread = BorgCheckThread(params['cmd'], params, parent=self)
thread.updated.connect(self._set_status)
thread.result.connect(self.check_result)
self._toggle_all_buttons(False)
thread.start()
if not params['ok']:
self._set_status(params['message'])
return
# Conditions are met (borg binary available, etc)
row_selected = self.archiveTable.selectionModel().selectedRows()
if row_selected:
snapshot_cell = self.archiveTable.item(row_selected[0].row(), 3)
if snapshot_cell:
snapshot_name = snapshot_cell.text()
params['cmd'][-1] += f'::{snapshot_name}'
thread = BorgCheckThread(params['cmd'], params, parent=self)
thread.updated.connect(self._set_status)
thread.result.connect(self.check_result)
self._toggle_all_buttons(False)
thread.start()
def check_result(self, result):
if result['returncode'] == 0: