Hi Jerome,
2008/6/21 Jerome Laheurte <[EMAIL PROTECTED]>:
>
> Hi, Franck. What is the motivation of the "elif not
> self.__taskFile.isEmpty()" in IOController.save() ?
>
> def save(self, *args):
> if self.__taskFile.filename():
> self.__taskFile.save()
> self.__showSaveMessage(self.__taskFile)
> return True
> elif not self.__taskFile.isEmpty():
> return self.saveas()
> else:
> return False
This method is called when the user clicks save. If the task file does
not have a filename the IOController needs to invoke saveas to force
the user to give it one. This only makes sense if there is something
to save, i.e. the task file is not empty.
> The problem is the following: starting with an empty file, if I create
> a task, undo the create, and try to save, the taskfile is still marked
> dirty, the save button is still enabled and I get the confirmation
> dialog when quitting, which I suppose is not the intended behaviour :)
Ah, I see what you mean. So to solve this we would only need to change
the above code into:
def save(self, *args):
if self.__taskFile.filename():
self.__taskFile.save()
self.__showSaveMessage(self.__taskFile)
return True
else:
return self.saveas()
Right? I'll change this in the Release0_70_Branch.
Cheers, Frank