[Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py,
1.24, 1.25
Mark Hammond
mhammond at users.sourceforge.net
Mon Aug 25 20:35:47 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv20493/dialogs
Modified Files:
dialog_map.py
Log Message:
The experimental 'timers' options got upgraded to the 'filter'
section. Existing values should be migrated (but note you won't see
the migration until the config is saved - ie, after the manager dialog
is shown). New values are floating point seconds (and the migration
also does the conversion from the old milli-seconds). I'm too nice :)
Index: dialog_map.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** dialog_map.py 25 Aug 2003 17:05:35 -0000 1.24
--- dialog_map.py 26 Aug 2003 02:35:45 -0000 1.25
***************
*** 93,142 ****
self.SetOptionValue(check)
- # This class will likely go away when the real options are made for
- # delay timers
- class MsSliderProcessor(EditNumberProcessor):
- def __init__(self, window, control_ids, option):
- EditNumberProcessor.__init__(self, window, control_ids, option)
- def InitSlider(self):
- slider = self.GetControl(self.slider_id)
- win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, 20))
- win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1)
- win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, 1)
- win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, 2, 0)
- self.UpdateSlider_FromEdit()
- def OnMessage(self, msg, wparam, lparam):
- slider = self.GetControl(self.slider_id)
- if slider == lparam:
- slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0)
- slider_pos = float(slider_pos)
- str_val = str(slider_pos*.5)
- edit = self.GetControl()
- win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val)
- def UpdateSlider_FromEdit(self):
- slider = self.GetControl(self.slider_id)
- try:
- # Get as float so we dont fail should the .0 be there, but
- # then convert to int as the slider only works with ints
- val = int(float(self.option.get())/500.0)
- except ValueError:
- return
- win32gui.SendMessage(slider, commctrl.TBM_SETPOS, 1, val)
-
- def UpdateControl_FromValue(self):
- value = float(self.option.get())/1000.0
- win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(value))
- self.UpdateSlider_FromEdit()
- def UpdateValue_FromControl(self):
- buf_size = 100
- buf = win32gui.PyMakeBuffer(buf_size)
- nchars = win32gui.SendMessage(self.GetControl(), win32con.WM_GETTEXT,
- buf_size, buf)
- str_val = buf[:nchars]
- val = float(str_val)
- if val < 0.0 or val > 10.0:
- raise ValueError, "Value must be between 0 and 10"
- self.SetOptionValue(int(val*1000.0))
-
-
class FilterStatusProcessor(ControlProcessor):
def OnOptionChanged(self, option):
--- 93,96 ----
***************
*** 455,461 ****
),
"IDD_ADVANCED" : (
! (MsSliderProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Experimental.timer_start_delay"),
! (MsSliderProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Experimental.timer_interval"),
! (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"),
(HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"),
(CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()),
--- 409,415 ----
),
"IDD_ADVANCED" : (
! (EditNumberProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Filter.timer_start_delay", 0, 10, 20),
! (EditNumberProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Filter.timer_interval", 0, 10, 20),
! (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Filter.timer_only_receive_folders"),
(HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"),
(CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()),
More information about the Spambayes-checkins
mailing list