/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/projdialog.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/projdialog.py

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

revision 730 by jonathan, Thu Apr 24 16:07:41 2003 UTC revision 751 by jonathan, Fri Apr 25 14:23:19 2003 UTC
# Line 1  Line 1 
1  #!/usr/bin/env python  # Copyright (c) 2003 by Intevation GmbH
2  # generated by wxGlade 0.2.1 on Thu Apr 17 11:51:39 2003  # Authors:
3    # Jonathan Coles <[email protected]>
4    #
5    # This program is free software under the GPL (>=v2)
6    # Read the file COPYING coming with Thuban for details.
7                                                                                    
8  import os, sys  import os, sys
9  from wxPython.wx import *  from wxPython.wx import *
10    
# Line 15  from Thuban.UI.dialogs import NonModalDi Line 19  from Thuban.UI.dialogs import NonModalDi
19    
20  ID_PROJ_ADVANCED  = 4001  ID_PROJ_ADVANCED  = 4001
21  ID_PROJ_PROJCHOICE = 4002  ID_PROJ_PROJCHOICE = 4002
22  ID_PROJ_SAVEAS    = 4003  ID_PROJ_ADDTOLIST    = 4003
23  ID_PROJ_NEW       = 4004  ID_PROJ_NEW       = 4004
24  ID_PROJ_TRY       = 4005  ID_PROJ_TRY       = 4005
25  ID_PROJ_REVERT    = 4006  ID_PROJ_REVERT    = 4006
# Line 33  CLIENT_PROJFILE = 1 Line 37  CLIENT_PROJFILE = 1
37    
38  class ProjFrame(NonModalDialog):  class ProjFrame(NonModalDialog):
39    
40      def __init__(self, parent, name, receiver, *args, **kwds):      def __init__(self, parent, name, title, receiver):
41          """Initialize the projection dialog.          """Initialize the projection dialog.
42    
43          receiver -- An object that implements the following methods:          receiver -- An object that implements the following methods:
# Line 42  class ProjFrame(NonModalDialog): Line 46  class ProjFrame(NonModalDialog):
46          """          """
47                    
48          self.receiver = receiver          self.receiver = receiver
49          self.originalProjection = -1          self.haveTried = False
50          self.curProjPanel = None          self.curProjPanel = None
51    
52          self.projPanels = []          self.projPanels = []
# Line 55  class ProjFrame(NonModalDialog): Line 59  class ProjFrame(NonModalDialog):
59          self.projPanels.append(          self.projPanels.append(
60              ("latlong", _("Geographic"), GeoPanel))              ("latlong", _("Geographic"), GeoPanel))
61    
62          NonModalDialog.__init__(self, parent, name, "")          NonModalDialog.__init__(self, parent, name, title)
63          # originally generate by wxGlade          # originally generate by wxGlade
64          self.panel_1 = wxPanel(self, -1)          self.panel_1 = wxPanel(self, -1)
65          self.panel_edit = wxPanel(self, -1)          self.panel_edit = wxPanel(self, -1)
66          self.panel_buttons = wxPanel(self, -1)          self.panel_buttons = wxPanel(self, -1)
67          self.label_5 = wxStaticText(self.panel_1, -1, _("Available Projections:"))          self.label_5 = wxStaticText(self.panel_1, -1, _("Available Projections:"))
68          self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, style=wxLB_EXTENDED |wxLB_SORT)          self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, style=wxLB_EXTENDED|wxLB_SORT)
69          self.projfilepath = wxStaticText(self.panel_1, -1, "")          self.projfilepath = wxStaticText(self.panel_1, -1, "")
70          self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:"))          self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:"))
71          self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "")          self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "")
# Line 72  class ProjFrame(NonModalDialog): Line 76  class ProjFrame(NonModalDialog):
76          self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, _("Remove"))          self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, _("Remove"))
77          self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New"))          self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New"))
78          self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Save"))          self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Save"))
79          self.button_add = wxButton(self.panel_edit, ID_PROJ_SAVEAS,          self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST,
80                                        _("Add to List"))                                        _("Add to List"))
81          self.button_try = wxButton(self.panel_buttons, ID_PROJ_TRY, _("Try"))          self.button_try = wxButton(self.panel_buttons, ID_PROJ_TRY, _("Try"))
82          self.button_revert = wxButton(self.panel_buttons, ID_PROJ_REVERT, _("Revert"))          self.button_revert = wxButton(self.panel_buttons, ID_PROJ_REVERT, _("Revert"))
# Line 83  class ProjFrame(NonModalDialog): Line 87  class ProjFrame(NonModalDialog):
87          self.__do_layout()          self.__do_layout()
88          # wxGlade          # wxGlade
89    
90            self.originalProjection = self.receiver.GetProjection()
91    
92          self.__DoOnProjAvail()          self.__DoOnProjAvail()
93                    
94          EVT_BUTTON(self, ID_PROJ_TRY, self._OnTry)          EVT_BUTTON(self, ID_PROJ_TRY, self._OnTry)
# Line 97  class ProjFrame(NonModalDialog): Line 103  class ProjFrame(NonModalDialog):
103    
104          EVT_BUTTON(self, ID_PROJ_NEW, self._OnNew)          EVT_BUTTON(self, ID_PROJ_NEW, self._OnNew)
105          EVT_BUTTON(self, ID_PROJ_SAVE, self._OnSave)          EVT_BUTTON(self, ID_PROJ_SAVE, self._OnSave)
106          EVT_BUTTON(self, ID_PROJ_SAVEAS, self._OnSaveAs)          EVT_BUTTON(self, ID_PROJ_ADDTOLIST, self._OnAddToList)
107    
108          EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName)          EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName)
109    
     def GetReceiver(self):  
         return self.receiver  
   
110      def _OnTry(self, event):      def _OnTry(self, event):
111          self.__SetProjection()          self.__SetProjection()
112            self.haveTried = True
113    
114      def _OnRevert(self, event):      def _OnRevert(self, event):
115          if self.originalProjection != -1:          if self.haveTried:
116              self.receiver.SetProjection(self.originalProjection)              self.receiver.SetProjection(self.originalProjection)
117                self.haveTried = False
118    
119      def _OnOK(self, event):      def _OnOK(self, event):
120          self.__SetProjection()          self.__SetProjection()
# Line 119  class ProjFrame(NonModalDialog): Line 124  class ProjFrame(NonModalDialog):
124          self.Close()          self.Close()
125    
126      def _OnNew(self, event):      def _OnNew(self, event):
127          self.__DoOnNew()  
128            # clear all selections
129            sel = self.availprojs.GetSelections()
130            for index in sel:
131                self.availprojs.SetSelection(index, False)
132    
133            self.projname.Clear()
134    
135            # supply a projection panel if there wasn't one
136            if self.curProjPanel is None:
137                self.projchoice.SetSelection(0)
138                self.__DoOnProjChoice()
139    
140            self.curProjPanel.Clear()
141    
142      def _OnSave(self, event):      def _OnSave(self, event):
143    
# Line 133  class ProjFrame(NonModalDialog): Line 151  class ProjFrame(NonModalDialog):
151          newproj = self.__GetProjection()          newproj = self.__GetProjection()
152    
153          if newproj is not None:          if newproj is not None:
154              projfile.Remove(proj)              proj.SetProjection(newproj)
             projfile.Add(newproj)  
155              try:              try:
156                  WriteProjFile(projfile)                  WriteProjFile(projfile)
157              except IOError, (errno, errstr):              except IOError, (errno, errstr):
158                  wxMessageDialog(self,                  self.__ShowError(projfile.GetFilename(), errstr)
                     _("The following error occured:\n") +  
                     projfile.GetFileName() + "\n" + errstr,  
                     _("Error"), wxOK | wxICON_ERROR).ShowModal()  
             self.__FillAvailList()  
159    
160      def _OnSaveAs(self, event):      def _OnAddToList(self, event):
161    
162          proj = self.__GetProjection()          proj = self.__GetProjection()
163          if proj is not None:          if proj is not None:
# Line 152  class ProjFrame(NonModalDialog): Line 165  class ProjFrame(NonModalDialog):
165              try:              try:
166                  WriteProjFile(self.__usrProjFile)                  WriteProjFile(self.__usrProjFile)
167              except IOError, (errno, errstr):              except IOError, (errno, errstr):
168                  wxMessageDialog(self,                  self.__ShowError(self.__userProjFile.GetFilename(), errstr)
                     _("The following error occured:\n") +  
                     self.__usrProjFile.GetFileName() + "\n" + errstr,  
                     _("Error"), wxOK | wxICON_ERROR).ShowModal()  
             self.__FillAvailList()  
   
         return  
   
         """Save the projection somewhere.  
   
         There are three important cases to consider.  
             1. the file already exists and the user wants to overwrite it.  
             2. the file already exists and the user wants to append the  
                current projection to the end of the file  
             3. the file doesn't exist and the user wants to create it  
   
         The list of available projections is then updated.  
         """  
   
         proj = Projection(self.curProjPanel.GetParameters())  
         if self.projname.GetValue() != "":  
             proj.SetName(self.projname.GetValue())  
   
         dlg = wxFileDialog(self, _("Save As"), style = wxSAVE)  
         if dlg.ShowModal() == wxID_OK:  
             path = dlg.GetPath()  
169    
170              if os.access(path, os.F_OK):              self.__FillAvailList()
                 # file already exists.  
                 if os.access(path, os.W_OK | os.R_OK):  
                   
                     # is it a .proj file?  
                     try:  
                         projFile = ReadProjFile(path)  
                     except:  
                         # obviously not.  
                         dlg = wxMessageDialog(self,  
                             path + _(" already exists. Overwrite?"),  
                             _(""),  
                             wxYES | wxNO)  
   
                         if dlg.ShowModal() == wxID_YES:  
                             projFile = ProjFile(path)  
                         else:  
                             return # returning early  
                     else:  
                         # ask the user to overwrite or append  
                         dlg = wxMessageDialog(self,  
                             _("The selected projection file already exists.\n"+  
                               "The current projection can be added to the " +  
                               "file, or it can completely replace the " +  
                               "selected file.\n\nShould the current " +  
                               "projection be added to the file?"),  
                             _("Question"),  
                             wxYES | wxNO | wxICON_QUESTION)  
   
                         if dlg.ShowModal() == wxID_NO:  
                             projFile = ProjFile(path)  
                 else:  
                     # can't access the file  
                     dlg = wxMessageDialog(self,  
                         _("Couldn't access ") + path,  
                         _(""),  
                         wxOK | wxICON | wxICON_EXCLAMATION)  
                     return  
   
             else:  
                 # file doesn't exist. make a new one.  
                 projFile = ProjFile(path)  
                   
             #  
             # if we get this far we have a valid projFile and  
             # can just write the file  
             #  
             projFile.Add(proj)  
             try:  
                 WriteProjFile(projFile)  
                 self.__FillAvailList()  
             except IOError, (errno, errstr):  
                 wxMessageDialog(self,  
                     _("The following error occured:\n") +  
                     dlg.GetPath() + "\n" + errstr,  
                     _("Error"), wxOK | wxICON_ERROR).ShowModal()  
         dlg.Destroy()  
171    
172      def _OnProjAvail(self, event):      def _OnProjAvail(self, event):
173          self.__DoOnProjAvail()          self.__DoOnProjAvail()
# Line 253  class ProjFrame(NonModalDialog): Line 185  class ProjFrame(NonModalDialog):
185                      self.__usrProjFile.Add(proj)                      self.__usrProjFile.Add(proj)
186                  WriteProjFile(self.__usrProjFile)                  WriteProjFile(self.__usrProjFile)
187              except IOError, (errno, errstr):              except IOError, (errno, errstr):
188                  wxMessageDialog(self,                  self.__ShowError(dlg.GetPath(), errstr)
                     _("The following error occured:\n") +  
                     dlg.GetPath() + "\n" + errstr,  
                     _("Error"), wxOK | wxICON_ERROR).ShowModal()  
189    
190              self.__FillAvailList()              self.__FillAvailList()
191    
192          dlg.Destroy()          dlg.Destroy()
193    
194      def _OnExport(self, event):      def _OnExport(self, event):
         proj = self.__GetProjection()  
195    
196          if proj is None: return          sel = self.availprojs.GetSelections()
197            assert len(sel) != 0, "button should be disabled"
198    
199          dlg = wxFileDialog(self, _("Export"),          dlg = wxFileDialog(self, _("Export"),
200                             style = wxSAVE|wxOVERWRITE_PROMPT)                          style = wxSAVE|wxOVERWRITE_PROMPT)
201    
202          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
203              path = dlg.GetPath()              path = dlg.GetPath()
204    
205              projFile = ProjFile(path)              projFile = ProjFile(path)
206              projFile.Add(proj)  
207                for i in sel:
208                    proj = self.availprojs.GetClientData(i)[CLIENT_PROJ]
209                    if proj is not None:
210                        projFile.Add(proj)
211    
212              try:              try:
213                  WriteProjFile(projFile)                  WriteProjFile(projFile)
214              except IOError, (errno, errstr):              except IOError, (errno, errstr):
215                  wxMessageDialog(self,                  self.__ShowError(dlg.GetPath(), errstr)
                     _("The following error occured:\n") +  
                     dlg.GetPath() + "\n" + errstr,  
                     _("Error"), wxOK | wxICON_ERROR).ShowModal()  
216    
217          dlg.Destroy()          dlg.Destroy()
218    
# Line 316  class ProjFrame(NonModalDialog): Line 247  class ProjFrame(NonModalDialog):
247          try:          try:
248              WriteProjFile(projfile)              WriteProjFile(projfile)
249          except IOError, (errno, errstr):          except IOError, (errno, errstr):
250              wxMessageDialog(self,              self.__ShowError(projfile.GetFilename(), errstr)
                 _("The following error occured:\n") +  
                 projfile.GetFileName() + "\n" + errstr,  
                 _("Error"), wxOK | wxICON_ERROR).ShowModal()  
   
251    
252          self.__FillAvailList()          self.__FillAvailList()
253    
# Line 332  class ProjFrame(NonModalDialog): Line 259  class ProjFrame(NonModalDialog):
259          if newselection != -1 and self.availprojs.GetCount() > 0:          if newselection != -1 and self.availprojs.GetCount() > 0:
260              self.availprojs.SetSelection(newselection)              self.availprojs.SetSelection(newselection)
261    
262            self.__VerifyButtons()
263    
264      def _OnProjName(self, event):      def _OnProjName(self, event):
265          self.__VerifyButtons()          self.__VerifyButtons()
266    
267        def __ShowError(self, filename, errstr):
268            wxMessageDialog(self,
269                _("The following error occured:\n") +
270                filename + "\n" + errstr,
271                _("Error"), wxOK | wxICON_ERROR).ShowModal()
272    
273      def __VerifyButtons(self):      def __VerifyButtons(self):
274            """Enable or disable the appropriate buttons based on the
275            current state of the dialog.
276            """
277    
278          sel = self.availprojs.GetSelections()          sel = self.availprojs.GetSelections()
279    
280          self.button_import.Enable(True)          self.button_import.Enable(True)
# Line 345  class ProjFrame(NonModalDialog): Line 284  class ProjFrame(NonModalDialog):
284    
285          self.panel_edit.Enable(True)          self.panel_edit.Enable(True)
286    
287            for ctrl in [self.button_import,
288                         self.button_export,
289                         self.button_remove,
290                         self.button_save,
291                         self.button_add,
292                         self.projchoice,
293                         self.projname,
294                         self.panel_edit]:
295                ctrl.Enable(True)
296    
297            if self.curProjPanel is not None:
298                self.curProjPanel.Enable(True)
299    
300          if len(sel) == 0:          if len(sel) == 0:
301              self.button_import.Enable(True)              self.button_import.Enable(True)
302              self.button_export.Enable(False)              self.button_export.Enable(False)
# Line 358  class ProjFrame(NonModalDialog): Line 310  class ProjFrame(NonModalDialog):
310              self.button_add.Enable(len(self.projname.GetValue()) > 0)              self.button_add.Enable(len(self.projname.GetValue()) > 0)
311    
312              if proj is None:              if proj is None:
313                  self.button_export.Enable(False)                  # <None> is selected
314                    for ctrl in [self.button_export,
315                                 self.button_remove,
316                                 self.button_save,
317                                 self.button_add,
318                                 self.projchoice,
319                                 self.projname]:
320                        ctrl.Enable(False)
321    
322                    if self.curProjPanel is not None:
323                        self.curProjPanel.Enable(False)
324    
325                elif proj is self.originalProjection:
326                  self.button_remove.Enable(False)                  self.button_remove.Enable(False)
327    
328              if projFile is None:              if projFile is None:
# Line 367  class ProjFrame(NonModalDialog): Line 331  class ProjFrame(NonModalDialog):
331          else:          else:
332              self.panel_edit.Enable(False)              self.panel_edit.Enable(False)
333    
     def __DoOnNew(self):  
         sel = self.availprojs.GetSelections()  
         if len(sel) != 0:  
             self.availprojs.SetSelection(sel, False)  
         self.projname.Clear()  
         self.curProjPanel.Clear()  
   
334      def __DoOnProjAvail(self):      def __DoOnProjAvail(self):
335    
336          sel = self.availprojs.GetSelections()          sel = self.availprojs.GetSelections()
# Line 385  class ProjFrame(NonModalDialog): Line 342  class ProjFrame(NonModalDialog):
342              if proj is None:              if proj is None:
343                  # user selected <None>                  # user selected <None>
344                  self.projname.Clear()                  self.projname.Clear()
345                    
346              else:              else:
347                            
348                  if projfile is not None:                  if projfile is not None:
349                      self.projfilepath.SetLabel(projfile.GetFileName())                      self.projfilepath.SetLabel(projfile.GetFilename())
350                  else:                  else:
351                      # only None if the currently used projection is selected                      # only None if the currently used projection is selected
352                      self.projfilepath.SetLabel("")                      self.projfilepath.SetLabel("")
# Line 401  class ProjFrame(NonModalDialog): Line 359  class ProjFrame(NonModalDialog):
359                      if myProjType == projType:                      if myProjType == projType:
360                          self.projchoice.SetSelection(i)                          self.projchoice.SetSelection(i)
361                          self.__DoOnProjChoice()                          self.__DoOnProjChoice()
362    
363                            #
364                            # self.curProjPanel should not be null
365                            # after a call to __DoOnProjChoice
366                            #
367                            assert self.curProjPanel is not None
368    
369                          self.curProjPanel.SetProjection(proj)                          self.curProjPanel.SetProjection(proj)
370                      i += 1                      i += 1
371    
# Line 410  class ProjFrame(NonModalDialog): Line 375  class ProjFrame(NonModalDialog):
375          self.__DoOnProjChoice()          self.__DoOnProjChoice()
376    
377      def __DoOnProjChoice(self):      def __DoOnProjChoice(self):
378            """Create and layout a projection panel based on the selected
379            projection type.
380    
381            This is necessary to have in seperate method since calls to
382            wxChoice.SetSelection() do not trigger an event.
383    
384            At the end of this method self.curProjPanel will not be None
385            if there was a item selected.
386            """
387    
388          choice = self.projchoice          choice = self.projchoice
389    
390          sel = choice.GetSelection()          sel = choice.GetSelection()
# Line 435  class ProjFrame(NonModalDialog): Line 410  class ProjFrame(NonModalDialog):
410              self.topBox.SetSizeHints(self)              self.topBox.SetSizeHints(self)
411    
412      def __SetProjection(self):      def __SetProjection(self):
413            """Set the receiver's projection."""
414    
415          #          #
416          # save the original projection only once in case          # save the original projection only once in case
417          # we try to apply several different projections          # we try to apply several different projections
418          #          #
         if self.originalProjection == -1:  
             self.originalProjection = self.receiver.GetProjection()  
   
419          self.receiver.SetProjection(self.__GetProjection())          self.receiver.SetProjection(self.__GetProjection())
420    
421      def __GetProjection(self):      def __GetProjection(self):
422          """Return the packaged projection.          """Return a suitable Projection object based on the current
423            state of the dialog box selections.
424    
425          Could be None.          Could be None.
426          """          """
427    
428          proj = None          sel = self.availprojs.GetSelections()
429            assert len(sel) < 2, "button should be disabled"
430    
431    
432            if len(sel) == 1:
433                proj = self.availprojs.GetClientData(sel[0])[CLIENT_PROJ]
434                if proj is None:
435                    # <None> is selected
436                    return None
437    
438            #
439            # self.curProjPanel should always contain the most
440            # relevant data for a projection
441            #
442          if self.curProjPanel is not None:          if self.curProjPanel is not None:
443              proj = Projection(self.curProjPanel.GetParameters())              return Projection(self.curProjPanel.GetParameters(),
444              proj.SetName(self.projname.GetValue())                                self.projname.GetValue())
445    
446          return proj          return None
447    
448        def __FillAvailList(self, selectCurrent = False):
449            """Populate the list of available projections.
450            
451            selectCurrent -- if True, select the projection used by
452                             the receiver, otherwise select nothing.
453            """
454    
     def __FillAvailList(self):  
455          self.availprojs.Clear()          self.availprojs.Clear()
456    
457          #          #
458            # We add the current projection to the list first so that
459            # we are sure that it's at index 0. That way we can
460            # set the selection with confidence. The problem is the
461            # the list is automatically sorted when an item is appended
462            # and the index of where it was inserted is not returned.
463            #
464            proj = self.receiver.GetProjection()
465            if proj is not None:
466                self.availprojs.Append(_("%s (current)") % proj.GetName(),
467                                       [proj, None])
468                if selectCurrent:
469                    self.availprojs.SetSelection(0)
470                    self.availprojs.SetFirstItem(0)
471    
472            #
473          # the list can never be empty. there will always be          # the list can never be empty. there will always be
474          # at least this one item          # at least this one item
475          #          #
476          self.availprojs.Append("<None>", (None, None))          self.availprojs.Append("<None>", (None, None))
477    
478          self.__sysProjFile = None          # proj is only None when <None> should be selected
479          self.__usrProjFile = None          if proj is None and selectCurrent:
480                self.availprojs.SetSelection(0)
481                self.availprojs.SetFirstItem(0)
482    
483          projfile = GetSystemProjFiles()          projfile = GetSystemProjFiles()
484          if len(projfile) > 0:          projfile = projfile[0]
485              projfile = projfile[0]          for proj in projfile.GetProjections():
486              for proj in projfile.GetProjections():              self.availprojs.Append(proj.GetName(), [proj, projfile])
487                  self.availprojs.Append(proj.GetName(), [proj, projfile])          self.__sysProjFile = projfile
             self.__sysProjFile = projfile  
488    
489          projfile = GetUserProjFiles()          projfile = GetUserProjFiles()
490          if len(projfile) > 0:          projfile = projfile[0]
491              projfile = projfile[0]          for proj in projfile.GetProjections():
492              for proj in projfile.GetProjections():              self.availprojs.Append(proj.GetName(), [proj, projfile])
493                  self.availprojs.Append(proj.GetName(), [proj, projfile])          self.__usrProjFile = projfile
             self.__usrProjFile = projfile  
   
 #       projfiles = GetSystemProjFiles()  
 #       for projfile in projfiles:  
 #           for proj in projfile.GetProjections():  
 #               self.availprojs.Append(proj.GetName(), [proj, projfile])  
 #       self.__sysProjFiles = projfiles  
   
 #       projfiles = GetUserProjFiles()  
 #       for projfile in projfiles:  
 #           for proj in projfile.GetProjections():  
 #               self.availprojs.Append(proj.GetName(), [proj, projfile])  
 #       self.__usrProjFiles = projfiles  
   
         proj = self.receiver.GetProjection()  
         if proj is not None:  
             self.availprojs.Append(proj.GetName() + _(" (current)"),  
                                    [proj, None])  
494    
495          for proj, name, clazz in self.projPanels:          for proj, name, clazz in self.projPanels:
496              self.projchoice.Append(name, [clazz, None])              self.projchoice.Append(name, [clazz, None])
497    
498      def __set_properties(self):      def __set_properties(self):
         self.__FillAvailList()  
499    
         # begin wxGlade: ProjFrame.__set_properties  
         self.SetTitle(_("Projections"))  
500          self.availprojs.SetSelection(0)          self.availprojs.SetSelection(0)
501          self.projchoice.SetSelection(0)          self.projchoice.SetSelection(0)
502          # end wxGlade  
503            self.__FillAvailList(selectCurrent = True)
504    
505          self.projname.SetMaxLength(32)          self.projname.SetMaxLength(32)
506    

Legend:
Removed from v.730  
changed lines
  Added in v.751

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26