コード例 #1
0
 def DocumentOpen(self, uri):
     (proto, path) = Tools.splitURI(uri)
         
     if self._d_notebook.hasPageURI( uri ):
         self._d_notebook.selectPageByURI( uri )
         return 
     
     try:
         self._d_notebook.openURI(uri)
         self._d_main_frame.bindClose(self.OnDocumentClose)
     except:
         showExceptionDialog(self._d_notebook, -1,
                             "Unable to open document %s"%uri)
コード例 #2
0
 def DocumentDelete(self, uri):
     # Ask for delete
     dlg = wx.MessageDialog(self._d_main_frame, "Do you realy wan to delete %s?"%uri,
                             "delete?", wx.YES|wx.NO)
     if dlg.ShowModal() == wx.ID_NO:
         raise Exception("Delete aborted")
     
     # delete
     try:
         self._d_model.deleteURI( uri )
         if self._d_notebook.hasPageURI( uri ):
             self._d_notebook.closePage( self._d_notebook.getPageByURI( uri ) )
     except:
         showExceptionDialog(self._d_notbook, -1,
                             "Unable to delete document %s"%uri)
         raise Exception("Delete aborted")