def on_delete_area(self, event): """Delete loading area""" # select an area and get a name dlg = nodelibdlg.NodeLibDialog(self.get_frame(), nodelibdlg.DELETE, 'area', 'Area', "/usr/areas") ok_to_continue = dlg.ShowModal() == wx.ID_OK if ok_to_continue: msg = "Delete area '%s'?" % dlg.get_guiname() delete = cjr.warn_yes_no(self.get_frame(), msg) if delete == wx.ID_YES: # Delete the area from the level servers.get_loader_server().deleteloadarea( str(dlg.get_guiname())) dlg.Destroy()
def on_new_indoor_area(self, event): """Create new indoor loading area""" # Create a new indoor area dlg = nodelibdlg.NodeLibDialog( self.get_frame(), nodelibdlg.NEW, 'area', 'Area', "/usr/areas" ) if dlg.ShowModal() == wx.ID_OK: # Check that's a new stream name if dlg.node_exists(): msg = "There's already an area named" msg = msg + " '" + dlg.get_guiname() + "'.\n" msg = msg + "You should enter a new area name." cjr.show_error_message(msg) else: # create the new loading area obj = servers.get_loader_server().createloadarea( "nindoorarea", str( dlg.get_guiname() ) ) win = objdlg.create_window( wx.GetApp().GetTopWindow(), obj.getfullname() ) win.display() dlg.Destroy()
def on_delete_area(self, event): """Delete loading area""" # select an area and get a name dlg = nodelibdlg.NodeLibDialog( self.get_frame(), nodelibdlg.DELETE, 'area', 'Area', "/usr/areas" ) ok_to_continue = dlg.ShowModal() == wx.ID_OK if ok_to_continue: msg = "Delete area '%s'?" % dlg.get_guiname() delete = cjr.warn_yes_no( self.get_frame(), msg ) if delete == wx.ID_YES: # Delete the area from the level servers.get_loader_server().deleteloadarea( str( dlg.get_guiname() ) ) dlg.Destroy()
def on_new_indoor_area(self, event): """Create new indoor loading area""" # Create a new indoor area dlg = nodelibdlg.NodeLibDialog(self.get_frame(), nodelibdlg.NEW, 'area', 'Area', "/usr/areas") if dlg.ShowModal() == wx.ID_OK: # Check that's a new stream name if dlg.node_exists(): msg = "There's already an area named" msg = msg + " '" + dlg.get_guiname() + "'.\n" msg = msg + "You should enter a new area name." cjr.show_error_message(msg) else: # create the new loading area obj = servers.get_loader_server().createloadarea( "nindoorarea", str(dlg.get_guiname())) win = objdlg.create_window(wx.GetApp().GetTopWindow(), obj.getfullname()) win.display() dlg.Destroy()