Commit graph

7851 commits

Author SHA1 Message Date
Albert Astals Cid 302c38672f Make Document::swapBackingFileArchive use swapBackingFile 2017-11-14 09:49:32 +01:00
Albert Astals Cid 1ed2522b53 tweak can't save in this format warning message with suggestion from Burkhard 2017-11-13 23:23:32 +01:00
Albert Astals Cid bd724e4944 Get the okular archive mime translation name from kcoreaddons
Instead of asking the translators to translate it again
2017-11-13 18:12:34 +01:00
Albert Astals Cid ea1815be13 Also note the modified status (*) on the tab name 2017-11-13 17:59:45 +01:00
Albert Astals Cid eea5127e73 We also support opening Okular archive files 2017-11-13 17:30:54 +01:00
Albert Astals Cid 34f40b2c6f Tweak migrationMessage text a bit 2017-11-13 15:35:06 +01:00
Albert Astals Cid de948c4d71 We need to increase the part.rc version number
Since we added the "Save" menu option
2017-11-13 14:49:08 +01:00
Albert Astals Cid 055f2db76d Set back the autogenerated annotation unique name on saving
The the original unique name was empty. Otherwise we can't find the annotation after save/reload because the annotation name is still empty and a new random id is assigned
2017-11-13 14:41:05 +01:00
Albert Astals Cid 210a6ced5a Tweak saveAs + file with password text 2017-11-13 10:37:35 +01:00
Albert Astals Cid 3e423eeb7c Add missing test file 2017-11-13 10:16:25 +01:00
Albert Astals Cid 3c99a280f3 Add the file url to the save text
Makes more clear we're going to be saving over it
2017-11-13 10:10:46 +01:00
Albert Astals Cid 433d1eac23 Initialize copyJob just in case 2017-11-06 10:02:20 +01:00
Albert Astals Cid 9d450161b2 Use new style connects 2017-11-06 10:02:09 +01:00
Albert Astals Cid d2d7a880b1 Minor style adjustment 2017-11-06 09:28:04 +01:00
Albert Astals Cid 099d3cfcc8 Update @since to 1.3
Let's see if we can squeeze it in
2017-11-06 06:10:13 +01:00
Albert Astals Cid ae4f0671bf Unsplit some lines in tests 2017-11-06 06:05:22 +01:00
Albert Astals Cid fcbe97bdc0 Fix leaks in documenttest 2017-11-06 05:57:20 +01:00
Albert Astals Cid 30297bc477 Adapt the manual a bit about the new save options
And also remove some "you can do this since this ancient version" which doesn't really make much sense.
2017-11-03 16:39:53 +01:00
Albert Astals Cid 63543c9bbb Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-11-03 15:20:32 +01:00
Albert Astals Cid f621cd0c42 Add a few overrides 2017-11-03 15:20:01 +01:00
Albert Astals Cid 0da737a92b Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-11-03 10:03:00 +01:00
Albert Astals Cid 8944660ce7 Unbreak the code, need to register the metatype too ^_^ 2017-11-02 23:41:12 +01:00
Albert Astals Cid c2c1d76a0f Merge remote-tracking branch 'origin/Applications/17.08' 2017-11-02 17:50:02 +01:00
Albert Astals Cid 662fa69a2d Fix crash on rotation jobs
We don't need to delete the threadweaver job, threadweaver does it by itself,
and if we call deleteLater it may happen that the main thread deletes it
and then when the threadweaver thread tries to call the delete things are
gone and it goes kaboom

BUGS: 382725
2017-11-02 17:49:08 +01:00
Albert Astals Cid 453f45e7f7 Start the text generation request via a queued connection
Summary:
so that pixmap generation gets a chance to start before the text generation

This makes that on files where both the text generation and the pixmap generation
are slow at least we see something "as fast as possible" since only either text generation
or pixmap generation threads run at the same time

Reviewers: #okular, mlaurent

Reviewed By: mlaurent

Subscribers: michaelweghorn, dvratil, mlaurent, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8378
2017-10-31 10:04:03 +01:00
Albert Astals Cid cd24ad31c8 Implement missing todo in Document::swapBackingFileArchive
And extend tests to include archive files
2017-10-30 17:01:46 +01:00
Albert Astals Cid 946d54fb3e Add saveas+undo/redo for forms 2017-10-30 16:03:40 +01:00
Albert Astals Cid c14fbe5eb6 Remove SaveAsDontShowWarning
It was only used in tests as a way to "hide" warning dialogs, now we have a proper way to
close them, this way we make sure that dialogs are should when they should not not when they should not
2017-10-30 11:12:00 +01:00
Alexey Demennikov d679b3c9f2 Set the columns in "Overview" mode to match the amount of pages if document is small
Summary:
FEATURE: 355283

The principle is simple. This patch enables overriding the default columns for Overview mode, if the document is small. For example, if document has 1 or 2 pages and the default columns in Okular settings is 3, Overview mode will enable 1 or 2 columns for better UX

Reviewers: #okular, rkflx, ngraham

Reviewed By: rkflx, ngraham

Subscribers: ltoscano, aacid, rkflx, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8385
2017-10-28 21:20:10 +02:00
Jonathan Riddell 7d656d53a0 add missing include for find_dependency https://build.neon.kde.org/job/xenial_unstable_applications_okular_lintcmake/59/console 2017-10-27 14:53:23 +01:00
Albert Astals Cid 835c9c495d Add test for saveAs + undo/redo stack
Proves that if the backend supports swapping the file we keep the undo/stack around correctly
2017-10-27 10:12:29 +02:00
Albert Astals Cid c86c9a04a2 Add a jpg to the saveAs tests
This way we're also testing a backend that supports swapBackingFile but doesn't natively support annotations
2017-10-27 09:35:11 +02:00
Albert Astals Cid 8d7ea894f3 make parttest pass again 2017-10-26 21:24:09 +02:00
Albert Astals Cid 0cb4ff7dad Fix copy&paste mistake 2017-10-26 21:09:21 +02:00
Albert Astals Cid 147735fc5a set the modified flag when saving a file that doesn't support saving all of the things (e.g. annotations) but supports file swapping
Example, png files.

If you add an annotation and save and choose to lose changes, the annotation will still be around "in okular" but not on the file, so we need to mark the file as modified so that when the user tries to close he will get again the warning of "you're trying to save and will lose data" because otherwise the user may think the annotation actually was saved since he can see it
2017-10-26 19:16:48 +02:00
Albert Astals Cid b2673a58b1 When saving a file that had password we will reload it
Also tweak error messages a bit
2017-10-26 18:58:34 +02:00
Albert Astals Cid 8b06b0feec Make it clear continue will make you lose changes 2017-10-26 15:47:21 +02: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 423dd010e0 Remove m_formButtons
We don't need it, so it's one less thing to make sure we need to maintain in sync
2017-10-25 16:08:13 +02:00
Albert Astals Cid 8690497be7 Add Page::annotation
Will use it later
2017-10-25 15:21:46 +02:00
Albert Astals Cid 5c9edea430 Don't store the form twice in the formwidget classes
Just use m_ff and cast it when needed.

This will make it easy in the future when the given form for a widget may change so we only need to update one value
2017-10-25 15:12:35 +02:00
Albert Astals Cid 1095ffd85d We always need to swap/reload even if the url is the same
Since our generators are file oriented, saving means a new file was saved so we need to reopen the new one for things to work properly
2017-10-25 15:06:25 +02:00
Albert Astals Cid ead094862f Fix using && for flags 2017-10-25 15:03:19 +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
Albert Astals Cid 3435eb6df8 Convert m_formWidgets from hash to set
We don't use the key for anything
2017-10-25 14:51:58 +02:00
l10n daemon script 75604b10ea SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-10-24 05:11:28 +02:00
Albert Astals Cid 5413d38d22 Fix Cltr+S being used both for save and saveas 2017-10-23 16:33:20 +02:00
Albert Astals Cid 54bcb44559 Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-10-23 16:03:18 +02:00
l10n daemon script 1883a06614 GIT_SILENT made messages (after extraction) 2017-10-20 03:05:06 +02:00
Kevin Ottens 43199ae481 Mention the share menu in the documentation
Reviewers: aacid, kde-doc-english, yurchor

Reviewed By: yurchor

Subscribers: ostroffjh, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8263
2017-10-18 16:55:21 +02:00