/[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 1941 by bh, Tue Nov 11 18:27:48 2003 UTC revision 2051 by frank, Wed Jan 21 17:09:15 2004 UTC
# Line 303  class ProjFrame(NonModalNonParentDialog) Line 303  class ProjFrame(NonModalNonParentDialog)
303          add them to the user ProjFile object and write the user file          add them to the user ProjFile object and write the user file
304          back to disk.          back to disk.
305          """          """
306          dlg = wxFileDialog(self, _("Import"), style = wxOPEN)          dlg = wxFileDialog(self, _("Import"),
307                    self.parent.application.Path("projection"), style = wxOPEN)
308    
309          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
310              path = dlg.GetPath()              path = dlg.GetPath()
# Line 319  class ProjFrame(NonModalNonParentDialog) Line 320  class ProjFrame(NonModalNonParentDialog)
320                      for proj in projFile.GetProjections():                      for proj in projFile.GetProjections():
321                          self.__usrProjFile.Add(proj)                          self.__usrProjFile.Add(proj)
322                      self.write_proj_file(self.__usrProjFile)                      self.write_proj_file(self.__usrProjFile)
323                        self.parent.application.SetPath("projection", path)
324              finally:              finally:
325                  ThubanEndBusyCursor()                  ThubanEndBusyCursor()
326          dlg.Destroy()          dlg.Destroy()
# Line 332  class ProjFrame(NonModalNonParentDialog) Line 334  class ProjFrame(NonModalNonParentDialog)
334          sel = self.projection_list.selected_projections()          sel = self.projection_list.selected_projections()
335          assert len(sel) != 0, "button should be disabled"          assert len(sel) != 0, "button should be disabled"
336    
337          dlg = wxFileDialog(self, _("Export"), style=wxSAVE|wxOVERWRITE_PROMPT)          dlg = wxFileDialog(self, _("Export"),
338                    self.parent.application.Path("projection"),
339                    style=wxSAVE|wxOVERWRITE_PROMPT)
340    
341          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
342              proj_file = ProjFile(dlg.GetPath())              proj_file = ProjFile(dlg.GetPath())
# Line 340  class ProjFrame(NonModalNonParentDialog) Line 344  class ProjFrame(NonModalNonParentDialog)
344                  if proj is not None:                  if proj is not None:
345                      proj_file.Add(proj)                      proj_file.Add(proj)
346              self.write_proj_file(proj_file)              self.write_proj_file(proj_file)
347                self.parent.application.SetPath("projection", dlg.GetPath())
348    
349          dlg.Destroy()          dlg.Destroy()
350    
# Line 576  class ProjFrame(NonModalNonParentDialog) Line 581  class ProjFrame(NonModalNonParentDialog)
581          with get_user_proj_file and cache it in self.__usrProjFile.          with get_user_proj_file and cache it in self.__usrProjFile.
582    
583          Show a busy cursor while loading the file.          Show a busy cursor while loading the file.
584        
585            If the file is not available, leave a note to the console.
586          """          """
587          if self.__usrProjFile is None:          if self.__usrProjFile is None:
588              ThubanBeginBusyCursor()              ThubanBeginBusyCursor()
589              try:              try:
590                  projfile, warnings = get_user_proj_file()                  projfile, warnings = get_user_proj_file()
591                  self.show_warnings(_("Warnings"), projfile.GetFilename(),                  if warnings:
592                                     warnings)                      sys.stderr.write("".join(warnings))
593                  self.__usrProjFile = projfile                  self.__usrProjFile = projfile
594              finally:              finally:
595                  ThubanEndBusyCursor()                  ThubanEndBusyCursor()

Legend:
Removed from v.1941  
changed lines
  Added in v.2051

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26