Commit graph

307 commits

Author SHA1 Message Date
Albert Astals Cid
07a1f616c0 Enable clazy qproperty-type-mismatch 2020-02-21 17:09:46 +01:00
Albert Astals Cid
968e9d6073 Enable clazy old-style-connect 2020-02-20 15:48:08 +01:00
Albert Astals Cid
c10faf0926 Enable clazy qproperty-without-notify 2020-02-20 12:53:28 +01:00
Albert Astals Cid
b001ea2019 CI: Enable a bunch of bugprone- clang-tidy warnings 2019-12-24 10:18:16 +00:00
Albert Astals Cid
0a2287be19 CI: Enable two readability clang-tidy checks
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those

Also filter out the synctex folder, since that is imported code
2019-12-23 12:06:49 +01:00
Albert Astals Cid
78cf6bd910 CI: enable more modernize checks
Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
2019-12-18 12:51:13 +01:00
Ahmad Samir
45c72ff0eb Port from deprecated foreach to range-for
autotests/*, conf/* , mobile/* , shell/*, part.cpp, extension.cpp

The code compiles and all unit tests pass (except for the two that
fail on master too).
2019-12-12 22:48:27 +00:00
Volker Krause
6cf2242cd9 Port away from deprecated Bar|Desktop|SmallIcon methods
Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D25553
2019-11-30 10:45:10 +01:00
Abby Berkers
c56a924ab4 Add TeXiFy IDEA support 2019-11-30 01:02:03 +00:00
Jeremy Whiting
67e7dc8f4c Fix building okular without QTextToSpeech by adding ifdefs.
Also hide speech box in gui if built without tts features.
2019-10-09 07:33:52 +00:00
Jeremy Whiting
1b3bb01478 Add user okular user setting for which QtSpeech engine to use.
Default to speechd tts engine, but allow other choices from
okular settings.
Also add combobox to allow selecting the tts engine from config
dialog.

TODO: Change/update tts object when setting is changed.
2019-10-09 07:33:52 +00:00
Laurent Montel
8beef33c05 Port some deprecated methods 2019-09-18 13:41:19 +02:00
Laurent Montel
db0f477119 Port deprecated QLayout::setMargin 2019-09-18 13:35:04 +02:00
Simone Gaiarin
a33cb321df Improve layout of annotation configuration dialogs
Summary:
The config dialog of each annotation tool is now a form layout without group boxes. Everything is aligned.

Reviewers: #okular, #vdg, ngraham, aacid

Reviewed By: #okular, #vdg, ngraham, aacid

Subscribers: sander, davidhurka, aacid, okular-devel, knambiar, ngraham

Tags: #okular

Maniphest Tasks: T8076

Differential Revision: https://phabricator.kde.org/D10859
2019-06-24 07:36:21 +02:00
Laurent Montel
9f90e14dd1 Fix forward declaration 2019-06-03 08:48:32 +02:00
Rajeesh K Nambiar
59a86c3f14 Okular Annotation: add support for line start style for Straight Line tool
Summary: Similar to the line ending style, add support for line start style for the Straight Line annotation tool

Test Plan:
1. Go to Configure annotations
2. Create (or edit existing) Straight Line tool
3. Set the ‘Line Start’ option on Style and Apply
4. Use the Straight Line tool to draw a line and check the line starting style.

Reviewers: #okular, tobiasdeiminger

Reviewed By: tobiasdeiminger

Subscribers: ngraham, tobiasdeiminger, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21238
2019-05-19 09:08:02 +02:00
Rajeesh K Nambiar
db2dcdade3 Okular Annotation: add support for line ending style for Straight Line tool
Summary:
Poppler and Okular already have support for specifying Line End style (`TermStyle`) for the Straight Line tool. Expose the functionality in configuration and hook up the correct slots.

Configure annotations (before):
{F6788150}

Configure annotations (after):
{F6788151}

Straight Line tool with Open Arrow end in action:
{F6788153}

Test Plan:
1. Open a PDF in Okular
2. Enable Review
3. Right click on Review toolbar and Configure annotations
4. Create (or edit existing) Straight Line tool
5. Set the ‘Line End’ option on Style and Apply
6. Use the Straight Line tool to draw a line and check the line ending style.

Reviewers: #okular, #vdg, sander, ngraham

Reviewed By: #vdg, sander, ngraham

Subscribers: pino, sander, davidhurka, tobiasdeiminger, ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20760
2019-05-07 11:06:14 +02:00
Laurent Montel
f0ed618757 Fix add_test command 2019-04-30 07:02:26 +02:00
Oliver Sander
50bfd9fe86 Presentation: optionally go to prev. page when touching left half of the page
This patch makes switching presentation slides using touch screen taps
more flexible.  It introduces a new configuration option
'Touch navigation' with three possible values:
* 'Tap left/right side to go back/forward':
   Tapping on the left(right) half of the screen
  makes the presentation go to the previous(next) slide.
* 'Tap anywhere to go forward':
  Tapping on the screen makes the presentation go to the
  next slide, no matter where the screen is being tapped
* 'Disabled':
  Screen tapping doesn't do anything.

Previously, only 'Tap anywhere...' was implemented.

This patch does not change the behavior of mouse clicks.

Differential Revision: https://phabricator.kde.org/D18118
2019-03-11 21:09:30 +01:00
Yuri Chornoivan
2b6e75e411 Add TeXstudio support
Summary:
Some people need it because it is now the default TeX editor in distributions.

BUG: 404120

Test Plan: "Settings -> Configure Okular... -> Editor -> TeXstudio". Should work for the reverse search if the tex file is compiled with \usepackage[active]{srcltx}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, okular-devel, kde-doc-english

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D19272
2019-02-24 22:22:00 +02:00
Volker Krause
bc4c19eb92 Remove dependency on okularpart from the mobile components
Summary:
This only depended on okularpart due to the export header used in the
kcfgc file, so use a dedicated one for the mobile components that doesn't
export anything.

This enables disabling the part build for mobile-only builds such as
Android, and thus removing the need for some difficult dependencies
like KParts.

Reviewers: aacid

Reviewed By: aacid

Subscribers: aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D19037
2019-02-23 09:59:42 +01:00
Laurent Montel
6cbbc7f7a9 Fix mem leak found by asan
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f4fa41e3900 in operator new(unsigned long)
(/usr/lib64/libasan.so.5+0xed900)
    #1 0x7f4f96a455b2 in Okular::Annotation::Window::Window()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:341
    #2 0x7f4f96a46207 in Okular::AnnotationPrivate::AnnotationPrivate()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:493
    #3 0x7f4f96a7f605 in
Okular::TextAnnotationPrivate::TextAnnotationPrivate()
(libOkular5Core.so.9+0xb9605)
    #4 0x7f4f96a57ceb in Okular::TextAnnotation::TextAnnotation()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:1042
    #5 0x7f4f96e3e04f in EditAnnotToolDialog::createStubAnnotation()
/compile/kde5/framework/kde/kdegraphics/okular/conf/editannottooldialog.cpp:300
    #6 0x7f4f96e2aa8b in
EditAnnotToolDialog::EditAnnotToolDialog(QWidget*, QDomElement const&)
/compile/kde5/framework/kde/kdegraphics/okular/conf/editannottooldialog.cpp:97
    #7 0x7f4f96e52bbb in WidgetAnnotTools::slotAdd()
/compile/kde5/framework/kde/kdegraphics/okular/conf/widgetannottools.cpp:151
    #8 0x7f4f96e5799c in
QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>,
void, void (WidgetConfigurationToolsBase::*)()>::call(void
(WidgetConfigurationToolsBase::*)(),
2018-11-21 13:25:59 +01:00
Dileep Sankhla
e44ff38706 Support setting text color for typewriter annotations
Summary:
Changing typewriter text color can be done in the typewriter properties dialog, or programmatically via new okular API methods TextAnnotation::textColor and TextAnnotation::setTextColor.

poppler >= 0.69 is required to store text color natively inside PDF documents. For other document types, text color is stored as metadata inside the document archive.

This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.

Test Plan:
- properties dialog of typewriter annotation has "Font Color" picker
- saving to PDF results in <r> <g> <b> rg operation in /DA
- saving to archive results in fontColor="rrggbb" attribute in metadata.xml

Reviewers: sander

Reviewed By: sander

Subscribers: kde-doc-english, sander, okular-devel

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D15205
2018-10-04 20:02:55 +02:00
Dileep Sankhla
6dd7cf662d Add typewriter annotation tool
Summary:
Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.

This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.

FEATURE: 353401

Test Plan:
- okularpartrc is generated (if not yet existing) with typewriter as 10th tool
- typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
- selecting the tool and left click into document opens inline note input dialog
- finishing creates an annotation similar to inline note, but with transparent background
- saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
- saving typewriter into archive stores color with alpha channel = 0x00
- opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
- opening annotated archive works, if archive was created with patched Okular, and opened in old Okular

Reviewers: sander

Reviewed By: sander

Subscribers: ngraham, sander, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D15204
2018-09-25 22:47:01 +02:00
Dileep Sankhla
d61cef693d Store all annotation color attributes as ARGB string
Summary:
This is mainly preparation for D15204 (typewriter), where storing RGB won't be sufficient any longer.
Typewriter will need transparent background (alpha=0x00), which can only be expressed as ARGB string.

Current code handles name format identical for all annotations. It doesn't hurt to store all annotations in ARGB format, so instead of introducing special handling for typewriter, let's store all annotation color attributes as ARGB string.

Note: In case of previously existing okularpartrc, configuration will be reused without conversion. New color format will be written when new settings are saved. This has no bad effect.

Test Plan:
- when [Reviews] section in okularpartrc is initially generated, all annotation color attributes are in #AARRGGBB format
- saving into archive stores color with alpha channel (#AARRGGBB), for all kind of annotations

Reviewers: sander

Reviewed By: sander

Subscribers: dileepsankhla, sander, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D15279
2018-09-07 18:33:16 +02:00
Yuri Chornoivan
39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Yuri Chornoivan
c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Yuri Chornoivan
c7722c4078 Fix minor EBN issues 2018-08-17 21:05:01 +03:00
Lukas Hetzenecker
ecc1141e02 HiDPI Support for Okular
Summary:
This patch enables HiDPI throughout the application

Every pixmap is multiplied by the devicePixelRatioF
QPainter code is ajusted to take the DPR value into account

All pixmaps get cached with the highest DPR of all screens. When moving the application to another screen, the cache doesn't have to be invalidated.

BUGS: 362856 383589
REVIEW: D6268
2017-10-14 14:47:20 +02:00
Albert Freeman
1f6e8a4782 Custom background color
Summary:
BUG: 182994

Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).

Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.

Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.

{F4257766}

Other less important information:
https://git.reviewboard.kde.org/r/130219/
https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html

Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).

Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham

Reviewed By: ngraham

Subscribers: aacid, ltoscano, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8051
2017-10-01 11:31:59 +02:00
Luigi Toscano
d176914e63 Revert "Custom background color"
Wrong authorship for the commit. Commit it again with the correct
information.

CCMAIL: pointedstick@zoho.com
This reverts commit 6b5a7c9a1a.
2017-10-01 11:27:53 +02:00
Nathaniel Graham
6b5a7c9a1a Custom background color
Summary:
BUG: 182994

Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).

Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.

Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.

{F4257766}

Other less important information:
https://git.reviewboard.kde.org/r/130219/
https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html

Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).

Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham

Reviewed By: ngraham

Subscribers: aacid, ltoscano, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8051
2017-09-30 19:45:24 -06:00
Kevin Funk
a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Montel Laurent
c1e60e5539 Minor 2017-06-02 07:47:56 +02:00
Marco Scarpetta
fa315eb59c Allow to disable automatic search while typing
BUGS: 326522
REVIEW: 129956
2017-03-14 00:31:42 +01:00
Albert Astals Cid
191a37fb52 Q_DECL_OVERRIDE -> override 2017-03-02 20:39:24 +01:00
Albert Astals Cid
b50aff3ed7 Q_NULLPTR -> nullptr 2017-03-02 20:09:32 +01:00
Albert Astals Cid
1747b8b662 Match the spring actually push things up 2016-12-08 22:34:50 +01:00
Albert Vaca
c71f308252 Fixes suggested by Clazy 2016-10-29 16:33:05 +02:00
Albert Astals Cid
62eea3336b Merge remote-tracking branch 'origin/master' into frameworks 2016-10-29 11:13:24 +02:00
Olivier CHURLAUD
62f2cb99f6 Remove a spurious trailing semicolon that issued g++ warnings
Commited on behalf of Oliver Sander
REVIEW: 128673
2016-08-18 16:12:32 +02:00
Olivier CHURLAUD
04908dba2f Adding RTL reading mode feature to okular
Commited on behalf of Fahad Al-Saidi

REVIEW: 125397
BUG: 325650
2016-07-26 01:37:54 +02:00
Martin T. H. Sandsmark
622fce954d Silence unused member variable warning 2016-07-24 19:18:36 +02:00
Olivier CHURLAUD
630269a400 More ports out of KDialog 2016-07-17 02:28:57 +02:00
Olivier CHURLAUD
3d7bea0f80 remove leftover from intermediary tests 2016-07-17 00:57:26 +02:00
Olivier CHURLAUD
6ff419ecba Port away from KButtonGroup 2016-07-17 00:56:11 +02:00
Martin T. H. Sandsmark
67e7ada311 Fix build without implicit cast to/from ascii
See the previous commits for details. This is the last part.
2016-07-11 22:11:43 +02:00
Martin T. H. Sandsmark
439ced872d Port away from signal/slot keyword
When building okular without kdelibs4support it apparently builds with
-DQT_NO_SIGNALS_SLOTS_KEYWORDS.
2016-07-11 19:34:08 +02:00
Albert Vaca
67f69c8871 Merge branch 'master' into frameworks
# Conflicts:
#	CMakeLists.txt
#	active/app/package/metadata.desktop
#	conf/widgetannottools.cpp
#	core/version.h
#	generators/poppler/libokularGenerator_poppler.desktop
#	generators/txt/libokularGenerator_txt.desktop
#	generators/xps/libokularGenerator_xps.desktop
#	ui/annotationwidgets.cpp
#	ui/presentationwidget.cpp
2016-02-22 03:50:54 -08:00
Albert Astals Cid
c8f52a2795 Merge remote-tracking branch 'origin/Applications/15.12' 2016-02-08 00:28:09 +01:00