--- nfo/projects/netfraggle/bin/FraggleTopicFrame.py 2004/08/27 21:14:02 1.4 +++ nfo/projects/netfraggle/bin/FraggleTopicFrame.py 2004/09/15 22:31:27 1.7 @@ -1,7 +1,18 @@ #Boa:MDIChild:FraggleTopicFrame -# $Id: FraggleTopicFrame.py,v 1.4 2004/08/27 21:14:02 xabbu Exp $ +# $Id: FraggleTopicFrame.py,v 1.7 2004/09/15 22:31:27 xabbu Exp $ # $Log: FraggleTopicFrame.py,v $ +# Revision 1.7 2004/09/15 22:31:27 xabbu +# + in function OnUpdateButtonButton call to fraggleSync replaced with syncTopics +# + topics are being recieved from the server now +# +# Revision 1.6 2004/08/31 02:25:34 joko +# U removed FraggleTopicDetailFrame in favor of FraggleItemFrame and FraggleListFrame +# U now clearing topicListBox before updating it +# +# Revision 1.5 2004/08/30 13:06:16 joko +# U now gets config via self.engine +# # Revision 1.4 2004/08/27 21:14:02 xabbu # TopicDetails can now be closed. # GUI change on Preferences Dialog in order to prepare multiple server profiles. @@ -21,10 +32,11 @@ from wxPython.wx import * from wxPython.stc import * -import FraggleTopicDetailFrame +import FraggleItemFrame +import FraggleListFrame -def create(parent, config): - return FraggleTopicFrame(parent, config) +def create(parent): + return FraggleTopicFrame(parent) [wxID_FRAGGLETOPICFRAME, wxID_FRAGGLETOPICFRAMETOPICLISTBOX, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, @@ -56,21 +68,25 @@ # generated method, don't edit pass - def __init__(self, parent, config): + def __init__(self, parent): self.parent = parent - self.config = config + + # render widgets self._init_ctrls(parent) + + # get engine-instance (singleton) import __main__ self.engine = __main__.engine def OnUpdateButtonButton(self, event): #event.Skip() - # todo: make fraggleEngine read config on its own - self.engine.fraggleSync(self.config) + self.engine.syncTopics() topics = self.engine.getTopics() + #print topics + self.topicListBox.Clear() i = 0 for topic in topics: - self.topicListBox.Append(topic['name'], i) + self.topicListBox.Append(topics[topic], i) i = i + 1 def OnTopicListBoxListboxDclick(self, event): @@ -90,9 +106,10 @@ # resolve associated topic entry topics = self.engine.getTopics() - title = topics[seldata]['name'] + title = topics[str(seldata)] + #print title - frame = FraggleTopicDetailFrame.create(self.parent) + frame = FraggleListFrame.create(self.parent) frame.SetName(str(seldata)) frame.SetTitle(title) @@ -101,5 +118,6 @@ frame.Move(pos) self.parent.Fit() + frame.load_content() \ No newline at end of file