The current shortcuts could conceivably override app shortcuts, since
they don't use the Meta key. The following changes are made:
Automatic Action Popup Menu: Ctrl+Alt+X -> Meta+Ctrl+X
Manually Invoke Action on Current Clipboard: Ctrl+Alt+R -> Meta+Ctrl+R
These are safe to change in the code rather than adding a new one and
keeping the old ones around for compatibility's sake because
KGlobalAccel::setGlobalShortcut by default preserves old shortcuts
when they are changed, and we aren't overriding that behavior here. So
only new installs will get the new shortcuts and existing user installs
will be untouched.
So that the "Apply" and "Defaults" buttons work properly.
Mostly this involves just setting appropriate object names
for the GUI controls, with some special handling for the
radio button sets.
This is the remaining part of the Klipper configuration dialogue,
the "Actions Configuration" page. Now that the options have been
moved to the "Popup" page, this is a simple tree view with action
buttons. The explanations and help links have been moved to the
"Edit Action" page, because that is where they are most applicable.
The "Action Properties" dialogue uses a QFormLayout, and includes
explanation text for the "Automatic" check box and the regexp help link.
Instead of editing in place, the "Edit" button opens a further dialogue
to edit the current entry. This is more discoverable and should be easier
on small displays than editing in place, although a double click is still
accepted. This dialogue has explanation text for substitutions.
The icon for a command can be set explicitly, for those cases where the
automatic detection (from the first word of the command) does not work.
Confirmation is requested when deleting a command or an action.
GUI:
I18N:
We can only access the QWidget's QWindow after it's been shown,
otherwise it's nullptr.
*8 QObject::installEventFilter(QObject*) (this=0x0, obj=0x561e5d7c6420) at qtbase/src/corelib/kernel/qobject.cpp:2218
*9 0x00007efbc06170dd in Klipper::showPopupMenu(QMenu*) (this=0x561e5d7c6420, menu=0x561e5fbb7c90) at plasma-workspace/klipper/klipper.cpp:407
When Plasma does not have focus on Wayland, we can't avoid Qt creating a xdg_toplevel.
It will get a decoration by default by KWin. Setting the flag avoids this.
CCBUG:436249
On Wayland if Plasma had no focus when the shortcut was invoked
- the menu window is created as toplevel because it has no parent and
there is no current focusWindow
- the application can't know the currrent cursor position
We use a newly introduced request on plasma_surface to open under the cursor.
As it can only be called before mapping a buffer to a surface, the menu is hidden
before being shown again.
BUG:436249
FIXED-IN:5.25
With the check box options previously on the "Actions" page, plus the
"Advanced" button (renamed to "Excluded Windows" to better reflect its
function), a shadow of the enable option (as on the system tray
popup menu) and the popup time (originally on the "General" page).
This brings all of the popup menu configuration options together,
and allows more space for the list on the "Actions" page.
Consistent wording referring to the menu throughout.
Add a message to point the user towards the next page for
configuring the actions.
Add some explanation text to the "Exclusions" list dialogue to explain
its function.
Currently, every time adding a new item, `beginInsertRows` and
`endInsertRows` are called, which is not efficient. Use `beginResetModel`
and `endResetModel` before and after loading history items to avoid
frequently emitting inserted signals.
CCBUG: 450989
In a recent commit HistoryItem::text() became the visual representation
of the mimedata; often a truncated string.
mimeData()->text() always returns the full value.
BUG: 446441
Klipper may freeze the whole plasmashell for tens of seconds trying
to render very long text string from history in the popup.
Trim very large strings to 200 characters (tooltip default) to prevent this.
BUG: 431673
Previously the "clear clipboard history?" dialog used `KMessageBox::questionYesNo`
which if "don't ask again" is ticked then saves the answer even if No was answered.
This can cause the user to not be able to ever clear the clipboard ever again. This
commit changes it to `KMessageBox::warningContinueCancel` which doesn't do that, and
is more appropriate for the kind of question we're asking.
BUG: 336053
FIXED-IN: 5.22
This is a mind-blowingly amazing feature, but nobody knows about it
because it's disabled by default since it has no default shortcut, and
there is no visible UI to tell you about it except for the shortcut
configuration view buried in Klipper's settings window.
A similar feature was just recently introduced in Microsoft Windows, and
users have started to ask why no equivalent KDE feature exists, because
they are unaware that it already does! The shortcut Microsoft chose is
Meta+V, which is a completely sensible one. If we set the same shortcut
for the Klipper feature, discoverability is automatically increased
because users familiar with Windows are already becoming accustomed to the
Meta+V shortcut. This is not an argument for deliberately copying
another platform, but rather making use of the user familiarity that
they have helpfully done the hard work of creating for us. Meta+V is
unused and is an appropriate shell-level global shortcut by virtue of
using the Meta key. So let's bind it to this Klipper feature by default.
7bd9bea072 started using Prison
unconditionally via QML import. So if Prison isn't installed the
clipboard applet stops working, complaining that "org.kde.prison is
not installed".
While it would certainly be possible to add another call to
"find_package(KF5Prison)" with TYPE RUNTIME, the result in
feature_summary would be very confusing, because OPTIONAL has a higher
priority and the runtime hint would vanish if you build with e.g.
-DCMAKE_DISABLE_FIND_PACKAGE_KF5Prison=TRUE.
We have a situation where some clients drop their old offer before
creating a new one. This means klipper tries to fill in the empty
clipboard at the same time the client posts its new real contents.
This adds in a flag (via a hidden mimetype) that klipper is trying to
replace a null clipboard. If this flag is set and our clipboard is not
null because the client has updated it in the meantime we ignore the
klipper update.
It's a workaround, rather than an ideal fix at a data level, but it
solves the problem in the interim.
Summary:
Wayland has an entire new protocol for getting and setting clipboard
when we don't have focus. Unfortunately this means reinventing
QClipboard from the QPA.
Not mergable as-is, especially the hardcoded line in CMakeLists but
uploaded to show direction.
It uses the newly agreed approach of using QtWayland generated classes
in clients directly rather than writing full pimpl API-fixed wrappers
first,
as ultimately that didn't really help do anything.
Code is written so that it can be moved to KWindowSystem if needed by
KDEConnect or others.
Test Plan: Copying and pasting all over the place
Summary:
Fixed clearing the clipboard when clearing history
(bug #409366 caused by 3bd6ac34ed)
Properly synchronize clipboard content and history
(deleting last item in history didn't clear the clipboard).
Keep last image in history even if we are ignoring images, but without preview
(so that we can still clear history, and the tooltip says truth about clipboard content).
Fixed tray icon tooltip text.
Do not scale small images up in clipboard Plasmoid.
BUG: 409366
{F7168503}
Test Plan:
Spectacle -> [Copy to Clipboard]
Paste into Dolphin (clipboard content)
Deleting single items from clipboard
Clearing the entire history
Reviewers: #plasma, #plasma_workspaces, ngraham, davidedmundson
Reviewed By: #plasma, #plasma_workspaces, ngraham, davidedmundson
Subscribers: GB_2, davidre, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22684
This makes Klipper identify as org.kde.klipper to the notification service even when running inside of Plasma and installs a rule
to disable it from history by default.
BUG: 408989
FIXED-IN: 5.16.3
Differential Revision: https://phabricator.kde.org/D21963
Summary:
D19852 intrdouced x-kde-force-image-copy hint for programs to specify that
images should be set to the clipboard even if should not be included in the
history. But when the program was closed the clipboard was restored to the first
item in history in which the image was not included. To fix this introduce a new
class member which holds the last clipboard item and restore it.
Credit goes to David Edumndson
Test Plan:
Try it with spectacle
Reviewers:
@ngraham, @davidedmundson, #plasma
Subscribers:
Summary:
D19852 intrdouced x-kde-force-image-copy hint for programs to specify that
images should be set to the clipboard even if should not be included in the
history. But when the program was closed the clipboard was restored to the first
item in history in which the image was not included. To fix this introduce a new
class member which holds the last clipboard item and restore it.
Credit goes to David Edumndson
Test Plan:
Try it with spectacle
Reviewers:
@ngraham, @davidedmundson, #plasma
Subscribers:
Summary:
Change the default Klipper behavior in order for https://phabricator.kde.org/D19715 to work.
Klipper will save images to clipboard, but unless Ignore Images is unchecked in the options, it won't save them to clipboard history.
CCBUG: 393708
Reviewers: #plasma_workspaces, davidedmundson
Reviewed By: #plasma_workspaces, davidedmundson
Subscribers: ngraham, davidedmundson, plasma-devel, #plasma_workspaces
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D19852