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

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

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

revision 469 by jonathan, Wed Mar 5 18:19:25 2003 UTC revision 487 by jonathan, Fri Mar 7 18:21:03 2003 UTC
# Line 296  class MainWindow(wxFrame): Line 296  class MainWindow(wxFrame):
296              result = wxID_NO              result = wxID_NO
297          return result          return result
298    
299        def prepare_new_session(self):
300            for d in self.dialogs.values():
301                if not isinstance(d, tree.SessionTreeView):
302                    d.Shutdown()
303    
304      def NewSession(self):      def NewSession(self):
305          self.save_modified_session()          self.save_modified_session()
306            self.prepare_new_session()
307          self.application.SetSession(create_empty_session())          self.application.SetSession(create_empty_session())
308    
309      def OpenSession(self):      def OpenSession(self):
310          self.save_modified_session()          self.save_modified_session()
311          dlg = wxFileDialog(self, _("Open Session"), ".", "",          dlg = wxFileDialog(self, _("Open Session"), ".", "", "*.thuban", wxOPEN)
                            "*.thuban", wxOPEN)  
312          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
313                self.prepare_new_session()
314              self.application.OpenSession(dlg.GetPath())              self.application.OpenSession(dlg.GetPath())
315          dlg.Destroy()          dlg.Destroy()
316    
317      def SaveSession(self):      def SaveSession(self):
318          if self.application.session.filename == None:          if self.application.session.filename == None:
319              self.SaveSessionAs()              self.SaveSessionAs()
320          self.application.SaveSession()          else:
321                self.application.SaveSession()
322    
323      def SaveSessionAs(self):      def SaveSessionAs(self):
324          dlg = wxFileDialog(self, _("Save Session As"), ".", "",          dlg = wxFileDialog(self, _("Save Session As"), ".", "",
# Line 506  class MainWindow(wxFrame): Line 513  class MainWindow(wxFrame):
513          proj4Dlg.Destroy()          proj4Dlg.Destroy()
514    
515      def Classify(self):      def Classify(self):
516          classifyDlg = classifier.Classifier(NULL, self.current_layer())  
517            #
518          classifyDlg.ShowModal()          # the menu option for this should only be available if there
519          classifyDlg.Destroy()          # is a current layer, so we don't need to check if the
520            # current layer is None
521            #
522    
523            layer = self.current_layer()
524            name = "classifier" + str(id(layer))
525            dialog = self.get_open_dialog(name)
526    
527            if dialog is None:
528                dialog = classifier.Classifier(self, self.interactor,
529                                               name, self.current_layer())
530                self.add_dialog(name, dialog)
531                dialog.Show()
532    
533      def ZoomInTool(self):      def ZoomInTool(self):
534          self.canvas.ZoomInTool()          self.canvas.ZoomInTool()

Legend:
Removed from v.469  
changed lines
  Added in v.487

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26