Author: bugman Date: Thu Aug 21 17:28:26 2014 New Revision: 25180 URL: http://svn.gna.org/viewcvs/relax?rev=25180&view=rev Log: Merged revisions 25177 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r25177 | bugman | 2014-08-21 17:19:19 +0200 (Thu, 21 Aug 2014) | 7 lines Added the relax_disp.spin_lock_offset user function to the dispersion GUI. This has been added to the pop up menu in the spectrum list GUI element, when the relax_disp_flag has been set. It simply mimics the relax_disp.spin_lock_field functionality already present. This follows from task #7820 (https://gna.org/task/?7820). ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/gui/components/spectrum.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Aug 21 17:28:26 2014 @@ -1 +1 @@ -/trunk:1-25173,25175-25176 +/trunk:1-25173,25175-25177 Modified: branches/frame_order_cleanup/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/gui/components/spectrum.py?rev=25180&r1=25179&r2=25180&view=diff ============================================================================== --- branches/frame_order_cleanup/gui/components/spectrum.py (original) +++ branches/frame_order_cleanup/gui/components/spectrum.py Thu Aug 21 17:28:26 2014 @@ -202,6 +202,36 @@ uf_store['relax_disp.spin_lock_field'](spectrum_id=id) + def action_relax_disp_spin_lock_offset(self, event=None, item=None): + """Launch the relax_disp.spin_lock_offset user function. + + @keyword event: The wx event. + @type event: wx event + @keyword item: This is for debugging purposes only, to allow the GUI tests to select items without worrying about OS dependent wxPython bugs. + @type item: None or int + """ + + # The current selection. + if item == None: + item = self.element.GetFirstSelected() + + # The spectrum ID. + id = gui_to_str(self.element.GetItemText(item)) + + # The offset. + offset = None + offset_flag = False + if hasattr(cdp, 'spin_lock_offset') and id in cdp.spin_lock_offset.keys(): + offset = cdp.spin_lock_offset[id] + offset_flag = True + + # Launch the dialog. + if offset_flag: + uf_store['relax_disp.spin_lock_offset'](field=offset, spectrum_id=id) + else: + uf_store['relax_disp.spin_lock_offset'](spectrum_id=id) + + def action_relax_fit_relax_time(self, event=None, item=None): """Launch the relax_fit.relax_time user function. @@ -496,6 +526,12 @@ 'text': u("Set the spin-&lock field strength \u03BD1"), 'icon': fetch_icon("relax.relax_disp"), 'method': self.action_relax_disp_spin_lock_field + }) + popup_menus.append({ + 'id': wx.NewId(), + 'text': u("Set the spin-&lock offset \u03C9_rf"), + 'icon': fetch_icon("relax.relax_disp"), + 'method': self.action_relax_disp_spin_lock_offset }) if self.relax_disp_flag and is_cpmg_exp_type(id): popup_menus.append({