Skip to content

Commit 728c531

Browse files
authored
Merge branch 'master' into feat/allow-new-networks-and-show-disallowed-notif-setting
2 parents 213ba8c + c4d16e2 commit 728c531

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

src/vorta/application.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from vorta.borg.create import BorgCreateJob
1010
from vorta.borg.jobs_manager import JobsManager
1111
from vorta.borg.version import BorgVersionJob
12-
from vorta.config import PROFILE_BOOTSTRAP_FILE, TEMP_DIR
12+
from vorta.config import LOG_DIR, PROFILE_BOOTSTRAP_FILE, TEMP_DIR
1313
from vorta.i18n import init_translations, translate
1414
from vorta.notifications import VortaNotifications
1515
from vorta.profile_export import ProfileExport
@@ -330,7 +330,9 @@ def check_failed_response(self, result: Dict[str, Any]):
330330
if returncode == 1:
331331
# warning
332332
msg.setIcon(QMessageBox.Icon.Warning)
333-
text = self.tr('Borg exited with a warning message. See logs for details.')
333+
text = translate(
334+
'VortaApp', 'Borg exited with warning status (rc 1). See the <a href="{0}">logs</a> for details.'
335+
).format(LOG_DIR.as_uri())
334336
infotext = error_message
335337
elif returncode > 128:
336338
# 128+N - killed by signal N (e.g. 137 == kill -9)

src/vorta/assets/UI/mainwindow.ui

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@
208208
<verstretch>0</verstretch>
209209
</sizepolicy>
210210
</property>
211+
<property name="openExternalLinks">
212+
<bool>true</bool>
213+
</property>
211214
</widget>
212215
</item>
213216
<item row="1" column="1" alignment="Qt::AlignTop">

src/vorta/borg/check.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from typing import Any, Dict
2+
from vorta.config import LOG_DIR
3+
from vorta.i18n import translate
24
from vorta.utils import borg_compat
35
from .borg_job import BorgJob
46

@@ -20,7 +22,11 @@ def finished_event(self, result: Dict[str, Any]):
2022
self.app.backup_finished_event.emit(result)
2123
self.result.emit(result)
2224
if result['returncode'] != 0:
23-
self.app.backup_progress_event.emit(self.tr('Repo check failed. See logs for details.'))
25+
self.app.backup_progress_event.emit(
26+
translate('RepoCheckJob', 'Repo check failed. See the <a href="{0}">logs</a> for details.').format(
27+
LOG_DIR.as_uri()
28+
)
29+
)
2430
self.app.check_failed_event.emit(result)
2531
else:
2632
self.app.backup_progress_event.emit(self.tr('Check completed.'))

src/vorta/borg/compact.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Any, Dict
2-
from vorta.i18n import trans_late
2+
from vorta.config import LOG_DIR
3+
from vorta.i18n import trans_late, translate
34
from vorta.utils import borg_compat
45
from .borg_job import BorgJob
56

@@ -21,7 +22,11 @@ def finished_event(self, result: Dict[str, Any]):
2122
self.app.backup_finished_event.emit(result)
2223
self.result.emit(result)
2324
if result['returncode'] != 0:
24-
self.app.backup_progress_event.emit(self.tr('Errors during compaction. See logs for details.'))
25+
self.app.backup_progress_event.emit(
26+
translate(
27+
'BorgCompactJob', 'Errors during compaction. See the <a href="{0}">logs</a> for details.'
28+
).format(LOG_DIR.as_uri())
29+
)
2530
else:
2631
self.app.backup_progress_event.emit(self.tr('Compaction completed.'))
2732

src/vorta/borg/create.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import subprocess
33
import tempfile
44
from datetime import datetime as dt
5-
from vorta.i18n import trans_late
5+
from vorta.config import LOG_DIR
6+
from vorta.i18n import trans_late, translate
67
from vorta.store.models import ArchiveModel, RepoModel, SourceFileModel, WifiSettingModel
78
from vorta.utils import borg_compat, format_archive_name, get_network_status_monitor
89
from .borg_job import BorgJob
@@ -33,7 +34,12 @@ def process_result(self, result):
3334
repo.save()
3435

3536
if result['returncode'] == 1:
36-
self.app.backup_progress_event.emit(self.tr('Backup finished with warnings. See logs for details.'))
37+
self.app.backup_progress_event.emit(
38+
translate(
39+
'BorgCreateJob',
40+
'Backup finished with warnings. See the <a href="{0}">logs</a> for details.',
41+
).format(LOG_DIR.as_uri())
42+
)
3743
else:
3844
self.app.backup_progress_event.emit(self.tr('Backup finished.'))
3945

src/vorta/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def find_best_unit_for_size(size: Optional[int], metric: bool = True, precision:
266266
if not isinstance(size, int) or size == 0: # this will also take care of the None case
267267
return 0
268268
power = 10**3 if metric else 2**10
269-
n = math.floor(math.log(size * 10**precision, power))
269+
n = math.floor(math.log(abs(size) * 10**precision, power))
270270
return n
271271

272272

0 commit comments

Comments
 (0)