GNOME Bugzilla – Bug 594485
Ask for confirmation when overwriting a file when rendering
Last modified: 2011-06-22 18:49:43 UTC
When i erase a file with pitivi rendering, pitivi don't ask me if i'm sure to want to use the same name like a already existing file.
I'm not 100% sure I would like this as I render a *lot* with file names such as "test.ogv", but I guess for usability's/safety's sake, it makes sense to prompt the user.
*** Bug 609970 has been marked as a duplicate of this bug. ***
*** Bug 637817 has been marked as a duplicate of this bug. ***
Created attachment 190186 [details] [review] patch Here's a fix. I'm using a warning icon + tooltip instead of a dialog prompt: - Users tend to automatically click Yes/Ok/Overwrite/whatever - When doing video editing and testing rendering settings, you often render over the same file over and over again. Needing to acknowledge a warning dialog everytime would be irritating.
Review of attachment 190186 [details] [review]: In the if-else blocks you execute the same commands with different parameters. I suggest to set the "tooltip_text" and "icon" local variables inside these blocks, so they can be used by the two commands afterwards. The final "if" condition should be set to "filename and os.path.exists(os.path.join(path, filename)):", otherwise it will show the error icon when the directory exists and the file name box is empty. Let's use the handler for the "changed" signal instead of the "activate" and "focus-out-event" signals. It's cheap and useful.
The specific reason why I used "activate" and "focus-out-event" signals instead of the standard "changed" signal is because I don't want to cause a hard drive access/path check everytime the use types a character. If-else blocks: good idea
Created attachment 190243 [details] [review] reworked patch
Note that the reworked patch uses the "changed" signal, which feels more natural to users and has a negligible impact on a "normal" desktop system, but may be a performance problem for networked filesystems or hard drives that "sleep".
commit c7d458eaf872a1b7a39e423da727da053e5ee0e7 Author: Jean-François Fortin Tam <nekohayo@gmail.com> Date: Sun Jun 19 21:51:23 2011 -0400 encodingdialog: Show a warning icon and tooltip when the output file already exists Fixes bug #594485