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
This commit is contained in:
Goffi 2010-08-18 22:34:35 +08:00
commit 991d367f85
3 changed files with 28 additions and 6 deletions

View file

@ -20,12 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
#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 @@ class JP():
%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)"))

View file

@ -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")

View file

@ -41,12 +41,13 @@ import constants
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 @@ class MainWindow(wx.Frame, QuickApp):
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 @@ class MainWindow(wx.Frame, QuickApp):
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 @@ class MainWindow(wx.Frame, QuickApp):
#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()