Commit Graph

38 Commits

Author SHA1 Message Date
Eugene Popov
2fbab13e1f Port sidebar to QDockWidget
With this MR, the sidebar can now be (if not locked):
* docked to the left or right side
* undocked and floated as an independent window
* closed with the close button in the header

BUG: 455013
2022-12-22 22:50:55 +00:00
Alexander Lohnau
2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Albert Astals Cid
becdc7c483 Revert the two last commits
f9841b0f8a and e0f45add55

They break the windows build, which shows there's something defenitely
fishy going on with the current code, but oh well, someone with more
time needs to figure out a proper solution
2020-11-11 01:31:47 +01:00
Albert Astals Cid
e0f45add55 Enable -Wweak-vtables in clang
Read https://stackoverflow.com/a/23749273/11956287 for a full
explanation, but basically this is important for headers like the
interfaces/ and kdocumentviewer.h that are supposed to be used by third
partyies where it may happen that wrong things happen because the whole
class is inline in a header

For the classes that are defined in the .cpp or are not installed
headers this would not be necessary but it's not so hard to add a few
default defined destructors, so do that :)
2020-11-08 21:21:06 +00:00
Albert Astals Cid
19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Laurent Montel
516fb89d94 Use camelcase include. (scripted) 2020-07-08 13:54:37 +02:00
Andi Sardina Ramos
d735d50cde Give the option of switching to a tab if the file is already open instead of opening a new tab
Disabled by default

BUG: 419096
2020-04-23 07:39:32 +00:00
Albert Astals Cid
6d0d61c2ad Enable clazy copyable-polymorphic 2020-02-21 17:09:43 +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
Michael Weghorn
8bf1a91175 Add option to ignore print margins for non-PDF generators
Summary:
This adds a combobox in the print dialog of the non-PDF
generators to allow selecting whether or not to take
print margins into account.

For the PDF case and rasterized printing, new print otions have
been implemented in commit 2e97d58750
already, which adds an additional option to do no scaling at all.

For consistency reasons, the same terms also used for the PDF
case are used in the combobox (i.e. the two of the three that
apply).

This adds a new abstract class 'PrintOptionsWidget' with a
'ignorePrintMargins()' method to indicate whether print margins
should be ignored or not, and a default implementation.
The existing widget for the PDF generator now derives from this
class.

In order to avoid an ABI breakage, the return value of
'Document::printConfigurationWidget' is left as a 'QWidget *'
and a dynamic_cast is done on use.

FilePrinter is adapted to take into account the value set by
'QPrinter::setFullPage()' and the margin options
are now passed accordingly (either the values set in the dialog or '0').

A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
to extend the initial implementation to cover more generators.

Test Plan:
1) Open a PostScript file in Okular (using a document size that matches
  a paper size available on the printer used later makes it easier
  to see things behave as expected)

2) open print dialog, go to "Print options" and notice that there is a new
  "Scale mode" combobox whose value is set to "Fit to printable area"
   by default.

3) don't change any options, print to a printer that has hardware margins

Expected result: the document is scaled to the printable area (e.g.
scaled down so that the printer's hardware margins remain empty) as it
has been without this change.

4) Set the value of the "Print Options" -> "Scale mode" combobox to
   "Fit to full page" and print again

Expected result: The document is scaled to the full page size, i.e. ignoring
the printer's hardware margins.

5) Try steps 1-4 with other document formats supported by Okular and
   observe that they behave the same (except for the PDF case, where
   there's a combobox with three options that has been implemented
   independent of this change).

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10974
2019-04-03 08:00:35 -06:00
Yuri Chornoivan
c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Thomas Friedrichsmeier
df0c41212f Fix build with MinGW on Windows.
REVIEW: 127328
2016-03-16 10:57:34 +01:00
Gleb Popov
6fdc6e22a9 Make ViewerInterface to be exported unconditionally to fix linking errors with MSVC.
REVIEW: 125741
2015-10-29 18:54:19 +03:00
Montel Laurent
49ce3fc4d2 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	core/version.h
2015-08-03 09:44:50 +02:00
Alex Richardson
dcf4d93abb Fix the export header not being found in interfaces/*.h
REVIEW: 123363
2015-04-16 00:54:32 +01:00
René J.V. Bertin
7f6c9987ab Fix crashes on Mac
Seems Mac and/or clang need these to be exported

BUGS: 345765
2015-04-14 01:39:14 +02:00
Montel Laurent
5da7c5f77d port to qCDebug. Autogenerate export headers 2014-10-27 22:35:06 +01:00
Albert Astals Cid
7681cdf004 Move the open new files in tabs setting to configure dialog
Also make it non enabled by default for now

GUI
BUGS: 155515
2014-02-08 12:15:15 +01:00
Fabio D'Urso
ec9f068d77 Added AnnotationProxy to SaveInterface
Based on Pino Toscano's earlier work
2012-05-17 23:49:58 +02:00
Patrick von Reth
47c036cfe1 fixed windows build, dont export the pure virtual interface 2012-01-08 14:01:12 +01:00
Albert Astals Cid
ffbaa091b6 add the QtCore path here too 2011-12-11 22:16:53 +01:00
Michel Ludwig
5db362fb26 Use the correct line number in 'Part::showSourceLocation' 2011-11-08 08:25:36 +00:00
Michel Ludwig
5b7c6b8170 Add two new methods to the viewer interface.
Namely, 'areSourceLocationsShownGraphically()' and 'isWatchFileModeEnabled()'.
A corresponding implementation is provided.
2011-11-05 09:40:12 +00:00
Michel Ludwig
1be2696cc3 Allow for more control over when source locations are shown graphically.
The method 'showSourceLocation' has been extended with a new parameter which
controls whether the given source location is shown graphically. A new method
'clearLastShownSourceLocation' has been added; and a corresponding implementation
is provided.
2011-11-05 09:18:08 +00:00
Michel Ludwig
f431e98bb8 Change the action states according to whether a document is shown or not 2011-10-23 10:17:04 +01:00
Michel Ludwig
627d29bca2 Some reorganization 2011-10-22 09:30:49 +01:00
Michel Ludwig
e8e0237ca0 Add the possibility to show sources location graphically on the rendered pages.
Note that currently the rotation of pages is not taken into account as one still has
to find a unique way of handling this.
2011-10-17 20:56:45 +01:00
Michel Ludwig
ee7437eb61 Better let 'ViewerInterface' be part of the 'Okular' name space.
Also, use correct includes in 'viewerinterface.h'.
2011-09-10 20:04:44 +01:00
Michel Ludwig
0e29008150 Initial commit of the 'ViewerInterface' and of a first implementation. 2011-09-10 18:15:52 +01:00
Pino Toscano
c05523da2b fix #include paths in core headers to other core headers to be relative
... and with double quotes brackets, so they can properly include each other without relying on the compiler include path
2011-06-01 10:51:31 +02:00
Albert Astals Cid
10ba02cbd5 in case we have a new enough poppler give a better error message when we can't save files with /Encrypt
BUGS: 208119

svn path=/trunk/KDE/kdegraphics/okular/; revision=1037771
2009-10-19 23:00:52 +00:00
Pino Toscano
c9089f3160 Add the possibility to save a copy of the document with the changes to it (only for form fields at the moment).
On the Document/Generator side, introduce a proper interface for the purpouse.

On the GUI side, add a new "Save As" function that save the changed document to a location.
The action is enabled only if the current backend can provide the functionality.

svn path=/trunk/KDE/kdegraphics/okular/; revision=784661
2008-03-11 23:40:59 +00:00
John Layt
070285e039 Port from KPrinter to QPrinter, remove dependency on KDE4_KDEPRINT_LIBS.
*** Note this is not a complete port, most of the generators use the 
printFiles method which Qt 4.3 does not support, these have simply
been commented out until we find a solution.  At least it removes
the dependency so we can remove from kdelibs.

svn path=/trunk/KDE/kdegraphics/okular/; revision=725660
2007-10-15 23:01:27 +00:00
Pino Toscano
a8d747745f Cleanup a bit the GuiInterface, and making it work.
Instead of manually requestion actions and other stuff, we just make the interface as gui client, requesting and integrating it in the part gui.
Also, rename the Generator's componentData() to ownComponentData() to avoid clashing with KXMLGUIClient.

svn path=/trunk/KDE/kdegraphics/okular/; revision=705933
2007-08-28 23:17:00 +00:00
Pino Toscano
65920e10c6 document that reparseConfig() can be called even when not really necessary
svn path=/trunk/KDE/kdegraphics/okular/; revision=687022
2007-07-12 18:14:01 +00:00
Pino Toscano
8a216058f3 clean the headers
svn path=/trunk/KDE/kdegraphics/okular/; revision=656768
2007-04-22 10:39:31 +00:00
Pino Toscano
91b7675c14 configurationWidget() is too generic -> rename to printConfigurationWidget()
svn path=/trunk/playground/graphics/okular/; revision=622782
2007-01-12 23:48:29 +00:00
Tobias Koenig
ea51ee18f5 Do a lot of include cleanups... we install all important
header files now

svn path=/trunk/playground/graphics/okular/; revision=619492
2007-01-03 14:30:48 +00:00