Skip to content

Commit

Permalink
Merge pull request #3 from afrimberger/master
Browse files Browse the repository at this point in the history
some UI improvements and minor fixes
  • Loading branch information
jeremysanders committed Jul 22, 2013
2 parents e6c3993 + 82ffaca commit 0aac7ad
Show file tree
Hide file tree
Showing 17 changed files with 944 additions and 109 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.*~
build/
47 changes: 38 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,48 @@ project(okularplugin)

FIND_PACKAGE(KDE4 REQUIRED)

INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . qtbrowserplugin )
INCLUDE(KDE4Defaults)

INCLUDE_DIRECTORIES(
${KDE4_INCLUDES} . qtbrowserplugin
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
)

add_definitions(
${QT_DEFINITIONS}
${KDE4_DEFINITIONS}
)

set(okularplugin_UIS
progresswidget.ui
)

set(okularplugin_SRCS
partwin.cpp
qtbrowserplugin/qtbrowserplugin.cpp
qtbrowserplugin/qtbrowserplugin_x11.cpp
)
partwin.cpp
progresswidget.cpp
qtbrowserplugin/qtbrowserplugin.cpp
qtbrowserplugin/qtbrowserplugin_x11.cpp
)


#
# proper handling of RPATH:
SET(CMAKE_SKIP_RPATH TRUE)



# this will run uic on .ui files:
QT4_WRAP_UI( okularplugin_UI_HDRS ${okularplugin_UIS} )


kde4_add_library(okularplugin SHARED ${okularplugin_SRCS})
kde4_add_library(okularplugin SHARED ${okularplugin_SRCS} ${okularplugin_UI_HDRS})

target_link_libraries(okularplugin ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS})
target_link_libraries(okularplugin ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS})

########### install files ###############
install(TARGETS okularplugin DESTINATION ${KDE4_LIB_DIR} )
install(TARGETS okularplugin DESTINATION ${KDE4_LIB_INSTALL_DIR} )
install( FILES okularpluginui.rc
DESTINATION ${DATA_INSTALL_DIR}/okularplugin )
DESTINATION ${DATA_INSTALL_DIR}/okularplugin )
install( FILES okularplugin_okularui.rc
DESTINATION ${DATA_INSTALL_DIR}/okularplugin )
51 changes: 42 additions & 9 deletions README
Original file line number Diff line number Diff line change
@@ -1,20 +1,53 @@
This is a KParts-based Okular plugin designed to work as a Firefox
compatible plugin.
This is a KParts-based Okular plugin for NPAPI-compatible browsers.
Tested Browsers are:
- Mozilla Firefox
- Google Chrome/Chromium

It uses Nokia's QtBrowserPlugin, part of Qt Solutions

Build instructions:

$ cmake .
-----------------------
Build instructions
-----------------------

1. Requirements:
================
- gcc
- automoc
- cmake
- kdelibs5-dev


2. Installation:
================
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install
$ sudo make install

Make sure that libokularplugin.so is in your mozilla/firefox plugins path

e.g.
3. Activate Plugin:
===================
To activate the plugin, make sure that libokularplugin.so is in your
browsers plugin path:

Firefox
-------
for 32Bit and 64Bit systems:
$ mkdir -p ${HOME}/.mozilla/plugins
$ ln -s /usr/lib/libokularplugin.so ${HOME}/.mozilla/plugins

You'll need to make /usr/lib/libokularplugin.so point to the file
which was installed by the make install step above.

Chromium
--------
for 32Bit and 64Bit systems:
$ sudo mkdir /usr/lib/chromium-browser/plugins
$ sudo ln -s /usr/lib/libokularplugin.so /usr/lib/chromium-browser/plugins


Chrome
--------
for 32Bit and 64Bit systems:
$ sudo mkdir /opt/google/chrome/plugins
$ sudo ln -s /usr/lib/libokularplugin.so /opt/google/chrome/plugins
40 changes: 40 additions & 0 deletions okularplugin_okularui.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
<kpartgui version="100" name="okularplugin_okularui">
<MenuBar noMerge="1">
<!--
Note: To ignore settings from ui_standards.rc the version number
of this file must be higher than that in ui_standards.rc
-->
<!-- we don't want a menubar -->
</MenuBar>
<ToolBar noMerge="1" name="okularToolBar">
<text>Main Toolbar</text>
<Action name="file_save_copy"/>
<Separator name="separator_0"/>
<Action name="go_previous"/>
<Action name="go_next"/>
<Separator name="separator_1"/>
<Action name="view_zoom_out"/>
<Action name="view_zoom_in"/>
<Action name="view_fit_to_page"/>
<Action name="view_fit_to_width"/>
<Action name="zoom_to"/>
<Separator name="separator_2"/>
<Action name="go_document_back"/>
<Action name="go_document_forward"/>
<Separator name="separator_3"/>
<Action name="view_render_mode"/>
<Action name="view_continuous"/>
<Separator name="separator_4"/>
<Action name="mouse_drag"/>
<Action name="mouse_selecttools"/>
<Separator name="separator_5"/>
<Action name="view_orientation_rotate_cw"/>
<Action name="view_orientation_rotate_ccw"/>
<Separator name="separator_6"/>
<Action name="edit_find"/>
<Separator name="separator_7"/>
<Action name="show_leftpanel"/>
<Action name="options_configure"/>
</ToolBar>
</kpartgui>
21 changes: 9 additions & 12 deletions okularpluginui.rc
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="okularplugin" version="1">

<MenuBar>
<Menu name="file" >
<DefineGroup append="open_merge" name="file_open" />
<DefineGroup append="save_merge" name="file_save" />
<DefineGroup append="print_merge" name="file_print" />
</Menu>
<Merge/>
<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
<kpartgui name="okularpluginui" version="100">
<MenuBar noMerge="1">
<!--
Note: To ignore settings from ui_standards.rc the version number
of this file must be higher than that in ui_standards.rc
-->
<!-- we don't want a menubar -->
</MenuBar>
<ToolBar noMerge="1" name="mainToolBar" >
<Merge/>
<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
</ToolBar>
</kpartgui>
2 changes: 2 additions & 0 deletions packaging/gentoo/www-plugins/okularplugin/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EBUILD okularplugin-1.0.0.ebuild 708 SHA256 ac3b9f4e810d5ef94e0e377b1b57046db7b420df468c8025cd885e2b1eb21937 SHA512 190d7413bf23e4e2f064264afd06e01085e62529969722430eb2be34baee516ed0e343d9ce5fc5cab55934944199d63a3a096432fa06b64cf98990418e8c3ad5 WHIRLPOOL bd169544f7b5541df6eef03b05687bd34673ebd4325eb68172383f0170f450ac45757cc23adf4bee74240ff869533f13d88dc543dabc8109939d7778092f254b
EBUILD okularplugin-9999.ebuild 708 SHA256 ac3b9f4e810d5ef94e0e377b1b57046db7b420df468c8025cd885e2b1eb21937 SHA512 190d7413bf23e4e2f064264afd06e01085e62529969722430eb2be34baee516ed0e343d9ce5fc5cab55934944199d63a3a096432fa06b64cf98990418e8c3ad5 WHIRLPOOL bd169544f7b5541df6eef03b05687bd34673ebd4325eb68172383f0170f450ac45757cc23adf4bee74240ff869533f13d88dc543dabc8109939d7778092f254b
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit kde4-base nsplugins git-2

DESCRIPTION="Plugin for embedding okular into the browser."
HOMEPAGE="https://github.com/afrimberger/okularplugin"

EGIT_REPO_URI="git://github.com/afrimberger/okularplugin.git"
if [[ "${PV}" != "9999" ]]; then
EGIT_TAG="v${PV}"
fi
SRC_URI=""

LICENSE="GPL"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="kde-base/okular"
RDEPEND="${DEPEND}"

src_install() {
kde4-base_src_install

kde_libdir=`kde4-config --install lib`
inst_plugin ${kde_libdir}/lib${PN}.so
}

pkg_postinst() {
elog "okularplugin is now installed, but must be configured as PDF viewer"
elog "in your browser(s)."
elog "Chrome:"
elog " Open the address chrome://plugins, disable \"Chrome PDF viewer\""
elog " and check \"Always allowed\" for \"Okular plugin\"."
elog "Chromium:"
elog " Open the address chrome://plugins and check \"Always allowed\""
elog " for \"Okular plugin\"."
elog "Firefox:"
elog " Open the Preferences dialog, go in the Applications section and"
elog " select \"Use Okular plugin (in Firefox)\" beside"
elog " \"Portable Document Format (PDF)\"."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit kde4-base nsplugins git-2

DESCRIPTION="Plugin for embedding okular into the browser."
HOMEPAGE="https://github.com/afrimberger/okularplugin"

EGIT_REPO_URI="git://github.com/afrimberger/okularplugin.git"
if [[ "${PV}" != "9999" ]]; then
EGIT_TAG="v${PV}"
fi
SRC_URI=""

LICENSE="GPL"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="kde-base/okular"
RDEPEND="${DEPEND}"

src_install() {
kde4-base_src_install

kde_libdir=`kde4-config --install lib`
inst_plugin ${kde_libdir}/lib${PN}.so
}

pkg_postinst() {
elog "okularplugin is now installed, but must be configured as PDF viewer"
elog "in your browser(s)."
elog "Chrome:"
elog " Open the address chrome://plugins, disable \"Chrome PDF viewer\""
elog " and check \"Always allowed\" for \"Okular plugin\"."
elog "Chromium:"
elog " Open the address chrome://plugins and check \"Always allowed\""
elog " for \"Okular plugin\"."
elog "Firefox:"
elog " Open the Preferences dialog, go in the Applications section and"
elog " select \"Use Okular plugin (in Firefox)\" beside"
elog " \"Portable Document Format (PDF)\"."
}
46 changes: 46 additions & 0 deletions packaging/gentoo/www-plugins/okularplugin/okularplugin-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit kde4-base nsplugins git-2

DESCRIPTION="Plugin for embedding okular into the browser."
HOMEPAGE="https://github.com/afrimberger/okularplugin"

EGIT_REPO_URI="git://github.com/afrimberger/okularplugin.git"
if [[ "${PV}" != "9999" ]]; then
EGIT_TAG="v${PV}"
fi
SRC_URI=""

LICENSE="GPL"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="kde-base/okular"
RDEPEND="${DEPEND}"

src_install() {
kde4-base_src_install

kde_libdir=`kde4-config --install lib`
inst_plugin ${kde_libdir}/lib${PN}.so
}

pkg_postinst() {
elog "okularplugin is now installed, but must be configured as PDF viewer"
elog "in your browser(s)."
elog "Chrome:"
elog " Open the address chrome://plugins, disable \"Chrome PDF viewer\""
elog " and check \"Always allowed\" for \"Okular plugin\"."
elog "Chromium:"
elog " Open the address chrome://plugins and check \"Always allowed\""
elog " for \"Okular plugin\"."
elog "Firefox:"
elog " Open the Preferences dialog, go in the Applications section and"
elog " select \"Use Okular plugin (in Firefox)\" beside"
elog " \"Portable Document Format (PDF)\"."
}
Loading

0 comments on commit 0aac7ad

Please sign in to comment.