changeset 191:1438a1337732

About added/updated for Wix & Jp - Jp version now follow the one of core SàT - Wix has now an about box, and its version follow the one of core SàT
author Goffi <goffi@goffi.org>
date Wed, 18 Aug 2010 22:34:35 +0800
parents 31632472e857
children 879beacb8e16
files frontends/jp/jp frontends/wix/constants.py frontends/wix/main_window.py
diffstat 3 files changed, 28 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/jp/jp	Wed Aug 18 21:42:30 2010 +0800
+++ b/frontends/jp/jp	Wed Aug 18 22:34:35 2010 +0800
@@ -20,12 +20,11 @@
 """
 
 #consts
-name = "jp"
-version = "0.0.1"
-about = name+" v"+version+""" (c) Jérôme Poisson (aka Goffi) 2009, 2010
+name = u"jp"
+about = name+u""" v%s (c) Jérôme Poisson (aka Goffi) 2009, 2010
 
 ---
-"""+name+""" Copyright (C) 2009, 2010  Jérôme Poisson (aka Goffi)
+"""+name+u""" Copyright (C) 2009, 2010  Jérôme Poisson (aka Goffi)
 This program comes with ABSOLUTELY NO WARRANTY;
 This is free software, and you are welcome to redistribute it
 under certain conditions.
@@ -85,7 +84,8 @@
 
         %prog --help for options list
         """)
-        parser = OptionParser(usage=usage,version=about)
+        version = unicode(self.bridge.getVersion())
+        parser = OptionParser(usage=usage,version=about % version)
 
         parser.add_option("-p", "--profile", action="store", type="string", default='@DEFAULT@',
                     help=_("Use PROFILE profile key (default: %default)"))
--- a/frontends/wix/constants.py	Wed Aug 18 21:42:30 2010 +0800
+++ b/frontends/wix/constants.py	Wed Aug 18 22:34:35 2010 +0800
@@ -1,6 +1,8 @@
 import sys
 import __builtin__
 
+__builtin__.__dict__['APP_NAME'] = "Wix"
+__builtin__.__dict__['LICENCE_PATH'] = "../../COPYING"
 __builtin__.__dict__['IMAGE_DIR'] = sys.path[0]+'/images'
 
 __builtin__.__dict__['msgOFFLINE']          = _("offline")
--- a/frontends/wix/main_window.py	Wed Aug 18 21:42:30 2010 +0800
+++ b/frontends/wix/main_window.py	Wed Aug 18 22:34:35 2010 +0800
@@ -41,12 +41,13 @@
 idCONNECT,\
 idDISCONNECT,\
 idEXIT,\
+idABOUT,\
 idPARAM,\
 idADD_CONTACT,\
 idREMOVE_CONTACT,\
 idSHOW_PROFILE,\
 idJOIN_ROOM,\
-idFIND_GATEWAYS = range(9)
+idFIND_GATEWAYS = range(10)
 
 class ChatList(QuickChatList):
     """This class manage the list of chat windows"""
@@ -132,6 +133,7 @@
         connectMenu.Append(idDISCONNECT, _("&Disconnect	CTRL-d"),_(" Disconnect from the server"))
         connectMenu.Append(idPARAM,_("&Parameters"),_(" Configure the program"))
         connectMenu.AppendSeparator()
+        connectMenu.Append(idABOUT,_("A&bout"),_(" About %s") % APP_NAME)
         connectMenu.Append(idEXIT,_("E&xit"),_(" Terminate the program"))
         contactMenu = wx.Menu()
         contactMenu.Append(idADD_CONTACT, _("&Add contact"),_(" Add a contact to your list"))
@@ -176,6 +178,7 @@
         wx.EVT_MENU(self, idCONNECT, self.onConnectRequest)
         wx.EVT_MENU(self, idDISCONNECT, self.onDisconnectRequest)
         wx.EVT_MENU(self, idPARAM, self.onParam)
+        wx.EVT_MENU(self, idABOUT, self.onAbout)
         wx.EVT_MENU(self, idEXIT, self.onExit)
         wx.EVT_MENU(self, idADD_CONTACT, self.onAddContact)
         wx.EVT_MENU(self, idREMOVE_CONTACT, self.onRemoveContact)
@@ -372,6 +375,23 @@
         #XMLUI(self, xml_data = xmlui)
         param=Param(self)
 
+    def onAbout(self, e):
+        about = wx.AboutDialogInfo()
+        about.SetName(APP_NAME)
+        about.SetVersion (unicode(self.bridge.getVersion()))
+        about.SetCopyright(u"(C) 2009,2010 Jérôme Poisson aka Goffi")
+        about.SetDescription( _(u"%(name)s is a SàT (Salut à Toi) frontend\n"+
+        u"%(name)s is based on WxPython, and is the standard graphic interface of SàT") % {'name':APP_NAME})
+        about.SetWebSite(("http://www.goffi.org", "Goffi's non-hebdo (french)"))
+        about.SetDevelopers([ "Goffi (Jérôme Poisson)"])
+        try:
+            with open(LICENCE_PATH,"r") as licence:
+                about.SetLicence(''.join(licence.readlines()))
+        except:
+            pass
+
+        wx.AboutBox(about)
+
     def onExit(self, e):
         self.Close()