Commit 1f7a4627 authored by Yann Leboulanger's avatar Yann Leboulanger

[James Newton] osx port for Gajim. a GREAT thanks!!!

parent 819b3c73
......@@ -48,6 +48,16 @@ MAINTAINERCLEANFILES = \
compile \
depcomp \
config.guess \
config.log \
config.sub \
config.status \
aclocal.m4 \
libtool
libtool \
po/POTFILES.in \
src/trayicon_la-eggtrayicon.loT \
m4/intltool.m4
MAINTAINERCLEANDIRS = \
autom4te.cache \
build \
dist
Introduction
------------
This is an alpha release of Gajim for OS/X using native GTK+. It is not finished
nor is it relatively stable. The native port of GTK+ is alpha and not stable
yet, though it has proven to be usable for Gajim. Having said that it is usable,
basic functionality works. See the TODO file for a list of what is and is not
working.
Installing
----------
Install the GTK+ framework into your /Library/Frameworks directory. It can be
found at http://codepunks.org/misc/gtk/osx.
Copy the Gajim.app into the /Applications directory or any other directory.
Installing language dictionaries
--------------------------------
The codepunks.org build of the GTK+ framework comes with the US English
dictionary pre-installed. If you wish to install a different dictionary download
the appropriate dictionary from here:
http://ftp.gnu.org/gnu/aspell/dict/
Then follow these instructions:
source /Library/Frameworks/GTK+.framework/Versions/Current/bin/env
tar -jxf aspell-<lang>-<version>.tbz2
cd aspell-<lang>-<version>
./configure
make
make install
Compiling Requirements
----------------------
These instructions were gathered for building a universal binary on a PPC. The
steps for building on an i386 should be essentially the same.
Requirements:
- OS/X 10.4, i386 or ppc
- Universal MacPython 2.5
http://www.pythonmac.org/packages/py25-fat/index.html
- Latest XCode (2.4.0 or greater)
- py2app
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
Install all of the requirements. Make sure that the universal MacPython is
installed before py2app. Then ensure that this is the first python in your
PATH.
export PATH=/Library/Frameworks/Python.framework/Versions/2.5/bin:$PATH
Then install py2app.
Compiling
---------
In the top level run the configure script. If this is source is from subversion
then run the autogen.sh script. Follow it up with a make:
./configure
or
./autogen.sh
make
Once that is done Gajim can be run from the source tree. You may also create an
app bundle suitable for use or distribution. To do that run:
python setup_osx.py build
The Gajim.app bundle is created in the dist directory. This bundle is ready
for use as is. Copy it to your /Applications directory and you're good to go.
You now have a self contained (almost, requires GTK+.framework still) universal
native build of Gajim.
Optionally to create a distribution of the Gajim app bundle do:
python setup_osx.py dist
Development
-----------
It is possible to run Gajim correctly from the app bundle but still use the
python code in the source tree. This line must be added to the _run() function
in the Gajim.app/Resources/__boot__.py file. It needs to be located just after
the sys module is imported. Font forget to fix the path to match your
environment.
sys.path = ["/Users/user/Source/gajim/src"] + sys.path
The bits that work
------------------
-idle checking
-dbus and gajim-remote, using dbus from GTK+.framework.
-systray icon
-app bundle with universal binaries. Depends on the GTK+.framework.
-notifications through growl, internal fallback works fine as well
-spell checking
-running apps and opening files/urls
-playing sounds
-Network monitoring
-Mostly everything else except for whats below.
The bits that dont work
-----------------------
-Application start/stop/doc/DnD handling
-finish the .app bundle
- setup gajim-remote, maybe install it to /usr/local
- fix user session management
-integrate the Gajim and gajim-remote scripts with autoconf and add GTK
framework detection
-Pass icons to OS/X menu
-set the LSEnvironment in Info.plist for gtk paths instead of hard coding in
gajim.py
-Maybe setup the pasteboard services for an OS/X alternative to the
gajim_remote
-CFBundleDocumentTypes.NSDocument
Native GTK bugs
----------------
-cut and paste blows up Finder and the os/x GUI server. very very nasty.
-with mutiple displays, popup menus show up on the wrong display
......@@ -8,11 +8,19 @@
echo "See README.html for build requirements."
exit 1
fi
set -x
AM_ARGS="--add-missing --gnu --copy"
CONF_ARGS=""
if test x`uname -s 2>/dev/null` = 'xDarwin';then
. /Library/Frameworks/GTK+.framework/Versions/Current/env
#export PATH=/Library/Frameworks/GTK+.framework/Versions/Current/bin/:$PATH
#export PKG_CONFIG_PATH=/Library/Frameworks/GTK+.framework/Versions/Current/lib/pkgconfig
AM_ARGS="${AM_ARGS} --ignore-deps"
CONF_ARGS="${CONF_ARGS} --disable-idle --without-x"
fi
intltoolize --force --automake \
&& aclocal -I ./m4 \
&& libtoolize --copy --force --automake \
&& autoheader \
&& autoconf \
&& automake --add-missing --gnu --copy \
&& ./configure $@
&& automake ${AM_ARGS} \
&& ./configure ${CONF_ARGS} $@
......@@ -6,6 +6,9 @@ AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
dnl Make Objective-C work with automake
AM_CONDITIONAL([am__fastdepOBJC], false)
IT_PROG_INTLTOOL([0.35.0])
PKG_PROG_PKG_CONFIG([0.19])
......@@ -128,6 +131,75 @@ AC_ARG_ENABLE(trayicon,
test "x$enable_trayicon" = "xyes" && have_trayicon=true || have_trayicon=false
AM_CONDITIONAL(BUILD_TRAYICON, $have_trayicon)
dnl ****
dnl Cocoa
dnl ****
AC_ARG_ENABLE([cocoa],
[ --disable-cocoa build cocoa integration [default auto]],
enable_cocoa=$enableval, enable_cocoa=yes)
if test "x$enable_cocoa" = "xyes";then
dnl There is no pkgconfig for cocoa; lets do a header check
temp_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -ObjC"
AC_CHECK_HEADER(Cocoa/Cocoa.h, [have_cocoa=true], [have_cocoa=false])
AC_CHECK_HEADER(AppKit/AppKit.h, [have_appkit=true], [have_appkit=false])
CFLAGS="$temp_save_cflags"
if test "x$have_cocoa" = "xtrue";then
COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker Cocoa"
fi
if test "x$have_appkit" = "xtrue";then
COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker AppKit"
fi
if test "x$COCOA_LIBS" != "x";then
AC_SUBST(COCOA_LIBS)
true
fi
fi
AM_CONDITIONAL(BUILD_COCOA, $have_cocoa)
dnl ****
dnl Carbon
dnl ****
AC_ARG_ENABLE([carbon],
[ --disable-carbon build with carbon [default auto]],
enable_carbon=$enableval, enable_carbon=yes)
if test "x$enable_carbon" = "xyes";then
dnl There is no pkgconfig for carbon; lets do a header check
AC_CHECK_HEADER(Carbon/Carbon.h, [have_carbon=true], [have_carbon=false])
AC_CHECK_HEADER(IOKit/IOKitLib.h, [have_iokit=true], [have_iokit=false])
if test "x$have_carbon" = "xtrue";then
CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker Carbon"
fi
if test "x$have_iokit" = "xtrue";then
CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker IOKit"
fi
if test "x$CARBON_LIBS" != "x";then
AC_SUBST(CARBON_LIBS)
have_idle_osx=true
dnl Disable X11 idle
have_idle=false
AM_CONDITIONAL(BUILD_IDLE, false)
dnl Disable custom trayicon
have_trayicon=gtk+
AM_CONDITIONAL(BUILD_TRAYICON, false)
dnl Hack to work around failure in gettext package detection on OS/X
if test "x$GMSGFMT" = "x";then
AC_SUBST(GMSGFMT, msgfmt)
AC_SUBST(MSGFMT, msgfmt)
AC_SUBST(XGETTEXT, xgettext)
fi
else
have_carbon=false
have_idle_osx=false
fi
fi
AM_CONDITIONAL(BUILD_IDLE_OSX, $have_carbon)
AM_CONDITIONAL(BUILD_CARBON, $have_carbon)
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
AC_SUBST(ACLOCAL_AMFLAGS)
......@@ -159,6 +231,9 @@ AC_CONFIG_FILES([
data/defs.py
src/Makefile
src/common/Makefile
src/osx/Makefile
src/osx/growl/Makefile
src/osx/syncmenu/Makefile
scripts/gajim
scripts/gajim-remote
po/Makefile.in
......@@ -171,4 +246,6 @@ echo "
idle module ...... ${have_idle}
remote control ... ${have_remote}
trayicon ......... ${have_trayicon}
idle module OSX .. ${have_idle_osx}
cocoa ............ ${have_cocoa}
*****************************"
{
IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; });
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 10 356 240 0 0 1280 832 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>245 312 185 44 0 0 1280 832 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8R218</string>
</dict>
</plist>
#!/bin/bash
cd `dirname $0`/src
BASE=`pwd`/`dirname $0`
OS=`uname -s`
if [ "x${OS}" == "xDarwin" ]; then
export RESOURCEPATH="${BASE}/dist/Gajim.app/Contents/Resources"
fi
cd ${BASE}/src
exec -a gajim python -OOt gajim.py $@
This diff is collapsed.
SUBDIRS = common
SUBDIRS = common osx
CLEANFILES = \
trayicon.c
INCLUDES = \
$(PYTHON_INCLUDES)
export MACOSX_DEPLOYMENT_TARGET=10.4
if BUILD_GTKSPELL
gtkspelllib_LTLIBRARIES = gtkspell.la
......
......@@ -26,6 +26,7 @@
##
import sys
import re
import copy
import defs
......@@ -50,6 +51,16 @@ opt_treat_incoming_messages = ['', 'chat', 'normal']
class Config:
DEFAULT_ICONSET = 'dcraven'
if sys.platform == 'darwin':
DEFAULT_OPENWITH = 'open'
DEFAULT_BROWSER = 'open -a firefox'
DEFAULT_MAILAPP = 'open -a thunderbird'
DEFAULT_FILE_MANAGER = 'open'
else:
DEFAULT_OPENWITH = 'gnome-open'
DEFAULT_BROWSER = 'firefox'
DEFAULT_MAILAPP = 'mozilla-thunderbird -compose'
DEFAULT_FILE_MANAGER = 'xffm'
__options = {
# name: [ type, default_value, help_string ]
......@@ -108,10 +119,10 @@ class Config:
'sounds_on': [ opt_bool, True ],
# 'aplay', 'play', 'esdplay', 'artsplay' detected first time only
'soundplayer': [ opt_str, '' ],
'openwith': [ opt_str, 'gnome-open' ],
'custombrowser': [ opt_str, 'firefox' ],
'custommailapp': [ opt_str, 'mozilla-thunderbird -compose' ],
'custom_file_manager': [ opt_str, 'xffm' ],
'openwith': [ opt_str, DEFAULT_OPENWITH ],
'custombrowser': [ opt_str, DEFAULT_BROWSER ],
'custommailapp': [ opt_str, DEFAULT_MAILAPP ],
'custom_file_manager': [ opt_str, DEFAULT_FILE_MANAGER ],
'gc-hpaned-position': [opt_int, 430],
'gc_refer_to_nick_char': [opt_str, ',', _('Character to add after nickname when using nick completion (tab) in group chat.')],
'gc_proposed_nick_char': [opt_str, '_', _('Character to propose to add after desired nickname when desired nickname is used by someone else in group chat.')],
......
......@@ -20,7 +20,7 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
import os
import os, sys
from common import gajim
from common import exceptions
......@@ -28,10 +28,13 @@ from common import exceptions
_GAJIM_ERROR_IFACE = 'org.gajim.dbus.Error'
try:
if sys.platform == 'darwin':
import osx.dbus
osx.dbus.load(True)
import dbus
import dbus.service
import dbus.glib
supported = True # does use have D-Bus bindings?
supported = True # does user have D-Bus bindings?
except ImportError:
supported = False
if not os.name == 'nt': # only say that to non Windows users
......@@ -103,7 +106,7 @@ class SessionBus:
session_bus = SessionBus()
def get_interface(interface, path):
'''Returns an interface on the current SessionBus. If the interface isn't
'''Returns an interface on the current SessionBus. If the interface isn\'t
running, it tries to start it first.'''
if not supported:
return None
......
......@@ -30,6 +30,7 @@ import urllib
import errno
import select
import sha
import sys
from encodings.punycode import punycode_encode
from encodings import idna
......@@ -39,6 +40,9 @@ from i18n import ngettext
from xmpp_stringprep import nodeprep, resourceprep, nameprep
if sys.platform == 'darwin':
from osx import nsapp
try:
import winsound # windows-only built-in module for playing wav
import win32api
......@@ -474,7 +478,9 @@ def play_sound_file(path_to_soundfile):
return
if path_to_soundfile is None or not os.path.exists(path_to_soundfile):
return
if os.name == 'nt':
if sys.platform == 'darwin':
nsapp.playFile(path_to_soundfile)
elif os.name == 'nt':
try:
winsound.PlaySound(path_to_soundfile,
winsound.SND_FILENAME|winsound.SND_ASYNC)
......
......@@ -258,7 +258,7 @@ class HostTester(Socks5, IdleObject):
except Exception, ee:
(errnum, errstr) = ee
# 56 is for freebsd
if errnum in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK, 56):
if errnum in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK):
# still trying to connect
return
# win32 needs this
......
......@@ -25,7 +25,7 @@
##
from common import gajim
import os
import os, sys
STATE_UNKNOWN = 'OS probably not supported'
......@@ -47,6 +47,8 @@ try:
lastInputInfo = LASTINPUTINFO()
lastInputInfo.cbSize = ctypes.sizeof(lastInputInfo)
elif sys.platform == 'darwin':
import osx.idle as idle
else: # unix
import idle
except:
......
......@@ -24,7 +24,7 @@
import gtk
import gobject
import os
import os, sys
import common.config
import common.sleepy
from common.i18n import Q_
......@@ -259,7 +259,7 @@ class PreferencesWindow:
self.auto_popup_away_checkbutton.set_active(st)
# sounds
if os.name == 'nt':
if ((os.name == 'nt') or (sys.platform == 'darwin')):
# if windows, player must not become visible on show_all
soundplayer_hbox = self.xml.get_widget('soundplayer_hbox')
soundplayer_hbox.set_no_show_all(True)
......@@ -397,6 +397,12 @@ class PreferencesWindow:
'applications_combobox')
self.xml.get_widget('custom_apps_frame').hide()
self.xml.get_widget('custom_apps_frame').set_no_show_all(True)
if sys.platform == 'darwin':
self.applications_combobox.remove_text(3)
self.applications_combobox.remove_text(2)
self.applications_combobox.remove_text(1)
if gajim.config.get('autodetect_browser_mailer'):
self.applications_combobox.set_active(0)
# else autodetect_browser_mailer is False.
......@@ -408,7 +414,10 @@ class PreferencesWindow:
elif gajim.config.get('openwith') == 'exo-open':
self.applications_combobox.set_active(3)
elif gajim.config.get('openwith') == 'custom':
self.applications_combobox.set_active(4)
if sys.platform == 'darwin':
self.applications_combobox.set_active(1)
else:
self.applications_combobox.set_active(4)
self.xml.get_widget('custom_apps_frame').show()
self.xml.get_widget('custom_browser_entry').set_text(
......@@ -898,19 +907,27 @@ class PreferencesWindow:
def on_applications_combobox_changed(self, widget):
gajim.config.set('autodetect_browser_mailer', False)
if widget.get_active() == 4:
self.xml.get_widget('custom_apps_frame').show()
gajim.config.set('openwith', 'custom')
else:
if sys.platform == 'darwin':
if widget.get_active() == 0:
gajim.config.set('autodetect_browser_mailer', True)
self.xml.get_widget('custom_apps_frame').hide()
elif widget.get_active() == 1:
gajim.config.set('openwith', 'gnome-open')
elif widget.get_active() == 2:
gajim.config.set('openwith', 'kfmclient exec')
elif widget.get_active() == 3:
gajim.config.set('openwith', 'exo-open')
self.xml.get_widget('custom_apps_frame').hide()
self.xml.get_widget('custom_apps_frame').show()
gajim.config.set('openwith', 'custom')
else:
if widget.get_active() == 4:
self.xml.get_widget('custom_apps_frame').show()
gajim.config.set('openwith', 'custom')
else:
if widget.get_active() == 0:
gajim.config.set('autodetect_browser_mailer', True)
elif widget.get_active() == 1:
gajim.config.set('openwith', 'gnome-open')
elif widget.get_active() == 2:
gajim.config.set('openwith', 'kfmclient exec')
elif widget.get_active() == 3:
gajim.config.set('openwith', 'exo-open')
self.xml.get_widget('custom_apps_frame').hide()
gajim.interface.save_config()
def on_custom_browser_entry_changed(self, widget):
......@@ -2105,7 +2122,7 @@ class AccountsWindow:
else:
gajim.interface.roster.regroup = False
gajim.interface.roster.draw_roster()
gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.roster.set_actions_menu_needs_rebuild()
elif not gajim.config.get('enable_zeroconf') and widget.get_active():
self.xml.get_widget('zeroconf_notebook').set_sensitive(True)
......@@ -2137,7 +2154,7 @@ class AccountsWindow:
else:
gajim.interface.roster.regroup = False
gajim.interface.roster.draw_roster()
gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.roster.set_actions_menu_needs_rebuild()
gajim.interface.save_config()
self.on_checkbutton_toggled(widget, 'enable_zeroconf')
......@@ -2564,7 +2581,7 @@ class RemoveAccountWindow:
else:
gajim.interface.roster.regroup = False
gajim.interface.roster.draw_roster()
gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.roster.set_actions_menu_needs_rebuild()
if gajim.interface.instances.has_key('accounts'):
gajim.interface.instances['accounts'].init_accounts()
self.window.destroy()
......@@ -2760,7 +2777,7 @@ class ManageBookmarksWindow:
gajim.connections[account_unicode].bookmarks.append(bmdict)
gajim.connections[account_unicode].store_bookmarks()
gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.roster.set_actions_menu_needs_rebuild()
self.window.destroy()
def on_cancel_button_clicked(self, widget):
......@@ -3347,5 +3364,5 @@ class AccountCreationWizardWindow:
else:
gajim.interface.roster.regroup = False
gajim.interface.roster.draw_roster()
gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.roster.set_actions_menu_needs_rebuild()
gajim.interface.save_config()
......@@ -318,6 +318,10 @@ class ConversationTextview:
return True
def smooth_scroll_timeout(self):
gobject.idle_add(self.do_smooth_scroll_timeout)
return
def do_smooth_scroll_timeout(self):
if not self.smooth_id:
# we finished scrolling
return
......
......@@ -881,7 +881,9 @@ class AboutDialog:
artists = ['Anders Ström', 'Christophe Got', 'Dennis Craven',
'Guillaume Morin', 'Josef Vybíral', 'Membris Khan']
dlg.set_artists(artists)
gobject.idle_add(self.dorun, dlg)
def dorun(self, dlg):
rep = dlg.run()
dlg.destroy()
......@@ -1932,6 +1934,7 @@ class SingleMessageWindow:
self.message_tv_buffer.place_cursor(end_iter)
def save_pos(self):
print 'save_pos'
if gajim.config.get('saveposition'):
# save the window size and position
x, y = self.window.get_position()
......@@ -1943,6 +1946,7 @@ class SingleMessageWindow:
gajim.interface.save_config()
def on_single_message_window_delete_event(self, window, ev):
print 'delete_event'
self.save_pos()
def prepare_widgets_for(self, action):
......@@ -2019,6 +2023,7 @@ class SingleMessageWindow:
self.window.destroy()
def on_close_button_clicked(self, widget):
print 'close'
self.save_pos()
self.window.destroy()
......
......@@ -19,6 +19,7 @@
##
import os
import sys
import gtk
import gobject
import gtkgui_helpers
......@@ -219,6 +220,12 @@ class FeaturesWindow:
def notification_available(self):
if os.name == 'nt':
return False
elif sys.platform == 'darwin':
try:
import osx.growler
except:
return False
return True
from common import dbus_support
if self.dbus_available() and dbus_support.get_notifications_interface():
return True
......
......@@ -40,6 +40,9 @@ def send_error(error_message):
sys.exit(1)
try:
if sys.platform == 'darwin':
import osx.dbus
osx.dbus.load(False)
import dbus
import dbus.service
import dbus.glib
......
......@@ -25,10 +25,17 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
import sys
import os
import urllib
if sys.platform == 'darwin':
OSX_FRAMEWORK='/Library/Frameworks/GTK+.framework/Versions/Current'
sys.path.append('%s/lib/python2.5/site-packages' % OSX_FRAMEWORK)
sys.path.append('%s/lib/python2.5/site-packages/gtk-2.0' % OSX_FRAMEWORK)
os.environ['PATH'] = '%s/bin:' % OSX_FRAMEWORK + os.environ['PATH']
import logging
consoleloghandler = logging.StreamHandler()
consoleloghandler.setLevel(1)
......@@ -294,6 +301,9 @@ def pid_alive():
if get_p(pid) in ('python.exe', 'gajim.exe'):
return True
return False
elif sys.platform == 'darwin':
from osx import checkPID
return checkPID(pid, 'gajim')
try:
if not os.path.exists('/proc'):
return True # no /proc, assume Gajim is running
......@@ -356,6 +366,9 @@ def on_exit():
# delete pid file on normal exit
if os.path.exists(pid_filename):
os.remove(pid_filename)
if sys.platform == 'darwin':
import osx
osx.shutdown()
import atexit
atexit.register(on_exit)
......@@ -1430,7 +1443,7 @@ class Interface:
# We received a bookmark item from the server (JEP48)
# Auto join GC windows if neccessary
self.roster.actions_menu_needs_rebuild = True
self.roster.set_actions_menu_needs_rebuild()
invisible_show = gajim.SHOW_LIST.index('invisible')
# do not autojoin if we are invisible
if gajim.connections[account].connected == invisible_show:
......@@ -1793,7 +1806,7 @@ class Interface:
'''SIGNED_IN event is emitted when we sign in, so handle it'''
# block signed in notifications for 30 seconds
gajim.block_signed_in_notifications[account] = True
self.roster.actions_menu_needs_rebuild = True
self.roster.set_actions_menu_needs_rebuild()
if self.sleeper.getState() != common.sleepy.STATE_UNKNOWN and \
gajim.connections[account].connected in (2, 3):
# we go online or free for chat, so we activate auto status
......@@ -2736,9 +2749,10 @@ class Interface:
self.systray_enabled = False
self.systray_capabilities = False
if os.name == 'nt' and gtk.pygtk_version >= (2, 10, 0) and\
gtk.gtk_version >= (2, 10, 0):
if (((os.name == 'nt') or (sys.platform == 'darwin')) and
(gtk.pygtk_version >= (2, 10, 0)) and
(gtk.gtk_version >= (2, 10, 0))):
import statusicon
self.systray = statusicon.StatusIcon()
self.systray_capabilities = True
......@@ -2792,7 +2806,7 @@ if __name__ == '__main__':
print >> sys.stderr, "Encodings: d:%s, fs:%s, p:%s" % \
(sys.getdefaultencoding(), sys.getfilesystemencoding(), locale.getpreferredencoding())
if os.name != 'nt':
if ((os.name != 'nt') and (sys.platform != 'darwin')):
# Session Management support
try: