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

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

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

revision 1.6 by xabbu, Fri Aug 27 21:14:02 2004 UTC revision 1.8 by xabbu, Sun Aug 29 23:23:09 2004 UTC
# Line 89  class fraggleDialogPrefs(wxDialog): Line 89  class fraggleDialogPrefs(wxDialog):
89                parent=self, pos=wxPoint(80, 8), size=wxSize(124, 16), style=0,                parent=self, pos=wxPoint(80, 8), size=wxSize(124, 16), style=0,
90                validator=wxDefaultValidator, value='')                validator=wxDefaultValidator, value='')
91          self.comboBoxProfile.SetLabel('')          self.comboBoxProfile.SetLabel('')
92            EVT_COMBOBOX(self.comboBoxProfile,
93                  wxID_FRAGGLEDIALOGPREFSCOMBOBOXPROFILE,
94                  self.OnComboboxprofileCombobox)
95    
96          self.staticText6 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT6,          self.staticText6 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT6,
97                label='Profile', name='staticText6', parent=self, pos=wxPoint(16,                label='Profile', name='staticText6', parent=self, pos=wxPoint(16,
# Line 97  class fraggleDialogPrefs(wxDialog): Line 100  class fraggleDialogPrefs(wxDialog):
100          self.buttonProfileSave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE,          self.buttonProfileSave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE,
101                label='Save', name='buttonProfileSave', parent=self,                label='Save', name='buttonProfileSave', parent=self,
102                pos=wxPoint(272, 8), size=wxSize(40, 16), style=0)                pos=wxPoint(272, 8), size=wxSize(40, 16), style=0)
103            EVT_BUTTON(self.buttonProfileSave,
104                  wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE,
105                  self.OnButtonprofilesaveButton)
106    
107          self.buttonProfileDel = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL,          self.buttonProfileDel = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL,
108                label='Delete', name='buttonProfileDel', parent=self,                label='Delete', name='buttonProfileDel', parent=self,
109                pos=wxPoint(320, 8), size=wxSize(40, 16), style=0)                pos=wxPoint(320, 8), size=wxSize(40, 16), style=0)
110            EVT_BUTTON(self.buttonProfileDel,
111                  wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL,
112                  self.OnButtonprofiledelButton)
113    
114          self.buttonProfileLoad = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD,          self.buttonProfileLoad = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD,
115                label='Load', name='buttonProfileLoad', parent=self,                label='Load', name='buttonProfileLoad', parent=self,
116                pos=wxPoint(216, 8), size=wxSize(48, 16), style=0)                pos=wxPoint(216, 8), size=wxSize(48, 16), style=0)
117            EVT_BUTTON(self.buttonProfileLoad,
118                  wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD,
119                  self.OnButtonprofileloadButton)
120    
121        def __init_profiles(self):
122            list = self.parent.preferencesCtl.getProfileList()
123            print list
124            for i in list:
125                self.comboBoxProfile.Append(i)
126            
127      def __init__(self, parent):      def __init__(self, parent):
128          self.parent = parent          self.parent = parent
129          self._init_ctrls(parent)          self._init_ctrls(parent)
130            self.__init_profiles()
131            
132      def OnBtsaveButton(self, event):      def OnBtsaveButton(self, event):
133    
134          # convert from utf-8: required for win32          # convert from utf-8: required for win32
# Line 134  class fraggleDialogPrefs(wxDialog): Line 153  class fraggleDialogPrefs(wxDialog):
153                    
154      def updateConfig(self):      def updateConfig(self):
155          config = self.parent.preferencesCtl.getConfig()          config = self.parent.preferencesCtl.getConfig()
156          self.textCtrlUsername.SetValue(config["username"])          try:
157          self.textCtrlPassword.SetValue(config["password"])                  self.textCtrlUsername.SetValue(config["username"])
158          self.textCtrlServer.SetValue(config["url"])              self.textCtrlPassword.SetValue(config["password"])    
159          self.textCtrlRetrieval.SetValue(config["retrieval"])              self.textCtrlServer.SetValue(config["url"])
160                self.textCtrlRetrieval.SetValue(config["retrieval"])
161            except TypeError:
162                self.textCtrlUsername.SetValue("username")
163                self.textCtrlPassword.SetValue("password")    
164                self.textCtrlServer.SetValue("url")
165                self.textCtrlRetrieval.SetValue("retrieval")
166                
167      def OnButton1Button(self, event):      def OnButton1Button(self, event):
168          self.Hide()          self.Hide()
169          event.Skip()          event.Skip()
170    
171        def OnButtonprofilesaveButton(self, event):
172            username = self.textCtrlUsername.GetValue()
173            password = self.textCtrlPassword.GetValue()    
174            url = self.textCtrlServer.GetValue()
175            retrieval = self.textCtrlRetrieval.GetValue()
176            self.parent.preferencesCtl.setConfig(username,password,url,retrieval)
177            i = self.parent.preferencesCtl.appendProfile(self.comboBoxProfile.GetValue(),self.parent.preferencesCtl.configList)
178            if i == 0:
179                self.comboBoxProfile.Append(self.comboBoxProfile.GetValue())
180            
181            self.parent.preferencesCtl.saveProfiles()
182            event.Skip()
183    
184        def OnButtonprofileloadButton(self, event):
185            self.parent.preferencesCtl.loadProfile(self.comboBoxProfile.GetValue())
186            self.updateConfig()
187            event.Skip()
188    
189        def OnButtonprofiledelButton(self, event):
190            self.parent.preferencesCtl.deleteProfile(self.comboBoxProfile.GetValue())
191            self.comboBoxProfile.Delete(self.comboBoxProfile.FindString(self.comboBoxProfile.GetValue()))
192            self.parent.preferencesCtl.saveProfiles()
193            self.updateConfig()
194            event.Skip()
195    
196        def OnComboboxprofileCombobox(self, event):
197            event.Skip()
198                    

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

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