Discussion:
[Bitpim-devel] Phonebook printing
Roger Binns
2004-02-07 04:42:04 UTC
Permalink
Phonebook printing is now in the CVS code. I have tested it
on Linux and Windows and it works. (Linux doesn't print background
colours for some reason though). Mac people please verify it works.

The two things you can select are the layout and styles. Layouts
control what is shown and how it looks big picture. Zero or more
styles can be added to improve portions of the appearance. (Under
the hood, the layout generates HTML and the styles are somewhat
like CSS). Note that the colourful style doesn't do anything.

I will be adding a few more in time for the next build.

Roger
Steven Palm
2004-02-08 03:14:48 UTC
Permalink
Post by Roger Binns
Phonebook printing is now in the CVS code. I have tested it
on Linux and Windows and it works. (Linux doesn't print background
colours for some reason though). Mac people please verify it works.
Seems to work on the Mac. One oddity is that when you hit the Preview
button, a window opens that has no size (you can see the close widget
and resize widget), but when opened up it has valid content.
Roger Binns
2004-02-09 09:31:49 UTC
Permalink
Post by Steven Palm
Seems to work on the Mac. One oddity is that when you hit the Preview
button, a window opens that has no size (you can see the close widget
and resize widget), but when opened up it has valid content.
Do you have to manually resize it?

If so, can you add a fix to bphtml.HtmlEasyPrinting.PreviewText.
I would expect it to be something like this, just before the call
to Show.

if guihelper.IsMac():
frame.SetSize( (800,600) )

Where 800,600 would be some sort of sensible number for Mac screens.
(If feeling really brave you could take the current screensize and
make the Window about 70% of that size). The two lines commented
out are what they do in the demo which make the window the same
size and position as its parent. The result is it covering the
parent and making it look like the parent disappeared. Not a good
idea.

Roger
Steven Palm
2004-02-15 21:14:46 UTC
Permalink
Post by Roger Binns
Post by Steven Palm
Seems to work on the Mac. One oddity is that when you hit the Preview
button, a window opens that has no size (you can see the close widget
and resize widget), but when opened up it has valid content.
Do you have to manually resize it?
Yes, a manual resize is necessary. Sorry, I missed this somehow
earlier, so it didn't make it into the test4 build I just sent.
However, I'll check it out and have something that works in a logical
way ready for the next go-round.
Roger Binns
2004-02-16 02:50:35 UTC
Permalink
Post by Steven Palm
Post by Roger Binns
Do you have to manually resize it?
Yes, a manual resize is necessary. Sorry, I missed this somehow
earlier, so it didn't make it into the test4 build I just sent.
However, I'll check it out and have something that works in a logical
way ready for the next go-round.
That may explain the wxPython demo. The current code is in bphtml, line 325.
The two lines commented out come from the demo. They set the print preview
window to be the same size and position as the main app window (and hence
totally covering it). Needless to say that is really silly since it seems
like your main app window has disappeared.

If you are looking for a little project, I do have one for you. I think the
size of the preview frame should be saved. The main Window should also have
its size saved (see gui.py line 477). You can see an example of saving and
setting sizes in guiwidgets.py line 362. That code however is defective
because it should really be done within the window (in this case the comm port
browser) code rather than outside of it.

The other defect of that code is that it doesn't check the screen size.
Many people now have screens that can change size between runs of a program
(eg a laptop in docked and undocked configurations). Nothing is more annoying
than having a program remember its size and/or position and then place them
off the screen you now have, or too big.

As a suggested implementation, put a standalone function in guiwidgets.py
that takes the config object, basename for configoptions, and a suggested
screen size (as a percentage value). It should be called from the
__init__ method of various Windows/dialogs which would check the current
size, make it smaller if too big for the screen, and if the size is absurdly
small or there is no saved size, then size the window at the percentage of
current screen size supplied.

Another function would need to be present that is called when the Window/dialog
is closed, and save the current size. Bonus points for doing all this with
position as well. Even more bonus points for fixing cruddy code mentioned
above.

On a seperate topic, can you verify you can get M2Crypto installed
http://sandbox.rulemaker.net/ngps/m2/ I am doing a little side thing
that should make development easier when the phone is on another machine.
The M2Crypto is needed to get SSL support. I only care about 10.3 for this
(so the 10.2 instructions on that site are hopefully not needed or relevant).

Roger
Steven Palm
2004-02-16 17:34:44 UTC
Permalink
Post by Roger Binns
On a seperate topic, can you verify you can get M2Crypto installed
http://sandbox.rulemaker.net/ngps/m2/ I am doing a little side thing
that should make development easier when the phone is on another machine.
The M2Crypto is needed to get SSL support. I only care about 10.3 for this
(so the 10.2 instructions on that site are hopefully not needed or relevant).
Installed out of the box without problems just using the setup.py
stuff included.

python alltests.py
......................................................................
----------------------------------------------------------------------
Ran 70 tests in 5.313s

OK

Loading...