Angus Leeming wrote:
> On Thursday 12 September 2002 11:13 am, Angus Leeming wrote:
> Perhaps something like:
> 
>>void FormPrint::update()
>>{
>>      PrinterParams & pp = controller().params();
>>
>>      if (pp.file_name == getString(dialog_->input_file)
>>              return;
>>
>>      ...
>>}
>>
>>would do the trick.
> 
> 
> Make that
> 
> void FormPrint::update()
> {
>       PrinterParams & pp = controller().params();
> 
>       string const current_file_name = getString(dialog_->input_file);
>       if (!current_file_name.empty() &&
>          current_file_name == pp.file_name)
>               return;
> 
>       ...
> }

Ah, now I got it!

If I type my own filename, everthing gets reset, otherwise not.
Don't like that. Why do you want that?

I suggest something like:

void FormPrint::update()
{
        static bool skip = false;
        
        if (skip)
                return;
        else
                skip = true;

        PrinterParams & pp = controller().params();
        ...

That initialization work is done only once, at the first invokation.
After that, it keeps remembering previous settings.

This has, unfortunately, one odd behaviour: when I change entries, but
then click on [Cancel], the changed entries are remembered. We may not
want that, do we?

But at least we are getting closer here, I believe.

---

And, eh, there's a very strange behaviour concerning file output.
1. start LyX and open a doc, e.g. /home/lahaye/newfile1.lyx
2. open the print dialog
    file name field has "/home/lahaye/newfile1.ps"
3. Select destination "File"
    Use [Browse] to select "/home/lahaye/whatever.ps".
4. Notice that the filename field in the dialog now only has "whatever.ps".
5. When I click [OK] or [Apply], the output is sent to
    "/tmp/lyx_tmpdir87891l9G2pa/lyx_tmpbuf0/newfile1.ps"
    and NOT to "/home/lahaye/whatever.ps".

This is a bug.
Somehow the path got lost somewhere and tmp directory is used instead.

Cheers,
Rob.

Reply via email to