Commit graph

60 commits

Author SHA1 Message Date
Laurent Montel
cb691f70dc Fix some clazy warning
Summary: fix clazy warning

Reviewers: aacid

Reviewed By: aacid

Subscribers: nicolasfella, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20832
2019-05-27 08:02:57 +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
Yuri Chornoivan
c7722c4078 Fix minor EBN issues 2018-08-17 21:05:01 +03:00
Simone Gaiarin
48b9ca66a6 Raise annotation window when clicking on annotation
Summary:
Raise annotation window when clicking on the window title, window text edit, or the associated annotation.

BUG: 388532

Reviewers: #okular, aacid

Subscribers: okular-devel, ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10792
2018-05-18 15:17:58 +02:00
Dileep Sankhla
de56b9c9c1 Use correct arrow cursor for Annotations' close buttons
Summary:
When hovering the mouse over the X symbol to close a note the cursor remains the same of the current shape (hand, selection cursor) based on the tool selected.
This patch morphe the cursor to the standard arrow over the X symbol to close a note by adding setCursor() call in the CloseButton constructor

 BUG: 384381

Test Plan:
1.  Open okular and select Tools -> Review or press F6 to create a new pop-up note
2. Hover the mouse cursor over the close button (X) of the pop-up note window
3. You will see the standard arrow instead of the current tool based cursor.

Screenshot below (the tooltip saying "Close this note" was not captured by Spectacle application)
{F5685539}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10209
2018-01-31 10:58:07 -07:00
Albert Astals Cid
19b7e3c112 The work in this branch was sponsored by LiMux
give them some credit in the headers
2017-11-16 09:58:31 +01:00
Albert Astals Cid
ca5422d0e9 Implement swapBackingFile for the PDF backend
How does it work:
 * What it does is really closing and opening the file again through poppler
 * This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
	* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
		* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
	* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
	* The annotationmodel needs updating it's pointers
	* The widgets for the forms are reused and their form* updated
	* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)

TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests
2017-10-26 15:30:44 +02:00
Albert Astals Cid
ba02656646 Make m_annowindows a set instead of a hash
Will make it for easier maintainance when we need to reuse the windows and annotation pointers change
2017-10-25 14:59:17 +02:00
Kevin Funk
a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Albert Vaca
3c93b2523e Added missing overrides found by clang-tidy 2016-10-29 17:07:10 +02:00
Albert Vaca
c71f308252 Fixes suggested by Clazy 2016-10-29 16:33:05 +02:00
Martin T. H. Sandsmark
ba4b9eb1a6 ui: Fix build without implicit cast to/from ascii
See previous commits for details.
2016-07-11 22:05:18 +02:00
Aleix Pol
f42a3bad65 Drop libkscreen dependency
Drops the x11 fallback. We were falling back to QX11Extras that were in
fact using QScreen internally.
Also remove the QDesktopWidget fallbacks for the same reason.
Drops some API for fetching the dpi and unifies it with ::realDpi(QWidget).

Based on Sebas's patch.
Reviewed by Albert.

REVIEW: 126913
2016-01-30 18:15:07 +01:00
Montel Laurent
466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Montel Laurent
6fab218de9 Use Q_NULLPTR 2015-08-18 15:12:07 +02:00
Montel Laurent
da040cbd46 Fix includes 2015-03-04 07:56:44 +01:00
Lukáš Tinkl
e9ae1d99af port away from KLocale 2015-01-29 21:48:47 +01:00
Montel Laurent
21360d6b7a Fix includes 2014-10-12 17:20:07 +02:00
Montel Laurent
3b4ee788b8 Fix includes 2014-10-08 13:37:04 +02:00
Montel Laurent
2eacdea022 Port to new connect api 2014-10-01 19:40:48 +02:00
Montel Laurent
927e7a9a19 Merge remote-tracking branch 'origin/KDE/4.14' into frameworks 2014-10-01 07:29:17 +02:00
Montel Laurent
378f6847a2 Remove some deprecated kdelibs4support 2014-10-01 07:27:09 +02:00
Albert Astals Cid
9312182085 Fix latex render in annotations
We need
  disconnect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
and it's counterpart, otherwise when inserting the image, the cursor pos changes, slotsaveWindowText is called, the content is passed by a toPlainText and set again and kaboom the content is lost

Also a few extra const

BUGS: 335476
FIXED-IN: 4.14.2
2014-09-27 01:58:26 +02:00
Frederik Gladhorn
6c602bf0e7 Use categorized logging even more 2014-09-16 23:38:25 +02:00
Frederik Gladhorn
83d3f1f6b7 Revert "Some more kDebug->qDebug"
Seems like kDebug doesn't spam the user, so this needs to use qCDebug.

This reverts commit 34fbdf8c85.
2014-09-11 02:03:46 +02:00
Frederik Gladhorn
34fbdf8c85 Some more kDebug->qDebug 2014-09-09 18:17:36 +02:00
Frederik Gladhorn
b32d815301 A few action and include fixes 2014-08-10 02:04:40 +02:00
Frederik Gladhorn
0ba233788c Use moc include style dictated by automoc
While it's generally not a great idea to include moc files at least this
compiles.
2014-08-09 00:21:03 +02:00
Fabio D'Urso
ad589985e1 Remove some unused #includes 2013-10-14 20:42:34 +02:00
Jon Mease
78faf1e68f Add undo/redo support for annotations
REVIEW: 107442
2013-04-06 00:22:48 +02:00
Fabio D'Urso
e130068726 Show latex button when the annotation popup window is opened
Check for latex contents after creating the MovableTitle, bacause it's in
MovableTitle ctor where the containsLatex signal is connected.
2012-06-05 00:48:52 +02:00
Fabio D'Urso
f6fa2a5614 Disable GUI operations on certain types of annotations
Modification and removal of *external* annotations are disabled by this
patch. Note that this change doesn't remove any functionality, because they
have never been implemented (AnnotationProxy is defined by the previous
patch).

The #if0'd blocks will be enabled by a future patch that provides fallback
behavior for generators that don't support saving changes.
2012-05-17 23:50:10 +02:00
Fabio D'Urso
ec9f068d77 Added AnnotationProxy to SaveInterface
Based on Pino Toscano's earlier work
2012-05-17 23:49:58 +02:00
Albert Astals Cid
b2dfb910e8 Small rework of AnnotWindow
* We do not keep them around any more time than needed (they are cheap to create)
 * AnnotWindow::slotsaveWindowText calls m_document->modifyPageAnnotation so
   edition of inline notes happens immediately
2012-01-17 23:46:37 +01:00
Yuri Chornoivan
9dab469366 Fix typos: occured -> occurred. 2011-11-25 07:36:23 +02:00
Frederik Schwarzer
40ac3d889b Make strings more user friendly. 2011-11-25 00:14:38 +01:00
Albert Astals Cid
62bea46f5e Do not need QMessageBox include 2011-09-22 19:31:39 +02:00
Niels Ole Salscheider
65153935d9 add LaTeX support to annotation window 2011-09-22 19:22:15 +02:00
Montel Laurent
f9f65979f5 Normalize signals/slots 2011-07-31 21:22:04 +02:00
Albert Astals Cid
0a514d630b Close the annot window on Esc keypress
svn path=/trunk/KDE/kdegraphics/okular/; revision=1202702
2010-12-01 22:46:30 +00:00
Pino Toscano
4b50e543d6 focus the text when showing an annotation popup
svn path=/trunk/KDE/kdegraphics/okular/; revision=935096
2009-03-04 14:30:42 +00:00
Pino Toscano
969abdeec0 make the tooltip for the close button of the annotation window a bit more clear
svn path=/trunk/KDE/kdegraphics/okular/; revision=789534
2008-03-24 14:34:05 +00:00
Pino Toscano
8df0b87e18 set & reload the author as well
svn path=/trunk/KDE/kdegraphics/okular/; revision=789353
2008-03-24 00:25:22 +00:00
Pino Toscano
961b27e99c Properly apply, and reload when changed, the annotation info in the annotation window (color, modication date, etc).
svn path=/trunk/KDE/kdegraphics/okular/; revision=789344
2008-03-24 00:08:08 +00:00
Pino Toscano
6511086ffc Annotation window:
- explicitely deny rich text
- set the plain text w/o an implicit html conversion

BUG: 159641

svn path=/trunk/KDE/kdegraphics/okular/; revision=789331
2008-03-23 23:18:35 +00:00
Pino Toscano
3c8f77a3ae In the annotation window, get the right anotation text using the cool function we already have;
to save it back, use a similar approach.

svn path=/trunk/KDE/kdegraphics/okular/; revision=784138
2008-03-10 18:16:23 +00:00
Albert Astals Cid
2f61e6545b use kclasses
svn path=/trunk/KDE/kdegraphics/okular/; revision=760478
2008-01-12 19:06:46 +00:00
Pino Toscano
aa9181b3a1 disable the option button for now
svn path=/trunk/KDE/kdegraphics/okular/; revision=746110
2007-12-07 21:55:41 +00:00
Pino Toscano
5556af3210 get rid of the hand made resize grip and use QSizeGrip - the trick about it was making the widget to be resized a Qt::SubWindow
this makes the annotation window working in RtL mode as well

svn path=/trunk/KDE/kdegraphics/okular/; revision=691341
2007-07-23 13:05:26 +00:00
Albert Astals Cid
0d47b62715 krazy include order issues
svn path=/trunk/KDE/kdegraphics/okular/; revision=655893
2007-04-19 18:30:20 +00:00