Summary:
Unfortunately, poppler (the only backed that supports saving) is not able
to save properly if the file is modified by a third party while it is opened
So we give the user a warning saying things went wrong and give him the option
to not reload/close, that way if there was something very important in the annotations
she added she can try to save them (even if by copy&paste the contents to a third program)
Reviewers: rkflx
Reviewed By: rkflx
Subscribers: ngraham, rkflx, ltoscano, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8863
Summary:
exec() is blocking and should not be used if possible.
Currently it makes impossible to interact with a 2nd okular window
if the first window has the Properties or Embedded Files dialog open.
It also causes a double delete crash when closing okular via dbus
while either of those dialogs is open.
We can use open() instead which does not block the event loop and fixes
both the problems.
Test Plan:
1. Open the Properties or Embedded Files dialog, then close okular via dbus.
2. Open two okular windows, then open the Properties or Embedded Files dialog in one of them and try to use the other window.
Reviewers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8704
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
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
Summary: This is implemented using the Purpose framework.
BUG: 173896
Reviewers: aacid
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8244
Summary:
Files saved with QSaveFile don't get dirty. They are deleted and replaced.
Thus, inotify and KDirWatch don't emit a "dirty" signal (which is the correct behaviour).
Listening for the "created" signal of KDirWatch allows us to get notified on replaced files.
BUG: 384185
Test Plan:
Opened a markdown document in Okular.
Edited and saved the document with Kate.
The file is reloaded in Okular as expected.
Reviewers: aacid
Reviewed By: aacid
Subscribers: sander, rkflx, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7671
Summary:
Files saved with QSaveFile don't get dirty. They are deleted and replaced.
Thus, inotify and KDirWatch don't emit a "dirty" signal (which is the correct behaviour).
Listening for the "created" signal of KDirWatch allows us to get notified on replaced files.
BUG: 384185
Test Plan:
Opened a markdown document in Okular.
Edited and saved the document with Kate.
The file is reloaded in Okular as expected.
Reviewers: aacid
Reviewed By: aacid
Subscribers: sander, rkflx, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7671
Unregister the part dbus object when it gets destroyed
Also fixes a crash if you try to inspect okular with qdbusviewer after having closed the a part/tab
BUGS: 384142
QMenu title/section are optional to draw from the style side but we have crucial information in them
so reuse old KMenu code to create a fake action that behaves as title
I'll see if KF5 wants to accept this as contribution later
BUGS: 374079