Add background settings to all non macos (#778)

This commit is contained in:
samuel-w 2021-02-01 19:18:16 -06:00 committed by GitHub
parent c99ac04b36
commit 227e06d228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 10 deletions

View File

@ -14,7 +14,7 @@ import peewee as pw
from playhouse.migrate import SqliteMigrator, migrate from playhouse.migrate import SqliteMigrator, migrate
from vorta.i18n import trans_late from vorta.i18n import trans_late
from vorta.utils import slugify, is_system_tray_available from vorta.utils import slugify
SCHEMA_VERSION = 16 SCHEMA_VERSION = 16
@ -196,6 +196,7 @@ def _apply_schema_update(current_schema, version_after, *operations):
def get_misc_settings(): def get_misc_settings():
''' Global settings that apply per platform '''
# Default settings for all platforms. # Default settings for all platforms.
settings = [ settings = [
{ {
@ -235,6 +236,7 @@ def get_misc_settings():
'key': 'previous_window_height', 'str_value': '600', 'type': 'internal', 'key': 'previous_window_height', 'str_value': '600', 'type': 'internal',
'label': 'Previous window height' 'label': 'Previous window height'
}, },
] ]
if sys.platform == 'darwin': if sys.platform == 'darwin':
settings += [ settings += [
@ -249,8 +251,9 @@ def get_misc_settings():
'Include pre-release versions when checking for updates') 'Include pre-release versions when checking for updates')
}, },
] ]
if not is_system_tray_available(): else:
settings += [{ settings += [
{
'key': 'enable_background_question', 'value': True, 'type': 'checkbox', 'key': 'enable_background_question', 'value': True, 'type': 'checkbox',
'label': trans_late('settings', 'label': trans_late('settings',
'Display background exit dialog') 'Display background exit dialog')
@ -258,7 +261,8 @@ def get_misc_settings():
{ {
'key': 'disable_background_state', 'value': False, 'type': 'internal', 'key': 'disable_background_state', 'value': False, 'type': 'internal',
'label': 'Previous background exit button state' 'label': 'Previous background exit button state'
}] }
]
return settings return settings