@@ -131,11 +131,11 @@ def __init__(self, levelEditor, parent = None, **kw):
131131 menuBar .addmenuitem ('Advanced' , 'separator' )
132132 menuBar .addmenuitem ('Advanced' , 'checkbutton' ,
133133 'Toggle Auto-saver On/Off' ,
134- label = 'Toggle Auto- Saver' ,
134+ label = 'Toggle Auto Saver' ,
135135 command = self .toggleAutoSaver )
136136 menuBar .addmenuitem ('Advanced' , 'command' ,
137- 'User Set Auto Saver Interval ' ,
138- label = 'Set Auto- Saver Interval ' ,
137+ 'User Set Auto Saver Options ' ,
138+ label = 'Auto Saver Options ' ,
139139 command = self .showAutoSaverDialog )
140140
141141 # Corporate Clash Old Toontown-esque Filter
@@ -187,13 +187,32 @@ def __init__(self, levelEditor, parent = None, **kw):
187187 message_text = CONTROLS )
188188 self .controlsDialog .withdraw ()
189189
190- self .autoSaverDialog = Pmw .Dialog (parent ,
191- title = 'Set Auto-Saver Interval (in minutes)' ,
192- buttons = ( 'Enter' ,),
193- command = self . setAutoSaverInterval )
190+ self .autoSaverDialog = Pmw .Dialog (parent , title = 'Autosaver Options' ,
191+ buttons = ( 'Save Options' ,) ,
192+ command = self . setAutoSaverInterval
193+ )
194194 self .autoSaverDialog .withdraw ()
195- self .autoSaverDialogTextBox = Text (self .autoSaverDialog .interior (), height = 10 )
196- self .autoSaverDialogTextBox .pack (expand = 1 , fill = BOTH )
195+
196+ self .autoSaverDialogInterval = Pmw .Counter (self .autoSaverDialog .interior (),
197+ labelpos = 'w' ,
198+ label_text = 'Auto save interval in minutes:' ,
199+ entry_width = 10 ,
200+ entryfield_value = int (AutoSaver .autoSaverInterval ),
201+ entryfield_validate = {'validator' : 'real' ,
202+ 'min' : 1 , 'max' : 60 })
203+
204+ self .autoSaverDialogMax = Pmw .Counter (self .autoSaverDialog .interior (),
205+ labelpos = 'w' ,
206+ label_text = 'Max auto save files:' ,
207+ entry_width = 10 ,
208+ entryfield_value = int (AutoSaver .maxAutoSaveCount ),
209+ entryfield_validate = {'validator' : 'numeric' ,
210+ 'min' : 0 , 'max' : 99 })
211+
212+ counters = (self .autoSaverDialogInterval , self .autoSaverDialogMax )
213+ Pmw .alignlabels (counters )
214+ for counter in counters :
215+ counter .pack (fill = 'both' , expand = 1 , padx = 10 , pady = 10 )
197216
198217 self .editMenu = Pmw .ComboBox (
199218 menuFrame , labelpos = W ,
@@ -1489,9 +1508,10 @@ def setBattleCellType(self, name):
14891508 self .levelEditor .currentBattleCellType = name
14901509
14911510 def setAutoSaverInterval (self , i ):
1492- if i == 'Enter ' :
1511+ if i == 'Save Options ' :
14931512 try :
1494- AutoSaver .autoSaverInterval = float (self .autoSaverDialogTextBox .get ("1.0" , 'end-1c' ))
1513+ AutoSaver .autoSaverInterval = float (self .autoSaverDialogInterval .get ())
1514+ AutoSaver .maxAutoSaveCount = float (self .autoSaverDialogMax .get ())
14951515 except ValueError as e :
14961516 # Non-float was passed
14971517 raise e
0 commit comments