Skip to content

Commit

Permalink
gtk3 compat: make about dialog work
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@654 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 30, 2012
1 parent 5070c09 commit 7145784
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/xpra/platform/client_extras_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,13 @@ def about(self, *args):
self.about_dialog.present()
return
dialog = gtk.AboutDialog()
def on_website_hook(dialog, web, *args):
webbrowser.open("http://xpra.org/")
def on_email_hook(dialog, mail, *args):
webbrowser.open("mailto://"+mail)
gtk.about_dialog_set_url_hook(on_website_hook)
gtk.about_dialog_set_email_hook(on_email_hook)
if not is_gtk3():
def on_website_hook(dialog, web, *args):
webbrowser.open("http://xpra.org/")
def on_email_hook(dialog, mail, *args):
webbrowser.open("mailto://"+mail)
gtk.about_dialog_set_url_hook(on_website_hook)
gtk.about_dialog_set_email_hook(on_email_hook)
dialog.set_name("Xpra")
from xpra import __version__
dialog.set_version(__version__)
Expand Down Expand Up @@ -480,7 +481,10 @@ def get_license_text(self):
filename = os.path.join(self.get_data_dir(), 'COPYING')
if os.path.exists(filename):
try:
license_file = open(filename, mode='rb')
if sys.version < '3':
license_file = open(filename, mode='rb')
else:
license_file = open(filename, mode='r', encoding='ascii')
return license_file.read()
finally:
license_file.close()
Expand Down

0 comments on commit 7145784

Please sign in to comment.