1 |
joko |
1.1 |
# $Id$ |
2 |
|
|
# $Log$ |
3 |
|
|
|
4 |
|
|
from BoaAboutDialog import * |
5 |
|
|
|
6 |
|
|
import fraggleEngine |
7 |
|
|
|
8 |
|
|
def create(parent): |
9 |
|
|
return FraggleAboutDialog(parent) |
10 |
|
|
|
11 |
|
|
class FraggleAboutDialog(BoaAboutDialog): |
12 |
|
|
|
13 |
|
|
def __init__(self, parent): |
14 |
|
|
BoaAboutDialog.__init__(self, parent) |
15 |
|
|
self._init_content() |
16 |
|
|
|
17 |
|
|
def _init_content(self): |
18 |
|
|
self.LogoBitmap.SetBitmap(wxBitmap( |
19 |
|
|
os.path.join(APPLOCATION, 'res', 'netfrag179x104.gif'), |
20 |
|
|
wxBITMAP_TYPE_GIF)) |
21 |
|
|
self.LogoBitmap |
22 |
|
|
self.AboutText.SetWindowStyle(wxSUNKEN_BORDER) |
23 |
|
|
self.Centre() |
24 |
|
|
|
25 |
|
|
#global urlOpener |
26 |
|
|
#self.AboutText.urlOpener = urlOpener |
27 |
|
|
self.AboutText.urlOpener = fraggleEngine.urlOpener() |
28 |
|
|
|
29 |
|
|
#SetHTMLFonts(self.AboutText, self.GetFont()) |
30 |
|
|
|
31 |
|
|
# load the HTML |
32 |
|
|
fname = os.path.join(APPLOCATION, 'res', 'about.html.dat') |
33 |
|
|
try: |
34 |
|
|
textfile = file(fname, "r") |
35 |
|
|
text = textfile.read() |
36 |
|
|
textfile.close() |
37 |
|
|
except: |
38 |
|
|
text = "<b>Could not load data file</b>:<br>%s" % fname |
39 |
|
|
#feedsnumber = len(engine.getFeedsNames()) |
40 |
|
|
#topicsnumber = engine.getTotalTopicsCount() |
41 |
|
|
#feedssize = engine.getFeedsSize() |
42 |
|
|
#topicssize = engine.getTotalTopicsSize() |
43 |
|
|
replacements = {"netfraggleversion": NETFRAGGLEVERSION, |
44 |
|
|
"programdir": APPLOCATION, |
45 |
|
|
#"parserversion": engine.parserversion, |
46 |
|
|
#"datadir": engine.savedir, |
47 |
|
|
"pythonversion": PYTHONVERSION, |
48 |
|
|
"wxpythonversion": WXPYTHONVERSION, |
49 |
|
|
"pyxmlversion": PYXMLVERSION, |
50 |
|
|
"osname": OSNAME, |
51 |
|
|
#"timesexecuted": engine.getSetting(TIMESRUN, 0), |
52 |
|
|
#"feedsnumber": feedsnumber, |
53 |
|
|
#"topicsnumber": topicsnumber, |
54 |
|
|
#"feedssize": "%.1f" % (feedssize/1024.0), |
55 |
|
|
#"topicssize": "%.1f" % (topicssize/1024.0), |
56 |
|
|
#"averagefeedsize": "%.1f" % ((feedssize+topicssize)/feedsnumber/1024.0), |
57 |
|
|
#"sessionuptime": mw.uptimeToStr(mw.getSessionUptime()), |
58 |
|
|
#"totaluptime": mw.uptimeToStr(mw.getTotalUptime()), |
59 |
|
|
#"enginetype": fraggleengine.__version__, |
60 |
|
|
} |
61 |
|
|
text = text % replacements |
62 |
|
|
self.AboutText.SetPage(text) |
63 |
|
|
|