mirror of
https://github.com/borgbase/vorta
synced 2024-12-23 16:26:55 +00:00
Hotfix: Disable macOS autostart due to comptability issue. #81
This commit is contained in:
parent
5a01322d2c
commit
d8de3206dd
3 changed files with 20 additions and 17 deletions
|
@ -197,7 +197,7 @@ def init_db(con):
|
|||
if sys.platform == 'darwin':
|
||||
settings += [
|
||||
{'key': 'autostart', 'value': False, 'type': 'checkbox',
|
||||
'label': 'Add Vorta to Login Items in Preferences > Users and Groups > Login Items.'},
|
||||
'label': 'Add Vorta to Login Items in Preferences > Users and Groups > Login Items. (not implemented)'},
|
||||
{'key': 'enable_notifications', 'value': True, 'type': 'checkbox',
|
||||
'label': 'Display notifications when background tasks fail.'},
|
||||
{'key': 'check_for_updates', 'value': True, 'type': 'checkbox',
|
||||
|
|
|
@ -223,19 +223,21 @@ def set_tray_icon(tray, active=False):
|
|||
|
||||
def open_app_at_startup(enabled=True):
|
||||
if sys.platform == 'darwin':
|
||||
print('Not implemented due to conflict with keyring package.')
|
||||
# From https://stackoverflow.com/questions/26213884/cocoa-add-app-to-startup-in-sandbox-using-pyobjc
|
||||
from Foundation import NSDictionary
|
||||
from Cocoa import NSBundle, NSURL
|
||||
from CoreFoundation import kCFAllocatorDefault
|
||||
from LaunchServices import (LSSharedFileListCreate, kLSSharedFileListSessionLoginItems,
|
||||
LSSharedFileListInsertItemURL, kLSSharedFileListItemHidden,
|
||||
kLSSharedFileListItemLast, LSSharedFileListItemRemove)
|
||||
app_path = NSBundle.mainBundle().bundlePath()
|
||||
url = NSURL.alloc().initFileURLWithPath_(app_path)
|
||||
login_items = LSSharedFileListCreate(kCFAllocatorDefault, kLSSharedFileListSessionLoginItems, None)
|
||||
props = NSDictionary.dictionaryWithObject_forKey_(True, kLSSharedFileListItemHidden)
|
||||
|
||||
new_item = LSSharedFileListInsertItemURL(login_items, kLSSharedFileListItemLast,
|
||||
None, None, url, props, None)
|
||||
if not enabled:
|
||||
LSSharedFileListItemRemove(login_items, new_item)
|
||||
# from Foundation import NSDictionary
|
||||
# from Cocoa import NSBundle, NSURL
|
||||
# from CoreFoundation import kCFAllocatorDefault
|
||||
# from LaunchServices import (LSSharedFileListCreate, kLSSharedFileListSessionLoginItems,
|
||||
# LSSharedFileListInsertItemURL, kLSSharedFileListItemHidden,
|
||||
# kLSSharedFileListItemLast, LSSharedFileListItemRemove)
|
||||
#
|
||||
# app_path = NSBundle.mainBundle().bundlePath()
|
||||
# url = NSURL.alloc().initFileURLWithPath_(app_path)
|
||||
# login_items = LSSharedFileListCreate(kCFAllocatorDefault, kLSSharedFileListSessionLoginItems, None)
|
||||
# props = NSDictionary.dictionaryWithObject_forKey_(True, kLSSharedFileListItemHidden)
|
||||
#
|
||||
# new_item = LSSharedFileListInsertItemURL(login_items, kLSSharedFileListItemLast,
|
||||
# None, None, url, props, None)
|
||||
# if not enabled:
|
||||
# LSSharedFileListItemRemove(login_items, new_item)
|
||||
|
|
|
@ -11,7 +11,8 @@ a = Analysis(['src/vorta/__main__.py'],
|
|||
('src/vorta/assets/UI/*', 'assets/UI'),
|
||||
('src/vorta/assets/icons/*', 'assets/icons'),
|
||||
],
|
||||
hiddenimports=['vorta.views.collection_rc'],
|
||||
hiddenimports=['vorta.views.collection_rc',
|
||||
],
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
|
|
Loading…
Reference in a new issue