Author: bugman Date: Mon Jul 4 11:50:06 2011 New Revision: 13413 URL: http://svn.gna.org/viewcvs/relax?rev=13413&view=rev Log: The molecule, residue, and spin delete menu entries in the spin viewer are now simplified. The user function window is no longer shown, and a question asking the user before deleting is presented. Modified: branches/gui_testing/gui/components/spin_view.py Modified: branches/gui_testing/gui/components/spin_view.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/components/spin_view.py?rev=13413&r1=13412&r2=13413&view=diff ============================================================================== --- branches/gui_testing/gui/components/spin_view.py (original) +++ branches/gui_testing/gui/components/spin_view.py Mon Jul 4 11:50:06 2011 @@ -35,6 +35,8 @@ # GUI module imports. from gui import paths +from gui.message import question +from gui.misc import gui_to_str class Container(wx.Window): @@ -741,8 +743,16 @@ @type event: wx event """ - # Call the dialog. - self.gui.user_functions.molecule.delete(event, mol_name=self.info[1]) + # Ask if this should be done. + msg = "Are you sure you would like to delete this molecule? This operation cannot be undone." + if not question(msg, default=False): + return + + # Delete the molecule. + self.gui.user_functions.interpreter.molecule.delete(gui_to_str(self.info[2])) + + # Update. + self.update() def prune_mol(self): @@ -831,8 +841,16 @@ @type event: wx event """ - # Call the dialog. - self.gui.user_functions.residue.delete(event, mol_name=self.info[1], res_num=self.info[2], res_name=self.info[3]) + # Ask if this should be done. + msg = "Are you sure you would like to delete this residue? This operation cannot be undone." + if not question(msg, default=False): + return + + # Delete the residue. + self.gui.user_functions.interpreter.residue.delete(gui_to_str(self.info[4])) + + # Update. + self.update() def spin_create(self, event): @@ -853,8 +871,16 @@ @type event: wx event """ - # Call the dialog. - self.gui.user_functions.spin.delete(event, mol_name=self.info[1], res_num=self.info[2], res_name=self.info[3], spin_num=self.info[4], spin_name=self.info[5]) + # Ask if this should be done. + msg = "Are you sure you would like to delete this spin? This operation cannot be undone." + if not question(msg, default=False): + return + + # Delete the spin. + self.gui.user_functions.interpreter.spin.delete(gui_to_str(self.info[6])) + + # Update. + self.update() def update(self, pipe_name=None):