Akseli Lahtinen [Fri, 30 Aug 2024 10:54:56 +0000 (10:54 +0000)]
settings: Fix the Use Current Location button
During the Dolphin settings revamp
(https://invent.kde.org/system/dolphin/-/commit/489b56b68bb29e81337e115c490eea4403001b71?)
this QUrl had been forgot to add back so that the
FoldersTabsSettingsPage knows what is the current url.
This change checks for the main window of dolphin, then gets
the URL of it whenever useCurrentLocation is called.
However, when this is used as KCM, the button is not
created, since there it doesn't make sense.
Carl Schwan [Tue, 27 Aug 2024 22:16:59 +0000 (00:16 +0200)]
Make settings tabbar expanding
Allow to use https://invent.kde.org/plasma/breeze/-/merge_requests/478
but even without the breeze MR, it look better and similar to what we do
with other settings page.
Jérôme Lécuyer [Wed, 21 Aug 2024 23:27:07 +0000 (01:27 +0200)]
Use QLocale to display localized time role group
Use QLocale to format the QDateTime displayed as the role/label of a group.
`QDateTime::toString` format the date and month names in English.
`QLocale::toString` returns them localized.
See the note about day and month names at https://doc.qt.io/qt-6/qdatetime.html#toString
Jin Liu [Mon, 19 Aug 2024 11:15:23 +0000 (11:15 +0000)]
Fix middle-click not following the "Open archives as folder" setting
Previous to this commit middle-clicking an archive would always open it
in a new tab. This contradicts the recent change d27ee07de7558470ef7b497fbe3d3504ce7cad07 which made it so middle-click
would open an item in the second application that is available to open
a file.
With this commit, middle-clicking will treat the archive like a folder
only when GeneralSettings::browseThroughArchives is enabled or when
there is no second application available. Otherwise middle-click will
open the archive in the second available application.
Felix Ernst [Sun, 18 Aug 2024 21:41:34 +0000 (21:41 +0000)]
Implement "Focus Places Panel"
This commit implements an action to move focus to the Places panel
analogous to "Focus Terminal Panel" functionality-wise.
The implementation of the "Focus Terminal Panel" and "Focus Places
Panel" actions is streamlined while improving their code quality.
The "Focus Terminal Panel" action is moved into the "Show Panels"
sub-menu because it makes more sense to be there considering that its
previous location (the "Tools" menu) is meant for external applications
and not for functionality internal to Dolphin.
This commit also makes it so the keyboard focus is moved to and from
the Places panel whenever it is toggled visible or invisible. This is
now consistent with the focus handling when the Terminal panel is shown
or hidden.
The "Focus Places Panel" is one of the actions which was wished for in
KDE's accessibility chat room because people relying on keyboard
controls might need to press the Tab key a lot to move from the view to
the Places panel.
Felix Ernst [Thu, 15 Aug 2024 20:46:39 +0000 (22:46 +0200)]
Make FoldersTabsSettingsPage fully usable for blind users
This commit fixes keyboard navigation for the "Folders & Tabs" page
in Dolphin's settings dialog. It also makes sure that the Orca
screen reader reads out sufficient information for every widget
that can get keyboard focus. These two groups of fixes together
should allow basic usage of this settings page for users relying
on keyboard controls and screen readers.
One weirdness prior to this commit was that for checkboxes with
a short group label in front and the full description behind
screen readers would only read out the label and skip the
explanation what the checkbox actually does. This commit fixes this
by explicitly setting the accessible text for the label. In
practice only reading out the explanation and skipping the label
seemed sufficient and is implemented here, but more specific text
could be provided using this mechanism if needed.
Felix Ernst [Thu, 15 Aug 2024 18:40:02 +0000 (20:40 +0200)]
ContextMenuSettingsPage: Stop forcing focus onto search field
Prior to this commit when switching between categories in Dolphin's
settings dialog by keyboard, the focus would suddenly switch away
from the category chooser when going over the "Context Menu"
category. This meant that one couldn't move to the Trash category
in a straightforward way but had to fight the focus change forced
by Dolphin.
This commit removes that forced focus change so the category can
now be changed by keyboard as expected.
Felix Ernst [Thu, 15 Aug 2024 17:56:39 +0000 (19:56 +0200)]
DolphinSettingsDialog: Move focus to Okay button last
This commit changes the Tab order in Dolphin's Configure dialog
so that the items which are visually at the end of the dialog are
also last in the keyboard focus order when cycling through the
interface using the Tab key.
Previously, the "Cancel", "Defaults", "Okay", and "Apply" buttons
received focus prior to the actual contents of the pages which
does not make sense from a workflow perspective.
This change should also make navigating this dialog easier when
relying on screen readers because reading those buttons out prior
to users even having a chance to change any setting did not make
any sense.
John Veness [Fri, 16 Aug 2024 07:35:27 +0000 (07:35 +0000)]
Fix display of filename ampersands in actions
If you added the "Actions for..." button to the toolbar, filenames that contain "&" would not appear correctly in that button. This MR fixes that, and also the button that appears when using "Delete" with selection mode.
Yifan Zhu [Fri, 9 Aug 2024 03:21:08 +0000 (20:21 -0700)]
KStandardItemListWidget: select by number of unicode chars
Previously during rename, the number of QChar is used for selection,
which might be different from number of unicode characters.
Test plan:
- create the file zz❤️❤️.txt
- rename the file
- verify that the first 4 characters are correctly selected, which
didn't work before the patch.
Felix Ernst [Mon, 22 Jul 2024 10:51:33 +0000 (10:51 +0000)]
Notify users if authorization is required to proceed
Previous to this commit entering a folder without read access would show the non-descriptive error message "Could not enter folder". If the user actually is not allowed to view the contents of the folder, this is indeed true and this commit will preserve this message as is.
However, if an admin protocol is installed, users can actually view the contents of most folders after authorizing themselves as administrators. So this commit changes the error message in those specific circumstances to instead read "Authorization required to enter this folder." and provide a button to authorize themselves. This button is the "Act as Administrator" action.
If no admin protocol is installed, this commit has no effect.
The idea for this change came from Harald Sitter.
I receive funding for changes like this by the Next Generation Internet Initiative, which (as I understand it) will no longer provide funds for future projects like this if the current EU draft budget goes through as it is.
Felix Ernst [Sat, 13 Jul 2024 15:37:31 +0000 (15:37 +0000)]
Stop acting as admin when the authorization expires
Previously, the authorization just silently expired without any
visible change. The surprise only came when the user tried to do
any action, which immediately would show a password prompt. We
don't want users to randomly type passwords into password
prompts unexpectedly showing up. This commit avoids that.
With this change, the view container visibly de-escalates
privileges and shows a message explaining what happened.
Felix Ernst [Mon, 8 Jul 2024 11:41:56 +0000 (11:41 +0000)]
Improve Filelight installation UX
Before this commit pressing the free space button when Filelight
is not installed would show a singular action called "Install
Filelight to View Disk Usage Statistics…". Pressing this button
would open the store page for Filelight. This is an okay user
experience, but we can do better.
This commit makes it so pressing the free space button when
Filelight is not installed shows an attractive UI that makes clear
that freeing up disk space can be accomplished nicely by installing
Filelight. The "Install Filelight…" button on this UI is connected
to PackageKit directly, so we do not need to show a separate store
like Discover and instead trigger an installation right then and
there. For this, the recently introduced DolphinPackageInstaller
KJob is used.
Installation progress is reported through the status bar similar to
the progress reporting of slowly loading directories or searches.
Installation failure or success is ultimately shown within Dolphin
as a passive notification above the view.
On Microsoft Windows or when PackageKit is not available, the
install button will only open a store page for Filelight.
This prevents a crash. One issue identified is that the commit that
I am reverting here accesses a QDropEvent at a moment in time in
which it might have already been deleted. We cannot check if it
exists by that time because we do not control its lifetime and it
is not a QObject.
Felix Ernst [Mon, 1 Jul 2024 12:03:22 +0000 (12:03 +0000)]
Guide users to using kio-admin instead of sudo
This commit adds a guided setup that leads users from a situation
in which they try to "sudo dolphin" towards them successfully
setting up and using kio-admin.
1. When users enter "sudo dolphin", they are told to start Dolphin
by typing "dolphin --sudo" or "dolphin --admin" instead.
2. When Dolphin is started with "--sudo" or "--admin" it checks
whether an "admin" protocol is installed. If not, a guided
setup leads users towards installing it.
3. After that, Dolphin starts with an installed "admin" protocoll
like kio-admin. Now a non-modal information dialog appears that
explains how to activate and use kio-admin.