Ben Cooksley [Sat, 25 May 2024 20:22:56 +0000 (08:22 +1200)]
Baloo Widgets and kio-extras are both part of KDE Gear - which is also what Dolphin is part of.
Accordingly, they should be using @same for their dependencies
This commit introduces an action which creates a new folder with a name
specified by the user and moves all the currently selected items there
in one go.
This action is implemented as a KFileItemActionPlugin which means users
can disable it on Dolphin's context menu settings page.
Felix Ernst [Mon, 20 May 2024 16:52:57 +0000 (16:52 +0000)]
Add label to button for closing the admin bar
The exact effect of the button is not perfectly clear without a
label because it could theoretically also have no effect other than
dismissing the bar (which is not the case). This situation is
clarified through this added label.
The tooltip of the button is adapted to complement the new button
label.
Felix Ernst [Sat, 18 May 2024 22:18:14 +0000 (22:18 +0000)]
Avoid implicitly selecting items
Items should only be selected if the user wants to act on them.
However, previous to this commit we sometimes selected items even
when there is no reason to assume that the user would like to act
on them. Such selections are dangerous because they make it more
likely that the user manipulates items by accident which they
never even explicitly selected.
Example: The "Up" action is used to navigate to the parent folder.
This will implicitly select the folder one emerged from after
opening the parent folder, so just one accidental press of the
Delete key will lead to data loss if the press goes unnoticed. This
scenario would have been avoided if no folder had been selected
automatically.
The above example becomes even more dangerous if the user is acting
with elevated privileges.
The following implicit selections of items are being removed:
- Selecting items that are being activated
- Selecting folders one emerges from
Even though these items will no longer be selected after these
actions, they will still be marked as current.
The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem.
The only downside I see is that our indication of which item is
"current" is a lot weaker than the selection highlight, so it might be
more difficult to spot which folder one has emerged from. However, this
could be counter-acted with some other temporary indication if this
really turns out to be a problem.
Felix Ernst [Sat, 11 May 2024 17:16:35 +0000 (17:16 +0000)]
Add "Act as Administrator" toggle action
This commit adds an "Act as Administrator" toggle action to the
View menu if kio-admin is installed. The action allows switching
between acting as an admin with root-access or not.
This was already possible in Dolphin when kio-admin is installed by
editing the location bar directly. However this is somewhat
unintuitive and there are no warnings at all about the dangers of
acting as an administrator.
This commit adds a warning dialog when triggering the action. It is
somewhat explicit about the risks because this is in fact very
dangerous.
Furthermore, while acting on a view with administrative privileges,
a bar above the view shows up that contains a warning. The bar can
be closed to stop acting with elevated privileges.
The warning dialog can be disabled and re-enabled from the Dolphin
settings but only if the action is even available.
There is a lot more to be done to further improve this feature both
security-wise as well as when it comes to usability. But
considering that we are already encouraging users to use this
feature without any warnings at all, I feel like now is a good time
to merge this.
This work is part of a project funded through the NGI0 Entrust
Fund, a fund established by NLnet with financial support from the
European Commission's Next Generation Internet programme, under the
aegis of DG Communications Networks, Content and Technology. As
such, please contact me if you plan on doing related work so what
you are doing doesn't collide with work I am being funded to do.
Akseli Lahtinen [Sat, 11 May 2024 15:59:03 +0000 (15:59 +0000)]
Check if namejob is already being run before opening new createDirectory dialog
This is a fix for a bug where in network views (or otherwise slow
systems), pressing `Ctrl+Shift+N` multiple times opens multiple popup
windows and thus causes a crash when any of the popups is interacted
with after closing the topmost one. The problem is not the crash with
popups themselves, but that we're opening multiple popups in the first
place.
In regular views this works fine, since the `nameJob` does not take
long time at all and only one popup opens, immediately blocking the
shortcut.
In network views, the `nameJob` seems to take a while to run, since it
is loading info from network. If user spams `Ctrl+Shift+N` shortcut in
frustration, it starts more `nameJob`s and eventually when those jobs
are done, it opens multiple popups.
This code checks that if we're already running a `namejob`, we're very
likely waiting for the `createDir` popup to appear, so we don't do
anything until there is no more `nameJob` running.
I've tested that it works in both network and regular Dolphin views.
Felix Ernst [Thu, 18 Apr 2024 10:28:28 +0000 (10:28 +0000)]
Add branding colors for Flathub
This is needed or they definitely won't feature us.
The light blue color is chosen because it is vibrant and fits the
association with "Dolphin". The very dark color is chosen to still have
a good contrast with the Dolphin icon even though it is already quite
dark at the top left corner.
For more information see:
https://docs.flathub.org/blog/introducing-app-brand-colors/
Felix Ernst [Wed, 17 Apr 2024 07:32:27 +0000 (07:32 +0000)]
Fix crash while entering selection mode with Qt6.7
`deleteLater()` on a non-existing object seems to cause a crash with
Qt6.7. This makes some sense but wasn't the case previously.
I didn't test this yet but it is a harmless change so if anyone can confirm we can IMO merge directly.
This was brought up in https://invent.kde.org/system/dolphin/-/merge_requests/764#note_920935, reported in the bug linked below, and the sentry crash reporting page also has a few dozen reports (https://crash-reports.kde.org/organizations/kde/issues/13589/?project=4&query=is%3Aunresolved&referrer=issue-stream&stream_index=1).
Dolphin 24.02 is also affected but we are already past the last bug fix release for it.
Felix Ernst [Tue, 9 Apr 2024 05:53:41 +0000 (05:53 +0000)]
Fix saving sort role after change from header
This is a partial revert of 5186f09cabf0af4b0683e75b0bcde1061f84a67e. That commit tried to
simplify code, however this lead to the saving of view properties
being skipped, introducing the linked bug.
The issue is that by the time the slotSortRoleChangedFromHeader()
method is called, the model already changed its sort role.
Therefore the check if the new role is identical to the old sort
role fails and no saving would occur.
With this partial revert the header will continue to change the
sort role itself (which allows a minor optimization of not double
sorting when also changing the sort order at the same time). The
method slotSortRoleChangedFromHeader() is then only responsible
for saving that change in the ViewProperties and telling the
SortBy menu in the user interface that the sorting has changed.
Jin Liu [Wed, 3 Apr 2024 12:34:50 +0000 (12:34 +0000)]
DolphinMainWindow: show a banner when the user presses the shortcut of a disabled action
Currently, there's no feedback when the user presses a shortcut of a disabled
action, e.g. cut / paste in a read-only directory. This patch shows a banner
in that case.
It's implemented by enabling a QShortcut for each disabled action. the
QShortcut is deleted when the action is enabled again.
The following actions are included:
cut
paste
rename
moveToTrash
deleteWithTrashShortcut
deleted
createDir
copyToOtherView
moveToOtherView
Nate Graham [Mon, 1 Apr 2024 19:25:13 +0000 (13:25 -0600)]
Mark servicemenu items' KNS content as risky
By design, these items will run arbitrary shell scripts on the user's
machine. That makes them security-sensitive and risky. Mark them
accordingly so the user is informed of the risk.
Depends on https://invent.kde.org/frameworks/knewstuff/-/merge_requests/309