Skip to content

Commit dce04df

Browse files
committed
refactor
1 parent 213ba8c commit dce04df

4 files changed

Lines changed: 7 additions & 14 deletions

File tree

src/vorta/application.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ def create_backup_action(self, profile_id=None):
113113
job = BorgCreateJob(msg['cmd'], msg, profile.repo.id)
114114
self.jobs_manager.add_job(job)
115115
else:
116-
if not (
117-
msg['message'] == 'Current Wifi is not allowed.'
118-
and not profile.show_notification_when_network_disallowed
119-
):
116+
if msg['message'] != 'Current Wifi is not allowed.' or profile.show_notification_when_network_disallowed:
120117
notifier = VortaNotifications.pick()
121118
notifier.deliver(
122119
self.tr('Vorta Backup'),

src/vorta/scheduler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ def create_backup(self, profile_id):
418418
else:
419419
logger.error('Conditions for backup not met. Aborting.')
420420
logger.error(msg['message'])
421-
if not (
422-
msg['message'] == 'Current Wifi is not allowed.'
423-
and not profile.show_notification_when_network_disallowed
421+
if (
422+
msg['message'] != 'Current Wifi is not allowed.'
423+
or profile.show_notification_when_network_disallowed
424424
):
425425
notifier.deliver(
426426
self.tr('Vorta Backup'),

src/vorta/store/migrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def run_migrations(current_schema, db_connection):
233233
migrator.add_column(
234234
BackupProfileModel._meta.table_name,
235235
'allow_new_networks',
236-
pw.BooleanField(default=False),
236+
pw.BooleanField(default=True),
237237
),
238238
migrator.add_column(
239239
BackupProfileModel._meta.table_name,

src/vorta/views/schedule_tab.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,8 @@ def populate_from_profile(self):
155155
self.meteredNetworksCheckBox.setChecked(
156156
QtCore.Qt.Unchecked if profile.dont_run_on_metered_networks else QtCore.Qt.Checked
157157
)
158-
self.allowNewNetworksCheckBox.setChecked(
159-
QtCore.Qt.Checked if profile.allow_new_networks else QtCore.Qt.Unchecked
160-
)
161-
self.networkDisallowedNotificationCheckBox.setChecked(
162-
QtCore.Qt.Checked if profile.show_notification_when_network_disallowed else QtCore.Qt.Unchecked
163-
)
158+
self.allowNewNetworksCheckBox.setChecked(profile.allow_new_networks)
159+
self.networkDisallowedNotificationCheckBox.setChecked(profile.show_notification_when_network_disallowed)
164160

165161
self.preBackupCmdLineEdit.setText(profile.pre_backup_cmd)
166162
self.postBackupCmdLineEdit.setText(profile.post_backup_cmd)

0 commit comments

Comments
 (0)