Commit graph

271 commits

Author SHA1 Message Date
Nicolas Fella 53fb06d6b4 Fix loading okularpart
Adapt to the new location
2024-01-12 01:02:57 +01:00
Sune Vuorela 70acf82817 Port from removed KConfigGroup keys api 2023-12-21 13:06:42 +01:00
Sune Vuorela 792425fc77 s/qAsConst/std::as_const/
We now definitely has std::as_const available and Qt has started nagging
about converting to std::as_const.

Implementation is the same for both functions, and qAsConst was a
stop-gap measure until std::as_const was sufficiently available.
2023-12-19 11:46:24 +00:00
Nicolas Fella 1bdd1fa7e2 Add missing include 2023-12-18 22:56:22 +00:00
Sune Vuorela 5fb88dfb86 The sidebar is a bit misbehaving
But some of the sidebar and welcomescreen things seems a bit like a hack
and trying to workaround features in other component, so hit it a bit
more with a hammer to behave.
2023-12-18 22:56:22 +00:00
Sune Vuorela d8274fa466 Port activities 2023-12-18 22:56:22 +00:00
Carl Schwan a79f3b71c2 Port away to newer KWindowSystem API 2023-12-18 22:56:22 +00:00
Carl Schwan 2f05100dc2 Adapt cmake for library name change for kexiv2 and plasma-activities 2023-12-18 22:56:22 +00:00
Scott Worley db2246f777 Allow shrinking the main window
The welcome screen's minimum size is quite large.  This change allows
the window to be smaller than the welcome screen when the welcome screen
is not visible.

BUG: 478577

Before and after screenshot:
![Before and after screenshot](/uploads/71f685c89a7324444b89e1abd0592b80/image.png)
2023-12-17 21:39:48 +00:00
Carl Schwan c466879717 Port away from YesNo action dialog
Since KF 5.100, the recommanded alternative is using TwoActions dialog
2023-12-13 10:12:51 +00:00
Sune Vuorela dff92b385d open/save to Documents when nothing provided
Fall back to documents location rather than empty string (current
working directory) when loading/saving
2023-12-07 12:15:23 +00:00
Sune Vuorela fd1684a2ce Remove redundant check
In around 2/3rd of the cases, we don't check that currentIndex of tabs
is less than the number of tabs, because it is not needed.
It is also not needed in the other cases, so remove that.
2023-11-22 16:05:42 +00:00
Nicolas Fella d4a344a189 Port away from deprecated KPluginLoader 2023-09-11 19:29:44 +00:00
Sune Vuorela 720e08220d Allow dbus to be disabled
In certain usecases, especially for non-linux desktop builds, the
advantage of of dbus is often limited. Provide a way to disable
building with dbus.

Note that this also disables the related functionalities of having a
second okular launch open the document in the first okular.

This also disables the unit tests that tests those features.
2023-07-18 07:53:42 +00:00
Friedrich W. H. Kossebau 725155b29d Include only needed headers instead of QtDBus module header
GIT_SILENT
2023-06-07 22:41:22 +00:00
Eugene Popov a25e37e6f7 Reuse an existing action to toggle sidebar visibility
BUG: 468317
2023-04-23 14:39:51 +00:00
Nicolas Fella 0501c5d8c4 Fix raising window when attaching to an existing instance on Wayland
When the second instance is launched it receives an activation token per environment variable

We need to pass that token to the first instance so that it can use it to raise itself

Also properly use startup ids for this on X11 instead of relying on forceActiveWindow, which is a hack
2023-02-09 12:26:52 +00:00
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
Albert Astals Cid 91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Albert Astals Cid 0d40301d50 Add a few definitions that will come with ECM 5.85
Better enforce them now, so that the work to port doesn't increase over
time

Not a super fan of this for regular applications, but oh well the ship
has sailed
2022-04-07 23:02:12 +00:00
Boris Petrov 32bbf3d4b8 Add tooltip with filename to document tabs
Add the filename as tooltip. This is convenient when multiple
files are open and most of the tab labels are elided.
2022-04-05 22:06:46 +00:00
Albert Astals Cid ba35bbd9e6 emit -> Q_EMIT
A future ECM is going to force that on us, so do it early
2022-03-19 10:58:47 +00:00
Volker Krause 50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Jiří Wolker f24aa63a97 Create welcome screen
This screen is similar to the one in Ark, but also shows you a list of
recently-opened documents.
2022-03-08 04:24:45 +00:00
Andreas Naumann 147a638619 Adds option editor-cmd to the commandline
Adds the option "editor-cmd" for the [feature request](https://bugs.kde.org/show_bug.cgi?id=263732) .

BUG: 263732
2022-02-18 13:33:28 +00:00
Albert Astals Cid 0c659a5466 clang-tidy: Enable google-explicit-constructor 2021-08-29 08:52:35 +00:00
Yuri Chornoivan 79ce3890a8 Fix minor typo 2021-08-15 08:53:44 +03:00
Nicolas Fella e95adea486 Remove dead code
There's always at least one tab since an okularpart is created at startup.

The supported minetypes are always read from this so fileFormats is never called.
2021-07-04 21:42:49 +00:00
Alexander Lohnau ac083e44e3 Make meaning of sponsoring note more clear 2021-06-10 08:11:56 +00:00
Alexander Lohnau 83dfef19ab Put author and mail on same SPDX-FileCopyrightText line 2021-06-10 08:11:56 +00:00
Alexander Lohnau 24c75071be Move sponsoring note outside of SPDX-FileCopyrightText statement 2021-06-10 08:11:56 +00:00
Alexander Lohnau 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Nate Graham 97264b534c Improve default window size
Okular's current default window size is very small, due to a bug which
will be fixed by
https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/53. Once that
is fixed, its default window size will become huge due to the current
sizeHint value, which basically says "take up 75% of the screen space".
This may be somewhat excessive.

This commit reduces the sizeHint to a saner default size while still
being big enough to show all toolbar buttons.
2021-04-27 17:47:15 +00:00
Michael Augaitis 9f5c05028d Make ESC key leave fullscreen
BUG: 366276, 417337, 269677
2021-02-09 23:57:47 +00:00
Albert Astals Cid d93a4bbd91 Use extensions instead of mimetypes on non Plasma environments 2021-01-30 10:37:24 +00:00
Albert Astals Cid db5c540d27 Merge remote-tracking branch 'origin/release/20.12' 2021-01-30 11:37:07 +01:00
Albert Astals Cid 2d69bd6e3a Reload xml to update shortcuts when they change in other parts
Or if we are using and "old" kxmlgui, reloadXML every time
2021-01-29 23:58:56 +00:00
Albert Astals Cid e407f3be94 Merge remote-tracking branch 'origin/release/20.12' 2021-01-17 01:37:16 +01:00
Albert Astals Cid 23af5aae7f Fix an unexpected file type being the default on open (non Plasma desktops)
BUGS: 430728
2021-01-17 00:53:09 +01:00
Laurent Montel 3f58639e06 operator+/- is disabled for QFlags in qt6 2020-12-09 08:34:49 +01: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 f9841b0f8a Remove kdocumentviewer
It was causing problems (Windows build fails) now that we enabled  -Wweak-vtables (and
probably before didn't work that much before, guessing that's why we had that if (doc)
in openFile)

This is the simplest solution, invokeMethod is not great but we already
use it, so it's not too terrible

The openDocument function was unused so remove it.

The other two solutions are:
 * Make KDocumentViewer be part of okularcore and then link the
   okularcore to the okular binary, not nice
 * Make another dynamic library that just contains the KDocumentViewer
   class, but i'd rather not add yet another library we have to install
   and take care of
2020-11-09 23:30:49 +01:00
Albert Astals Cid 91dbaa1f5b Set focus to the next current tab when closing the current tab
And by that it means giving the focus to the pageview which is most of
the fimes what we want. One could argue that if i had the focus on the
searchbar we should restore the focus there, but that makes not much
sense to me, since each tab is it's own world, at most one could say,
let's remember where the focus was in that tab the last time it was
focused and restore it there, but it seems a bit convoluted.

To be able of setting the focus to the pageview from the shell we need
to set up some focus proxies, so that part->widget (which is the sidebar)
ends up giving the focus to the pageview, which is what makes sense if
someone says "you part, set yourself the focus"

BUGS: 428257
2020-10-27 23:37:54 +01:00
Albert Astals Cid a66a18b82b Merge remote-tracking branch 'origin/release/20.08' 2020-10-27 12:47:14 +01:00
Albert Astals Cid 924a5fb9fc Fix middle click on sidebar tab bar unloads the document.
Filter the exact widget we care about for middle mouse buttons

BUGS: 426613
2020-10-27 00:36:12 +01:00
Laurent Montel 486e05b270 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:32:28 +02:00
Rafael Sadowski 49c680fd0e Fix RTTI with clang
Clang's RTTI support don't work here, use qobject_cast<> to avoid
runtime crashes.
2020-09-23 18:43:43 +02:00
Oliver Sander e62870b528 Replace call to deprecated method QStringList::toSet
As suggested in the deprecation warning, the call is replaced by
QSet(begin,end).
2020-09-11 10:48:47 +02:00
Albert Astals Cid 0fed884424 Add missing QStringLiteral 2020-09-10 13:17:58 +02:00
Albert Astals Cid 04d92f5847 File dialog: Use mimetypes instead of file extensions
Only if you're on a new enough KIO, we need
a1acb7744455b57dc972b3073f6e1dce0d49d965
and
7bf4d793a5ac54280c45660dbd04de4fa99dc994
present since 5.73 to make the UI usable

BUGS: 422574
2020-08-28 21:56:07 +00:00