Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Previews in open dialogues
Previews in open dialogues
 
   NeoOffice Forum Index -> NeoOffice Development
View previous topic :: View next topic  
Author Message
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: Tue Aug 29, 2006 3:48 am    Post subject: Previews in open dialogues

Now that we have lovely native file dialogues, is it possible to make them even nicer?

This document describes how to add a preview to an open dialogue, and the Open Document format already includes a preview (Thumbnails/thumbnail.png). My coding knowledge is about 10 years out of date, but it seems that it shouldn't be too difficult to add the drawing code to the example given.

Unfortunately there seems to be no way to make this thumbnail available to the Finder, short of adding a resource fork to the file, which doesn't aid cross platform issues.

Feel free to shoot me down in flames if this is an unnecessary distraction.

Andy.
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Tue Aug 29, 2006 6:33 am    Post subject:

Unfortunately Cocoa doesn't really have that much control over it from what I can gather, but there may very well be some type of plugin architecture I'm missing. The biggest problem with doing a preview is to engineer a way to get a quick shot of a page without having to actually load up OOo/Neo and render the first page. The little preview plugins are used throughout the system (I'm thinking of the way that PDF will display first page) so they need to be fast.

It's something I'm looking into for other reasons so I'll be sure to keep this in mind.

ed
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Tue Aug 29, 2006 9:46 am    Post subject:

Is the file actually being decoded on the fly, or does the app include a thumbnail in the picture? I know in Photoshop you have to specify to get one. But in the preview bit, all pictures with a plugin are rendered on the fly...

If there is an included thumbnail, is it in the actual file or in the .file that Mac OSX seems to add everywhere? If (much bigger if) that is the case, one could add a rendering there (PDF of the text on the first page only or sth.) on save.

Just a thought,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
jakeOSX
Ninja
Ninja


Joined: Aug 12, 2003
Posts: 1373

PostPosted: Tue Aug 29, 2006 11:17 am    Post subject:

i thought the question was about the 'open' dialog that is in Neo, not the finder...

-j, who is confused
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Tue Aug 29, 2006 11:29 am    Post subject:

jakeOSX wrote:
i thought the question was about the 'open' dialog that is in Neo, not the finder...


Yes, but I thought the poster was looking for about the same functionality.. But I may very well be wrong. I just had an idea and wrote, feel free to ignore.

best wishes,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: Tue Aug 29, 2006 12:25 pm    Post subject:

Neo creates a preview in all files when you save them. To see it, pick a file, change the extension to .zip, double click it and have a look in the thumbnails folder.

From my quick reading of the Apple documentation it seems to be fairly trivial to write a piece of code that will display this preview in the Open dialogue within NeoOffice.

What is less clear is how to get this preview to display in the Finder in Column View, though the clues may lie in this document.

As I said in my first post, my programming skills are woefully out of date, so I'm really just floating the idea and doing a little bit of research in case someone else (ie Patrick or Ed) feels like this would be a useful thing to do.

Andy
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Aug 29, 2006 12:31 pm    Post subject:

amayze wrote:
Neo creates a preview in all files when you save them. To see it, pick a file, change the extension to .zip, double click it and have a look in the thumbnails folder.

From my quick reading of the Apple documentation it seems to be fairly trivial to write a piece of code that will display this preview in the Open dialogue within NeoOffice.


Oooh! Good find. I was thinking that the creation of the thumbnail image would be something we would have to do. But since it is done automatically by the OOo code, Ed and I will just need to extract it out of the zip file and connect the bytes to the Apple APIs.

Patrick
Back to top
jakeOSX
Ninja
Ninja


Joined: Aug 12, 2003
Posts: 1373

PostPosted: Tue Aug 29, 2006 12:39 pm    Post subject:

pluby wrote:

Oooh! Good find. I was thinking that the creation of the thumbnail image would be something we would have to do. But since it is done automatically by the OOo code, Ed and I will just need to extract it out of the zip file and connect the bytes to the Apple APIs.

Patrick


whoa, i think that is the most excited i've seen patrick in a while. Wink

-j, who can't decide if that is a joey 'whoa' or a keanu 'whoa'
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Tue Aug 29, 2006 7:43 pm    Post subject:

Wow that really is a good find on the thumbnail image. I hadn't had time to look into that myself yet since I've been occupied with various other stuff as of late. Thanks for the tip! That'll really make the feasibility of the preview stuff a lot easier (along with other operations that will require thumbnail previews). Now all I have to do is find where that is generated and increase the resolution Smile

ed
Back to top
valterb
The Anomaly
(earlier version)


Joined: Sep 23, 2005
Posts: 463
Location: San Giuliano Terme, Pisa, Italy

PostPosted: Wed Aug 30, 2006 1:47 am    Post subject:

That would be good, if only I had that thumbnail folder Confused

I check this both with Neo on my iBook and in OOo on my ubuntu-linux computer: all files I have, converted as zip files and extracted, don't show that folder.
According to OOo documentation this could be related to files that are encrypted: if you want to encrypt a file people that grab that file hasn't to have the possibility to "read" the first page just looking at thumbnail.png!!! That files should have another "encrypted" thimbnail.
But anyway, I think I have not encrypted my files!!! Unless that FileVault does the job (but I don't understand how this could affect the odt file) Confused .

Anyway, the problem is with my configuration, since I saw for example that people of gnome project use that thumbnail to do this in nautilus (gnome file manager). Infact I have no problem with files created with OOo on my linux PC, the thumbnails folder is in!

Do you have any idea of what's going wrong here?

Valter
Back to top
LemonAid
The Anomaly


Joined: Nov 21, 2005
Posts: 1285
Location: Witless Protection Program

PostPosted: Wed Aug 30, 2006 3:03 am    Post subject:

Valter,
I changed an .ODT file from OOo 2.0.3 / Windows 2000 and I saw just ONE thumbnail file - NOT a folder. It was a very rough bit image of the first page. It was not at all readable - just colored bits that gave a general visual impression of the fist page.

Look for file and/or folders for the thumbnail

Philip ( impressed that the thumbnail was there at all! Wink )
Back to top
valterb
The Anomaly
(earlier version)


Joined: Sep 23, 2005
Posts: 463
Location: San Giuliano Terme, Pisa, Italy

PostPosted: Wed Aug 30, 2006 3:15 am    Post subject:

It's not there, nor the file neither the folder!!!

One of the files I wrote with Neooffice is here.
I have the same problem using OOo 2.0.3 X11 version.

Probably I was not clear enough before, but when I create my files with OOo 2.0.3 on linux everything is OK!!!

Valter
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Aug 30, 2006 7:06 am    Post subject:

The thumbnail is created when you save it with changes. I opened your file, added space, saved it, and now, if I do an "unzip -l" command on the file, I get:

Archive: /Users/pluby/Desktop/prova.odt
Length Date Time Name
-------- ---- ---- ----
39 08-30-06 14:04 mimetype
0 08-30-06 14:04 Configurations2/statusbar/
0 08-30-06 14:04 Configurations2/accelerator/current.xml
0 08-30-06 14:04 Configurations2/floater/
0 08-30-06 14:04 Configurations2/popupmenu/
0 08-30-06 14:04 Configurations2/progressbar/
0 08-30-06 14:04 Configurations2/menubar/
0 08-30-06 14:04 Configurations2/toolbar/
0 08-30-06 14:04 Configurations2/images/Bitmaps/
2923 08-30-06 14:04 content.xml
8204 08-30-06 14:04 styles.xml
1119 08-30-06 14:04 meta.xml
2636 08-30-06 14:04 Thumbnails/thumbnail.png
7372 08-30-06 14:04 settings.xml
1866 08-30-06 14:04 META-INF/manifest.xml
-------- -------
24159 15 files

Patrick
Back to top
valterb
The Anomaly
(earlier version)


Joined: Sep 23, 2005
Posts: 463
Location: San Giuliano Terme, Pisa, Italy

PostPosted: Wed Aug 30, 2006 7:46 am    Post subject:

I did what you suggest, so I reopen the file and make some changes. Than I unzipped the file and:

ibook:~ valter$ unzip -l prova.odt
Archive: prova.odt
Length Date Time Name
-------- ---- ---- ----
39 08-30-06 14:42 mimetype
0 08-30-06 14:42 Configurations2/statusbar/
0 08-30-06 14:42 Configurations2/accelerator/current.xml
0 08-30-06 14:42 Configurations2/floater/
0 08-30-06 14:42 Configurations2/popupmenu/
0 08-30-06 14:42 Configurations2/progressbar/
0 08-30-06 14:42 Configurations2/menubar/
0 08-30-06 14:42 Configurations2/toolbar/
0 08-30-06 14:42 Configurations2/images/Bitmaps/
3002 08-30-06 14:42 content.xml
8496 08-30-06 14:42 styles.xml
1209 08-30-06 14:42 meta.xml
7704 08-30-06 14:42 settings.xml
1693 08-30-06 14:42 META-INF/manifest.xml
-------- -------
22143 14 files


Still no thumbnail Sad
So I guess there is something with my configuration...

Valter
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Wed Aug 30, 2006 1:37 pm    Post subject:

I looked through all of the preference panes, but it wasn't there. Have you tried moving your NeoOffice2.x preference files out the way? Maybe something in there is causing your files to be without thumbnails.

You also have an official download, I presume, not something you compiled yourself?

best wishes,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Development All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.