diff options
| author | Felix Ernst <[email protected]> | 2024-07-22 10:51:33 +0000 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2024-07-22 10:51:33 +0000 |
| commit | 6e6fcf8da80b5b6821837054ae51eaa19edc24b8 (patch) | |
| tree | 6a627a61e8bcba056784b796cb5cecb419c08af4 /src/dolphinviewcontainer.h | |
| parent | f5687396c4f84d4045d652d7f8a5d783be54f7ea (diff) | |
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.
Diffstat (limited to 'src/dolphinviewcontainer.h')
| -rw-r--r-- | src/dolphinviewcontainer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index c5da6b48b..be28ecdeb 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -388,6 +388,11 @@ private Q_SLOTS: void slotStatusBarZoomLevelChanged(int zoomLevel); /** + * Creates and shows an error message based on \p message and \p kioErrorCode. + */ + void slotErrorMessageFromView(const QString &message, const int kioErrorCode); + + /** * Slot that calls showMessage(message, KMessageWidget::Error). */ void showErrorMessage(const QString &message); @@ -449,6 +454,8 @@ private: /// A bar shown at the top of the view to signify that the view is currently viewed and acted on with elevated privileges. Admin::Bar *m_adminBar; + /// An action to switch to the admin protocol. This variable will always be nullptr unless kio-admin was installed. @see Admin::WorkerIntegration. + QAction *m_authorizeToEnterFolderAction; KMessageWidget *m_messageWidget; |
