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: Vadim Zeitlin
Subject: Re: [lmi] Allow switching skin while lmi is running
Date: Thu, 2 Jun 2016 00:29:56 +0200

On Wed, 1 Jun 2016 22:17:21 +0000 Greg Chicares <address@hidden> wrote:

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

 I still think this flag should be used, but perhaps it should be possible
to leave the field empty if you just have no appropriate candidate file at
all.

GC> At first, it seemed silly to name a file that
GC> doesn't exist. OTOH, I usually run lmi with no default input file.
GC> Today, I simply leave 'default_input_file' pointing by default to
GC> a file that doesn't exist on my machine, and default_cell() does
GC> the right thing for me:
GC> 
GC>   static Input const builtin_default;
GC>   if(0 != access(default_input_file.c_str(), F_OK))
GC>       {
GC>       user_default = builtin_default;
GC>       }

 Would it be conceivable to modify this code to skip calling access() if
default_input_file is empty?

GC> And that file would have to be a valid '.ill' file, or the catch clause
GC> in default_cell() would remove it:
GC> 
GC>   catch(...)
GC>       {
GC>       if(0 == std::remove(default_input_file.c_str()))
...
GC> Maybe deletion is a mistake.

 It certainly seems so to me. IMO deleting files should never be done
without an explicit user confirmation and while I can accept that lmi does
it for its own _output_ files, it still seems very wrong to do it for the
input ones.

 Regards,
VZ


reply via email to

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