Page 1 of 1

Genie Picturebrowser 0.6 (also shows PDF files)

Posted: Sun 03 May 2009, 00:09
by MU
This is a small demo of a Filebrowser written in Genie.
You have 3 "areas", on the left a tree with your folders, in the middle a filelist, and on the right a picture view.

You can change the width of each area with the horizontal dragbars, like this you can hide for example the folders.

It supports the most important graficsformat, and PDF documents.
PDFs can be shown in grafics mode, or as simple text (using leafpad).

The pictures are scaled to the size of the view when you open them, so if you maximize the window, you will see them very large.

Using the buttons, you can open the shown picture in external programs, e.g. to edit or to print them.

It was compiled in Puppy 4.12.

Info concerning the programming of this example:
http://www.murga-linux.com/puppy/viewto ... &start=135

A special version with support to drop pictures from websites is available, too:
http://www.murga-linux.com/puppy/viewto ... 769#302769
*update* these features now are also part of Picturebrowser (0.6).

Mark

Posted: Sun 03 May 2009, 00:34
by 01micko
Mark

This is very nice! A testament to the power of Genie. I must learn to use it, since it is the future of Puppy

Thanks

Posted: Sun 03 May 2009, 04:46
by Lobster
Micko

The best intro to Genie available is from Barry
http://www.puppylinux.com/genie/
Looking at Marks first code for this yesterday (which I could understand sufficiently to think about hacking) :shock:
http://www.murga-linux.com/puppy/viewto ... 198#301198
I thought this cries out for different auto file viewings
- calling other programs as necessary
A few hours later and Mark is already going that way . . .
Barry too has passed the programming barrier and is now thinking in Genie code.

Meanwhile I am able to report that adding the devxx
for Jaunty Pup (an Alpha build of Puppy 5) allows for a very workable Valide to appear in the Puppy menu

Many thanks to Mark :)
Good luck to Micko 8)

Posted: Sun 03 May 2009, 05:52
by ttuuxxx
Hey mark excellent start on it :) looks great
Anyway of turning it into a background selector/setter :)
I really do miss seeing the a thumbnail of the background before setting it.
Anyways excellent stuff
ttuxxx

Posted: Sun 03 May 2009, 08:09
by MU
The best way to get started learning the tree, is this example:
http://www.murga-linux.com/puppy/viewto ... 046#301046

It is pretty short and simple to use.
It has no filebrowsing included.
You can create the tree using some methods from my "treeclass".
So a program can be written with a few lines.

You could for example create a small configuration tool, like this:

+ network
--- firewall
--- connection
+ Desktop
--- wallpaper
--- widgets
--- themes

Each entry would get an own icon.
Once a selection was clicked, you could display in a second pane on the right a short infotext, and a button, to launch the related utility, like the networkwizard.

Such a thing would be possible without very much effort using that example.

The code for the picturebrowser looks more complex, because reading folders and sorting them uses a lot of code.
So I must "hide" (move) this new code into the tree.gs file.
Then your own program, main.gs, can be short again.
I already have some ideas for enhancing the pictureviewer, but before I start it, I need to clean up the classes.
I just found a way to make the treebrowser quicker, it needs only 2 lines in addition :lol:
The released version is a bit slow, if you open /usr/.
I'll release a new version next week.
Mark

Posted: Sun 03 May 2009, 13:16
by amigo
Is this Picturebrowser-0.1, Mark?

Posted: Sun 03 May 2009, 13:31
by MU
yes, the next will have a versionnumber.

Mark

Posted: Sun 03 May 2009, 14:08
by 01micko
Thanks Mark and Lobster for the links.

I'm still a learner with bash, but I think learning more and digressing is the key for me. :)

Cheers

Posted: Sun 03 May 2009, 23:16
by MU
I uploaded version 0.2.

Changes:
- faster navigation in the tree.

- fast navigation in picturelists: click with the mouse on the picture, to see the next one. Use the right mousebutton, to see the previous.

- autoscaling. If you check the "scale" checkbox, pictures are scaled. Autoscaling scales also, if you resize the window. I hope this also works on slower computers. If not, I must add a checkbox to deactivate autoscaling.

- support for bookmarks of the standard Gtk Filechoosers (you cannot edit them, so use the "file open" dialog of leafpad or so to add/remove bookmarks).

- by default, /usr/share/backgrounds/ is opened. This required a lot of complicated code, to expand the tree automatically.

- you also can pass a folder as argument, like:
/usr/local/Picturebrowser/Picturebrowser /mnt/home/photos

- the titlebars of the trees no longer scroll up.

Mark

Posted: Mon 04 May 2009, 18:47
by MU
Uploaded version 0.3.
It has no visible changes, just the internal code was cleaned up and refined.
This version is also available for Windows:
http://www.murga-linux.com/puppy/viewto ... 041#302041

Mark

Posted: Tue 05 May 2009, 20:15
by MU
uploaded version 0.5.

changes:

- The program no longer uses "Threads" to scale a picture, but a method based on Gdk.Pixbuf.
This works faster, needs less resources (14% cpu-usage instead of 42%), and works in Linux and Windows.

- bookmarks now also work with special characters in the filenames.

- rotate left/right

- zoom 100 to 1000% (you must uncheck the "scale" checkbox to activate it)

- fullscreen mode

Mark

Posted: Tue 05 May 2009, 20:24
by 01micko
Hehe, now we only need a "Set as Wallpaper" button.... but I've a feeling you are leading up to that!

Posted: Tue 05 May 2009, 21:26
by MU
micko,

quick workaround:
if you do not have gqview installed, create a script "/usr/bin/gqview".

Code: Select all

#!/bin/bash

/usr/local/apps/Wallpaper/set_bg "$@" &
Then Puppys wallpapersetter is executed with the current picture, if you click on the gqview button.
I also plan to add a button, but want to check, how it behaves in different puplets.
Mark

Posted: Wed 06 May 2009, 20:10
by dejan555
can you bind some keyboard keys to change next/previous picture, so you don't have to click on every image, this would be handy for fullscreen too...

Posted: Thu 07 May 2009, 10:07
by 01micko
MU wrote:....
I also plan to add a button, but want to check, how it behaves in different puplets.
Mark
Barry's "spup" (built from woof alpha 3.1) it works fine :wink:

Posted: Sun 17 May 2009, 21:40
by MU
Uploaded version 0.6

Changes:
- now based on the "pictureviewer" class, so it supports PDF documents and has other advantages, like drag'n'drop from the Webbrowser or a filemanager.

- fixed a *masive* memory leak. It was so critical, that I removed the 0.5 pet.

- added support for keyboard navigation.

- added support to pass a filename as commandline argument. The tree will automatically expand to the folder, where the fiile is located, and display it.

- only supported files are shown in the filelist (pictures or PDF).

Mark

Posted: Sun 17 May 2009, 22:08
by dejan555
This is great Mark, just few reccomendations:

Shortcut for fullscreen is Alt+F but for leaving fullscreen Alt+L, why not making Alt+F both?
What about looping filelist, e.g. when you reach last picture it reads again from top?
Also I had few images downloaded from web with %20 character in name (I guess converted spaces) that are shown in filelist but it desn't show them in viewer, I guess filename is the cause.

Works good, my vote for default image viewer in next puppy release :)

Posted: Sun 17 May 2009, 22:14
by MU
ok, I will have a look in one to two weeks.
I'll finish my C# course on Friday, until then I have no time.
Afterwards, I will try to add your suggestions, and enhance PuppyBrowser, and write a Genie examplebrowser for programmers :)

Thanks for your suggestions :D
Mark

Posted: Mon 18 May 2009, 00:25
by MU
oops, 0.6 had a small bug, so files could not be passed as commandline arguments.
I uploaded a fixed 0.6 now.

Mark

Thumbnail option

Posted: Mon 18 May 2009, 19:41
by Dromeno
Nice that it also works with PDF's. Is it possible to add a "view as thumnails" option too? Sometimes it is very handy to do that with PDFs and there is no file manage that I am aware of which shows files other than image files as thumbnails.