Fix open file for mac
This commit is contained in:
1 parent
5d670fda28
commit
114c207d49
2 files changed
+12
-1
No files matched your search
@@ -242,6 +242,16 @@ def file_open(filename, type, parent, print_p=False):
|
||||
# Try without operation, it is not supported on version < 2.5
|
||||
os.startfile(os.path.normpath(filename))
|
||||
return
|
||||
elif os.name == 'mac':
|
||||
pid = os.fork()
|
||||
if not pid:
|
||||
pid = os.fork()
|
||||
if not pid:
|
||||
os.execv('/usr/bin/open', ['/usr/bin/open', filename])
|
||||
time.sleep(0.1)
|
||||
sys.exit(0)
|
||||
os.waitpid(pid, 0)
|
||||
return
|
||||
cmd = ''
|
||||
if type in CONFIG['client.actions']:
|
||||
if print_p:
|
||||
|
||||
+2
-1
@@ -191,8 +191,9 @@ class Main(object):
|
||||
self.glade.get_widget(signals[signal][2]).set_active(
|
||||
int(bool(CONFIG[signals[signal][1]])))
|
||||
|
||||
if os.name == 'nt':
|
||||
if os.name in ('nt', 'mac'):
|
||||
# Disable actions, on win32 we use os.startfile
|
||||
# and on mac we use /usr/bin/open
|
||||
self.glade.get_widget('actions').set_sensitive(False)
|
||||
|
||||
# Adding a timer the check to requests
|
||||
|
||||
Reference in new issue
Block a user