lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Allow switching skin while lmi is running


From: Greg Chicares
Subject: Re: [lmi] Allow switching skin while lmi is running
Date: Wed, 1 Jun 2016 22:17:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-06-01 17:54, Greg Chicares wrote:
> On 2016-05-31 20:15, Vadim Zeitlin wrote:
>> On Mon, 30 May 2016 20:14:42 +0000 Greg Chicares <address@hidden> wrote:
[...]
>> GC> default_input_filename_              input      textctrl
>> GC> skin_filename_                       input      listbox or combobox
>> GC> print_directory_                     reports    textctrl
[...]
>>  I don't have anything to add to this list, I just wanted to say that it
>> would be better to choose wxFilePickerCtrl and wxDirPickerCtrl for
>> default_input_filename_ and print_directory_ respectively, instead of plain
>> wxTextCtrl.
> 
> [...] I'm pretty sure we want wxFLP_FILE_MUST_EXIST

Now I'm not so sure. At first, it seemed silly to name a file that
doesn't exist. OTOH, I usually run lmi with no default input file.
Today, I simply leave 'default_input_file' pointing by default to
a file that doesn't exist on my machine, and default_cell() does
the right thing for me:

  static Input const builtin_default;
  if(0 != access(default_input_file.c_str(), F_OK))
      {
      user_default = builtin_default;
      }

If we use wxFLP_FILE_MUST_EXIST, then I'd get an error from which
I wouldn't be able to escape except by naming a file that I do
*not* want to use as default input. And that file would have to
be a valid '.ill' file, or the catch clause in default_cell()
would remove it:

  catch(...)
      {
      if(0 == std::remove(default_input_file.c_str()))

Suppose I pick the lmi binary as my 'default_input_file', figuring
that it cannot be read as the default input (which I don't want
anyway). Perhaps msw would refuse to remove it, except that I'm
launching lmi from a cygwin terminal, which might permit that
(effecting the deletion only after I've exited lmi, to maximize
the surprise).

Or if I pick
  C:\My Only Copy of My Performance Review.doc
similarly undesirable behavior would ensue. If it's always wrong
to delete a file that doesn't have an '.ill' extension, then we
ought to validate that extension in the preferences dialog. Still,
I might pick
  C:\Medical.excuse.from.work.because.I.am.ill

BTW, the reason for deleting a default file that can't be loaded
is...well, I guess, that it might be corrupted? But we've taken
great care to ensure backward compatibility, and a decade-old
input file works just fine. Maybe deletion is a mistake.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]