/[cvs]/nfo/projects/netfraggle/bin/FraggleTopicFrame.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/FraggleTopicFrame.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by xabbu, Fri Aug 27 21:14:02 2004 UTC revision 1.6 by joko, Tue Aug 31 02:25:34 2004 UTC
# Line 2  Line 2 
2    
3  # $Id$  # $Id$
4  # $Log$  # $Log$
5    # Revision 1.6  2004/08/31 02:25:34  joko
6    # U removed FraggleTopicDetailFrame in favor of FraggleItemFrame and FraggleListFrame
7    # U now clearing topicListBox before updating it
8    #
9    # Revision 1.5  2004/08/30 13:06:16  joko
10    # U now gets config via self.engine
11    #
12  # Revision 1.4  2004/08/27 21:14:02  xabbu  # Revision 1.4  2004/08/27 21:14:02  xabbu
13  # TopicDetails can now be closed.  # TopicDetails can now be closed.
14  # GUI change on Preferences Dialog in order to prepare multiple server profiles.  # GUI change on Preferences Dialog in order to prepare multiple server profiles.
# Line 21  Line 28 
28  from wxPython.wx import *  from wxPython.wx import *
29  from wxPython.stc import *  from wxPython.stc import *
30    
31  import FraggleTopicDetailFrame  import FraggleItemFrame
32    import FraggleListFrame
33    
34  def create(parent, config):  def create(parent):
35      return FraggleTopicFrame(parent, config)      return FraggleTopicFrame(parent)
36    
37  [wxID_FRAGGLETOPICFRAME, wxID_FRAGGLETOPICFRAMETOPICLISTBOX,  [wxID_FRAGGLETOPICFRAME, wxID_FRAGGLETOPICFRAMETOPICLISTBOX,
38   wxID_FRAGGLETOPICFRAMEUPDATEBUTTON,   wxID_FRAGGLETOPICFRAMEUPDATEBUTTON,
# Line 56  class FraggleTopicFrame(wxMDIChildFrame) Line 64  class FraggleTopicFrame(wxMDIChildFrame)
64          # generated method, don't edit          # generated method, don't edit
65          pass          pass
66    
67      def __init__(self, parent, config):      def __init__(self, parent):
68          self.parent = parent          self.parent = parent
69          self.config = config  
70            # render widgets
71          self._init_ctrls(parent)          self._init_ctrls(parent)
72    
73            # get engine-instance (singleton)
74          import __main__          import __main__
75          self.engine = __main__.engine          self.engine = __main__.engine
76    
77      def OnUpdateButtonButton(self, event):      def OnUpdateButtonButton(self, event):
78          #event.Skip()          #event.Skip()
79          # todo: make fraggleEngine read config on its own          self.engine.fraggleSync()
         self.engine.fraggleSync(self.config)  
80          topics = self.engine.getTopics()          topics = self.engine.getTopics()
81            self.topicListBox.Clear()
82          i = 0          i = 0
83          for topic in topics:          for topic in topics:
84              self.topicListBox.Append(topic['name'], i)              self.topicListBox.Append(topic['name'], i)
# Line 91  class FraggleTopicFrame(wxMDIChildFrame) Line 102  class FraggleTopicFrame(wxMDIChildFrame)
102          # resolve associated topic entry          # resolve associated topic entry
103          topics = self.engine.getTopics()          topics = self.engine.getTopics()
104          title = topics[seldata]['name']          title = topics[seldata]['name']
105            result = topics[seldata]['result']
106    
107          frame = FraggleTopicDetailFrame.create(self.parent)          if result == 'item':
108                frame = FraggleItemFrame.create(self.parent)
109            elif result == 'list':
110                frame = FraggleListFrame.create(self.parent)
111          frame.SetName(str(seldata))          frame.SetName(str(seldata))
112          frame.SetTitle(title)          frame.SetTitle(title)
113                    
# Line 101  class FraggleTopicFrame(wxMDIChildFrame) Line 116  class FraggleTopicFrame(wxMDIChildFrame)
116          frame.Move(pos)          frame.Move(pos)
117          self.parent.Fit()          self.parent.Fit()
118                    
119            frame.load_content()
120                    
121                    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed