Sixthhokage2 / remuco

Automatically exported from code.google.com/p/remuco
1 stars 1 forks source link

Okular adapter #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Maybe, an easy and often usefull extension would be to provide a client, 
which does not control a mediaplayer - but only simulates keypresses. 

Like [Space] and [back] and [esc] - which would be usefull to use your 
phone as presenter (switching between slides while presenting). Or maybe 
directly controlling OOo-Impress.

Original issue reported on code.google.com by Daniel0...@gmail.com on 25 Sep 2009 at 8:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I created Remuco adapter for Okular (KDE 4 document viewer). Adapter is still on
early stage of development (I don't know Python, so it wasn't easy to write it 
;)).

Adapter can connect with Okular by dbus.

Functions:
- next = next page
- previous = previous page
- volume up = +10 pages
- volume down = -10 pages
- volume mute = first page
- show image = show current page
- fullscreen = presentation mode

Bugs:
- dbus object in name have PID. PID must be set in adapter file, so we must run
Okular and after that edit adapter file
- creating of thumbnails cause slightly slowdown

I'll try to fix these bugs tomorrow.. ;)

@obensonne: If you like it you can import it (maybe next versions ;)) to 
repository.
(And I think I should change something in licensing part, am I right?)

Original comment by pawel.pbm on 27 Sep 2009 at 1:17

Attachments:

GoogleCodeExporter commented 9 years ago
Wow - very fast response to my idea - thx for that.

Just skimmed over your file - looks quite good to me.

Ad. Bug1: I Have found a C++/QT example which shows different methodes to list 
dbus 
destinations, maybe it helps you:
http://doc.trolltech.com/4.5/dbus-listnames-listnames-cpp.html

Ad 2:
> creating of thumbnails cause slightly slowdown
Wow - great Idea - to see the current slide also on the phone... This is even 
more i 
imagined.

Looking forward to get this into the trunc. 

Daniel

Original comment by Daniel0...@gmail.com on 27 Sep 2009 at 2:30

GoogleCodeExporter commented 9 years ago
First bug solved.. ;) I'm searching list of dbus names, finding name with 
'okular' in
it and then connect to it..

Original comment by pawel.pbm on 27 Sep 2009 at 4:21

GoogleCodeExporter commented 9 years ago
Changelog:
- adapter can connect to first running instance of Okular
- list of pages as Playlist with "Go to page" function
- thumbnails are generated in poll function, not when we change page. Because 
of that
sometimes we must wait few seconds to view thumb, but switching to another page 
is faster

ToDo:
- opening files
- TOC as library function with "Go to page"
- open recent file
- vertical or hirizontal thumbs (changing by toggle repeat or shuffle)

Original comment by pawel.pbm on 27 Sep 2009 at 9:11

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks Pawel for working on this - I really appreciate it and I'm happy to 
integrate
your contributions.

However, things are easier for me (and actually for you too) if you could 
provide
your changes via a fork on BitBucket
(http://bitbucket.org/obensonne/remuco/overview/). This has several advantages:

- You are listed as a committer/contributor in the change log.
- I can easily pull and check your changes into the Remuco mainline.
- If I want to change or adjust minor things in your adapter, you can
  easily pull them too.

The last 2 points mainly avoid file ping-pongs in this issue.

If you are new to Mercurial version control and BitBucket, please let me know 
it. In
that case I'll just set up a wiki page with some instructions how to accomplish 
the
intended workflow.

Original comment by obensonne@googlemail.com on 27 Sep 2009 at 9:39

GoogleCodeExporter commented 9 years ago
Some minor general remarks:

In Python you can use ' and " interchangeably, i.e. you do not need to escape a 
" in
a string when you use ' as string quotations (relates to the line where you 
call the
convert command).

The file you pass to 'convert' .. is that an image file? If yes, you can just 
pass
that file name to the update_item() method without running 'convert' first .. 
it gets
thumbnailed automatically then.

Original comment by obensonne@googlemail.com on 27 Sep 2009 at 9:48

GoogleCodeExporter commented 9 years ago
I've never used Mercurial and BitBucket so if you can write me some HoTo..

In most cases convert will be used to create image from one specific page of pdf
(presentation) file. I must check what happened if we open in Okular other type 
of
file...

Original comment by pawel.pbm on 28 Sep 2009 at 5:17

GoogleCodeExporter commented 9 years ago
The HowTo page is not yet complete, but should be enough to get started:
http://code.google.com/p/remuco/wiki/Contribute

Original comment by obensonne@googlemail.com on 28 Sep 2009 at 6:48

GoogleCodeExporter commented 9 years ago
First contributions imported to repository...

Functions:
- all from comment 2 and 5
- go to specified page (search for page number)

Adapter can generate thumbs for graphic files (all formates supported by Okular 
and
iconv) and pdf files. Now I must find a way to generate thumbs from ODF files.. 
;)

@obensonne: I have one question: what funcion is responsible for "File browser" 
in
Amarok adapter? 

Original comment by pawel.pbm on 29 Sep 2009 at 5:12

GoogleCodeExporter commented 9 years ago
The file browser on the client gets active when you pass a list of ItemActions 
to the
keyword file_actions of PlayerAdapter.__init__()
(http://code.google.com/p/remuco/source/browse/base/module/remuco/adapter.py#423
).
Using the keyword mime_types you can restrict the types of file to which file 
actions
can be applied.
Finally you need to overwrite the method action_files()
(http://code.google.com/p/remuco/source/browse/base/module/remuco/adapter.py#791
) to
handle item actions issued on clients.

Original comment by obensonne@googlemail.com on 30 Sep 2009 at 9:04

GoogleCodeExporter commented 9 years ago
I've merged your current changes into the mainline and additionally did some
refactoring to the code to make it more consistent to other source files in 
Remuco
and to make it more "pythonic".

When you continue to work on the Okular adapter, you should pull in from the 
mainline
first .. otherwise merging gets a bit tricky.

Original comment by obensonne@googlemail.com on 30 Sep 2009 at 4:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I've attached some comments to the code:
http://code.google.com/p/remuco/source/browse/adapter/okular/remuco-okular?r=910
86dd4207c2249f1fb1b271ab8ff9e307106b2

Original comment by obensonne@googlemail.com on 30 Sep 2009 at 5:07

GoogleCodeExporter commented 9 years ago
Now the code looks much better.. ;) I'll try to write better looking code, but 
my
Python skills are limited.. ;) 

P.S. I don't see any comments there... 

Original comment by pawel.pbm on 30 Sep 2009 at 5:33

GoogleCodeExporter commented 9 years ago
> I'll try to write better looking code, but my Python skills are limited.. ;)

Nop. Everyone has to learn it once ..

> P.S. I don't see any comments there... 

Forgot to publish .. now you should see them.

Original comment by obensonne@googlemail.com on 30 Sep 2009 at 6:42

GoogleCodeExporter commented 9 years ago
I tried to read something about controlling of OpenOffice Impress.. Only thing I
found was pyUNO - python module to communicate with OO.o, but documentation for 
this
is poor and outdated (or maybe my Pyhon skills are poor ;). Maybe I'll read it 
again
in on Sunday...

Doc for pyUNO: http://udk.openoffice.org/python/python-bridge.html
pyUNO in archlinux: /usr/lib/openoffice/basis-link/program/ (it must be added to
sys.path to import module uno)

Original comment by pawel.pbm on 1 Oct 2009 at 7:38

GoogleCodeExporter commented 9 years ago
Changing this to an explicit Okular feature request. Other presenter apps 
should get
an own issue.

Original comment by obensonne@googlemail.com on 29 Oct 2009 at 7:43