diff --git a/src/gajim.py b/src/gajim.py index 2435f920e..8af719abc 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -142,8 +142,16 @@ try: import gtk except Warning, msg: if str(msg) == 'could not open display': - print >> sys.stderr, _('Gajim needs X server to run. Quiting...') - sys.exit() + if sys.platform == 'darwin': + os.system('/Applications/Utilities/X11.app/Contents/MacOS/X11 &') + try: + import gtk + except Warning, msg: + print >> sys.stderr, _('No X11 running and failed to start it! Quitting...') + sys.exit() + else: + print >> sys.stderr, _('Gajim needs X server to run. Quiting...') + sys.exit() warnings.resetwarnings() if os.name == 'nt': diff --git a/src/osx/__init__.py b/src/osx/__init__.py index ee21386cb..263633712 100644 --- a/src/osx/__init__.py +++ b/src/osx/__init__.py @@ -1,15 +1,12 @@ import sys, commands from network_manager_listener import device_now_active, device_no_longer_active -import nsapp -if sys.platform != "darwin": - raise ImportError("System platform is not OS/X") - +if sys.platform != 'darwin': + raise ImportError('System platform is not OS X') net_device_active = True - ### ### Utility functions ### @@ -21,6 +18,7 @@ def checkPID(pid, procname): return True return False +import nsapp def init(): nsapp.init()