Hi Rob,

2008/5/15 Rob McMullen <[EMAIL PROTECTED]>:
> Frank,
>
> On Thu, May 15, 2008 at 1:24 PM, Frank Niessink <[EMAIL PROTECTED]> wrote:
>> These values are hardcoded. You are aware that you can fill in any
>> time you want by entering text in the combo boxes?
>
> Yep. :)  I just find it more convenient to use the mouse if I'm
> already mousing for the rest of the dialog.  (As an aside, on GTK I
> don't seem to be able to tab from the Task field to the other fields.)
>
>> See taskcoachlib/widgets/datectrl.py: class TimeCtrl.
>
> Ah!  I see it there.  Thanks for the pointer.
>
> I'm willing to get into the code if this something that you'd be
> interested in a patch for: to be able to configure the starting and
> ending times through the preferences dialog and/or ini file.
>
> Not sure how difficult it will be as I've not looked at the preference
> code before.  I think that you'd grab the preferences during
> EffortEdit.doCommand or maybe even down further in EffortEditor or
> EffortEditBook, but didn't see anything in the mailing list for how to
> add new things to the ini file.  (My search-foo might just be missing
> the right combination of words, though...)

You'll need to add preferences to taskcoachlib/config/defaults.py, in
the 'view' section I'd guess. Then you need to allow people to edit
these defaults in the preferences dialog:
taskcoachlib/gui/dialog/preferences.py. I think I would add these
settings to the EditorPage class. Look for the addIntegerSetting
method.

Next, you'll need to use the new settings in
taskcoachlib/gui/dialog/editor.py: the EffortEditorBook creates the
widgets, so there you can pass the settings to the DateTimeCtrl. But
be aware that the DateTimeCtrl is part of the widgets package and
shouldn't know anything else than wx stuff, so don't pass the whole
settings object, but just the values the DateTimeCtrl would need (i.e.
start time, stop time and step size).

HTH, Frank

Reply via email to