← Back to team overview

kicad-developers team mailing list archive

Re: Patch: Don't force modal dialog on creating a new file


On 14 May 2012 08:41, jean-pierre charras <jp.charras@xxxxxxxxxx> wrote:
> Le 14/05/2012 02:04, Henner Zeller a écrit :
>> Hi,
>> Small patch.
>> When creating a new schematic or start a new board from your
>> schematic, a new file is created. But in that case an
>> attention-grabbing modal dialog pops ups telling the user that 'The
>> file is not found'. The first reaction of the user is that something
>> went wrong - but everything works as expected.
>> It seems, someone 'fixed' this problem by adding a message to these
>> dialog boxes that this is normal and expected if this is the first
>> time happening.
>> But this fixes the symptom, not the cause (scary attention grabbing
>> modal dialog box).
>> There is really no reason for such a modal dialog, and they should be
>> used sparingly.
>> In any other application, if a new file is opened, a message in the
>> status line is telling about this. If at all.
>> This patch fixes this: what used to be a modal dialog box is now just
>> a status message "New file %s".
>> cheers,
>>   -henner
> I am not enthusiastic about this patch.
> The dialog about a not found file is usual, and most of application do that.
> Assuming "try to opening a not existing file" should be "create a new file"
> is wrong.

I would like to challenge you on the 'most applications do that' part :)
If you open an editor with a filename that does not exist, it will
never complain, it will just treat it as a new file. Actually, from my
experience, I can't remember any application complaining about this
with a modal dialog (do you remember examples for applications you've
seen that?). Since my perception is that usually applications treat a
non-existent file as 'new', this prompted my change. It is just to get
aligned of what is happening more 'commonly'. And fixing a
user-irritation problem when working on a new project.

One of the key-things here is, that the applications are launched by
the central kicad project managing application. So it already _knows_
that the file does not exist yet. Maybe we should pass a flag (such as
--nonexistent-file) to the application when launching ?

> There are lot of reasons when a file is missing and should exist:
> For instance a file can be missing because it was forgotten when copying a
> lot of files,
> or erroneous renaming file command, ...
> and the user *should be* prompted.

mmh, but wouldn't the user just see that the file is obviously empty
and it says 'new file' at the bottom, that something happened to that
file ?
And in that particular case, the user already knows what the reason
is, because (s)he tries on a newly copied project.
OTOH, if someone creates a new project, this dialog box doesn't add anything.

So the modal dialog _maybe_ helps in the rare case that someone
genuinely thought that the file existed and the program tells her that
indeed it doesn't. But is that worth annoying users in the majority of
the cases in which they just start a new project ?

> The issue for new projects (and only for new projects) is in fact in Kicad,
> that perhaps could create void .sch and .pcb files after creating the .pro
> file.

Yes, that would as well be an alternative. I think though, that this
would be a more 'hacky' solution as it fixes a symptom.
(would just an empty file be ok ?)


Follow ups