Go to the FreeLists Home Page Home Signup Help Login
 



[open-beos-printing] || [Date Prev] [01-2002 Date Index] [Date Next] || [Thread Prev] [01-2002 Thread Index] [Thread Next]

[open-beos-printing] Re: Printing Question

  • From: "Simon Gauvin" <gauvins@xxxxxxxxx>
  • To: open-beos-printing@xxxxxxxxxxxxx
  • Date: Sun, 20 Jan 2002 09:55:39 -0500
Answers and more questions, and I will start with the last question since it is
 the most important:

>>5) The constructor for PageSetupWindow class gets the settings 
>BMessage pre-set
>> from these previous calls, but what saves these settings back to the 
>BNode so
>> that other applications can use them=3D3D3F  
>
>If you want to make the settings global, the easiest way to do this is 
>to simply flatten the BMessage and write it as an attribute using 
>BNode::WriteAttr. You could overwrite the attribute used in 
>add=3D5Fprinter, so any call to default=3D5Fsettings() will also return these 
>settings.

This is already done. That is why I am asking these questions to find our where
 this code should go. The problem I see is that this is messy since the default
 settings are created by the Driver::default=5Fsettings() call, with hard coded
 values to start, and then the PageSetupWindow::SaveSettings() will write these
 to the BNode on exit as a global for all apps. This seems messy to me, to have
 this functionality split between two unrelated classes....

>However, I would give the user the option to save those settings using 
>a button named something like "Save as Default" or something simular.

No, that is not what I mean. There is no "default" that the user ever sees. The
 settings should be on and app by app basis as it is now. The only "default" is
 if 1) the driver is newly installed and there has never been any call to
 PageSetup yet, or 2) a new app has not called PageSetup on the printer yet. In 
case
 1) any app would get PageSetup with the hard coded defaults, and settings these
 would then make them the *new* defaults for any new app in situation 2). For
 all other apps that have opened the PageSetup dialog more than once they get
 their own version. Does this make sense=3F 

It's like there are three different sets of settings, 1) original, 2) default
 3) app. The priority of these to the app asking for them is always app first,
 default second if app does not exist, and original if default does not exist. 
App
 is easy since it is stored in the app and will be sent to the dialog in the
 SetSettings() call. default is the tough one since this is what you call 
'global'
 as it needs to be saved between apps...

If this is correct please advise, thanks.

>>
>>1) There is no default=3D3D5Fsettings(BNode* printer) method in 
>Driver.cpp, or
>> anywhere in the code. I assume that you will want me to add this 
>method to
>> Driver.cpp=3D3D3F
>>
>
>Yeah, it is a new method defined since R4.5, but is was never really 
>documented. There is a BNewsLetter about it, but can't find the 
>reference at the moment. It should be added sometime. I must be fair 
>and say that I haven't found many apps that trigger it to be called 
>yet, but it =3D5Fcould=3D5F be called, sure.

Then where do the default settings in the Page Setup Window come from=3F Surely
 they are not constants in the code!

>>2) default=3D3D5Fsettings() should write the attributes to the printer 
>BNode and
>> return them in the BMessage=3D3D3F
>
>Hmmm, I guess the default settings could be written to the BNode in 
>add=3D5Fprinter()  (is directly called after the printer has been created), 
>and read and returned from default=3D5Fsettings(). It are the "global" 
>default settings, before any config=3D5Fpage() or config=3D5Fjob() has been 
>done.

There has to be *some* values in the dialog the first time it is opened...
 where are these *original* ones for the other printers stored=3F In the other
 printer BNodes there are no settings stored there.

>>3) where should the 'actual' default setting values be located, with 
>'hard
>> coded' defaults in the code, or in a settings file like ~/config/
>printer=3D3D5Fdefaults
>> =3D3D3F
>
>Good question. Personally, the last made settings from a Page Setup 
>=3D5Fshould=3D5F be stored by the app in every document. An app can request
 the 
>settings by calling BPrintJob::Settings(), which are either the default 
>settings if ConfigPage() / ConfigJob() has not been called on the 
>BPrintJob object, or the result of these dialogs if they have been 
>called. So, if you want to store it, it would almost be the cleanest to 
>store it on a per-app basis. The problem is, that you don't know what 
>app requested the dialogs from the driver, so that is a real problem.

Yes, I know this. This was also why Philippe suggested saving this to the
 printer BNode for global settings. At some start point there *must* be a 
default set
 of values that are stored to set the dialog values for the first time an
 application wants to see the dialog, whether this is on an app basis or global 
to
 all apps...

>>4) config=3D3D5Fpage() could be called with an empty settings BMessage, 
>which
>> should then call default=3D3D5Fsettings()=3D3D3F
>
>Good question again. I guess BPrintJob should be handling this, but I 
>do not think it is doing that for R5 :( This might however be a good 
>addition for the OBOS print=3D5Fserver :) I guess you could do this for R5, 
>yeah.....

Ok, but where are these setting first going to come from...

>Please note however, the message is never going to be empty. AFAIK, 
>there will always be a "current=3D5Fprinter" element in the settings, which 
>is added by the BPrintJob code. But you should be able to test that 
>quite easily in your code.

I know, thanks ;)

---------------------
 Simon Gauvin,
 Dalhousie University
 gauvins@xxxxxxxxx






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.