1 |
joko |
1.1 |
#!/usr/bin/env python |
2 |
|
|
|
3 |
|
|
# generated by wxGlade 0.3.3 on Wed Aug 25 15:12:49 2004 |
4 |
|
|
# code ripped from Pears: http://project5.freezope.org/pears/ |
5 |
|
|
|
6 |
|
|
# $Id$ |
7 |
|
|
# $Log$ |
8 |
|
|
|
9 |
|
|
import os |
10 |
|
|
|
11 |
|
|
import fraggleEngine |
12 |
|
|
from fraggleConstants import * |
13 |
|
|
|
14 |
|
|
import wx |
15 |
|
|
from wxPython.wx import * |
16 |
|
|
from FraggleHtmlWindow import FraggleHtmlWindow |
17 |
|
|
|
18 |
|
|
# begin wxGlade: dependencies |
19 |
|
|
# end wxGlade |
20 |
|
|
|
21 |
|
|
class FraggleAboutDialog(wx.Dialog): |
22 |
|
|
def __init__(self, *args, **kwds): |
23 |
|
|
# begin wxGlade: FraggleAboutDialog.__init__ |
24 |
|
|
kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
25 |
|
|
wx.Dialog.__init__(self, *args, **kwds) |
26 |
|
|
self.bitmap_2 = wx.StaticBitmap(self, -1, wx.Bitmap(os.path.join(APPLOCATION, 'res', 'netfrag179x104.gif'), wx.BITMAP_TYPE_ANY)) |
27 |
|
|
self.AboutText = FraggleHtmlWindow(self, -1) |
28 |
|
|
self.button_1 = wx.Button(self, wxID_CANCEL, "Close") |
29 |
|
|
|
30 |
|
|
self.__set_properties() |
31 |
|
|
self.__do_layout() |
32 |
|
|
# end wxGlade |
33 |
|
|
|
34 |
|
|
def __set_properties(self): |
35 |
|
|
# begin wxGlade: FraggleAboutDialog.__set_properties |
36 |
|
|
self.SetTitle("About Fraggle") |
37 |
|
|
self.AboutText.SetSize((305, 200)) |
38 |
|
|
self.button_1.SetDefault() |
39 |
|
|
# end wxGlade |
40 |
|
|
|
41 |
|
|
def __do_layout(self): |
42 |
|
|
# begin wxGlade: FraggleAboutDialog.__do_layout |
43 |
|
|
grid_sizer_2 = wx.FlexGridSizer(3, 3, 0, 0) |
44 |
|
|
grid_sizer_4 = wx.FlexGridSizer(2, 2, 8, 3) |
45 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
46 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
47 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
48 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND|wx.ALIGN_RIGHT, 0) |
49 |
|
|
grid_sizer_4.Add(self.bitmap_2, 0, 0, 0) |
50 |
|
|
grid_sizer_4.Add(self.AboutText, 1, wx.EXPAND, 0) |
51 |
|
|
grid_sizer_4.Add((20, 20), 0, 0, 0) |
52 |
|
|
grid_sizer_4.Add(self.button_1, 0, wx.ALIGN_RIGHT, 0) |
53 |
|
|
grid_sizer_2.Add(grid_sizer_4, 1, wx.EXPAND, 0) |
54 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
55 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
56 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
57 |
|
|
grid_sizer_2.Add((5, 5), 0, wx.EXPAND, 0) |
58 |
|
|
self.SetAutoLayout(1) |
59 |
|
|
self.SetSizer(grid_sizer_2) |
60 |
|
|
grid_sizer_2.Fit(self) |
61 |
|
|
grid_sizer_2.SetSizeHints(self) |
62 |
|
|
self.Layout() |
63 |
|
|
# end wxGlade |
64 |
|
|
|
65 |
|
|
# end of class FraggleAboutDialog |
66 |
|
|
|
67 |
|
|
class AboutDialog(FraggleAboutDialog): |
68 |
|
|
"""Wraps class created by wxGlade in pearsgui.""" |
69 |
|
|
def __init__(self, *args, **kwds): |
70 |
|
|
FraggleAboutDialog.__init__(self, *args, **kwds) |
71 |
|
|
|
72 |
|
|
self.AboutText.SetWindowStyle(wx.SUNKEN_BORDER) |
73 |
|
|
self.Centre() |
74 |
|
|
global url |
75 |
|
|
#self.AboutText.urlOpener = url |
76 |
|
|
self.AboutText.urlOpener = fraggleEngine.urlOpener() |
77 |
|
|
|
78 |
|
|
#SetHTMLFonts(self.AboutText, self.GetFont()) |
79 |
|
|
|
80 |
|
|
# load the HTML |
81 |
|
|
fname = os.path.join(APPLOCATION, 'res', 'about.html.dat') |
82 |
|
|
try: |
83 |
|
|
textfile = file(fname, "r") |
84 |
|
|
text = textfile.read() |
85 |
|
|
textfile.close() |
86 |
|
|
except: |
87 |
|
|
text = "<b>Could not load data file</b>:<br>%s" % fname |
88 |
|
|
#feedsnumber = len(engine.getFeedsNames()) |
89 |
|
|
#topicsnumber = engine.getTotalTopicsCount() |
90 |
|
|
#feedssize = engine.getFeedsSize() |
91 |
|
|
#topicssize = engine.getTotalTopicsSize() |
92 |
|
|
replacements = {"netfraggleversion": NETFRAGGLEVERSION, |
93 |
|
|
"programdir": APPLOCATION, |
94 |
|
|
#"parserversion": engine.parserversion, |
95 |
|
|
#"datadir": engine.savedir, |
96 |
|
|
"pythonversion": PYTHONVERSION, |
97 |
|
|
"wxpythonversion": WXPYTHONVERSION, |
98 |
|
|
#"timesexecuted": engine.getSetting(TIMESRUN, 0), |
99 |
|
|
#"feedsnumber": feedsnumber, |
100 |
|
|
#"topicsnumber": topicsnumber, |
101 |
|
|
#"feedssize": "%.1f" % (feedssize/1024.0), |
102 |
|
|
#"topicssize": "%.1f" % (topicssize/1024.0), |
103 |
|
|
#"averagefeedsize": "%.1f" % ((feedssize+topicssize)/feedsnumber/1024.0), |
104 |
|
|
#"sessionuptime": mw.uptimeToStr(mw.getSessionUptime()), |
105 |
|
|
#"totaluptime": mw.uptimeToStr(mw.getTotalUptime()), |
106 |
|
|
#"enginetype": fraggleengine.__version__, |
107 |
|
|
} |
108 |
|
|
text = text % replacements |
109 |
|
|
self.AboutText.SetPage(text) |
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|