┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
AgeCommit message (Collapse)Author
2024-07-24DolphinViewContainer: Check "title" URL query if no path is givenKai Uwe Broulik
Makes it consistent with `KUrlNavigator` which checks a "title" query if no path is given, e.g. in baloosearch
2024-07-22Notify users if authorization is required to proceedFelix Ernst
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.
2024-07-13Stop acting as admin when the authorization expiresFelix Ernst
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. A method was implemented in kio-admin to make this possible. See: https://commits.kde.org/kio-admin/a2da29289d12ef845e2c1da17ed04c59f1c47762 This commit also improves some logic around the responsibility of hiding bars and activating view containers. This is also part of my project funded by the European Commission.
2024-07-08Improve Filelight installation UXFelix Ernst
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. CCBUG: 477739
2024-07-04avoid need for activities libChristoph Cullmann
use KRecentFilesAction like Kate and others to signal used files/dirs could later be used to plug-in a recently used menu, too, if ever wanted avoids that this dependency could be missed and the functionality is not there, too
2024-06-24DolphinViewContainer: Use KMessageWidget::MessageType instead of own typeFelix Ernst
This slightly simplifies code and allows showing KMessageWidget::Positive message boxes.
2024-06-20Prevent inconsistent status bar progress reporting statesFelix Ernst
Merge setting title and progress percent into one method. This makes sure that the method can be called from all over the place and will still always show a consistent state instead of partially showing the progress percent for one progress but the label for a different one. This is to enable various tasks reporting progress at the same time in a way that doesn't lead to a confusing mess for users. Usually multiple tasks do not show progress at the same time, but when it happens this commit should make sure that the user experience is at least bearable. Allow not having a "Stop" button next to the progress report for tasks that cannot be stopped.
2024-05-21Haiku build fixesSchrijvers Luc
Co-authored-by: Gerasim Troeglazov <[email protected]>
2024-05-18Avoid implicitly selecting itemsFelix Ernst
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. BUG: 424723
2024-05-13UrlNavigator: show a "lock" icon after the breadcrumb for read-only dirJin Liu
2024-05-11Add "Act as Administrator" toggle actionFelix Ernst
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.
2024-03-13Animate most of the barsFelix Ernst
When a bar is toggled visible this usually happens because the user might want to use its functionality now. However, if bars appear without animation or at a location the user is not currently looking at, they might not notice that they have appeared at all. An animation makes it more likely that the user notices the change and can then use the newly made visible component. Another reason for animations for showing or hiding of components is that it can be disorienting for users when panels or bars suddenly appear or disappear without animation. There is no visible movement then, so the user might not know what happened if they didn't concentrate or blink at that moment. The newly appearing or disappearing component might also displace other components which can make it difficult to find what one was just looking at. These bars animate now after this change: - Search panel - Filter bar - Status bar This is implemented by extracting the animation code from SelectionMode::TopBar into a new abstract base class AnimatedHeightWidget. This class is now also used in SelectionMode::BottomBar and the animating code there was removed. These bars are left in Dolphin that stay without animation: - Menu bar (Would probably need to be implemented in KXmlGui) - Tool bar (Would probably need to be implemented in KXmlGui) - Tab bar (Needs a different appraoch because it already inherits QTabBar and therefore can not inherit AnimatedHeightWidget)
2023-12-22Set viewFocus when DolphinViewContainer state is consistentAkseli Lahtinen
Read Felix' comment here: https://invent.kde.org/system/dolphin/-/merge_requests/679#note_835657 In short: > The above change moves the `m_view->setFocus()` towards a point in time in > which `DolphinViewContainer`'s selection mode state is consistent again. BUG:478724
2023-11-30Fix building with activities after the kactivities -> plasma-activities renameAntonio Rojas
2023-11-10Set position of KMessageWidgetCarl Schwan
To use a more frameless style
2023-11-08Adapt to KConfigGroup name officially being a QString typeFriedrich W. H. Kossebau
GIT_SILENT
2023-11-06Port away from ResourceInstanceNicolas Fella
The information reported here isn't used by anything Instead only report that the url was accessed, which is used for things
2023-10-23DolphinViewContainer: Use Auto*Warning*HandlingEnabledKai Uwe Broulik
Errors are put in a KMessageWidget by us in slotOpenUrlFinished. Fixes regression from 40cc5f665d.
2023-10-22Mention invalid protocol nameKai Uwe Broulik
Especially when clicking on an archive which redirects to a special KIO worker, it can be handy to see the actual protocol name.
2023-10-05DolphinViewContainer: Keep search box open when URL is changedAmol Godbole
The search box was being automatically closed whenever the URL is changed. Keep the search box open if no search text had been entered when the URL was changed. BUG: 474951
2023-09-04Restore the URL when DolphinSearchBox is clearedAmol Godbole
Currently, the URL navigator is not updated when the search box is cleared. This MR restores the URL, by closing and reopening the box. The call for emitting closeRequest() on pressing Esc has been replaced with emitCloseRequest(). The wait duration before starting a search has been reduced to 500ms to increase responsiveness. Also, the bugfix for BUG: 423328 is slightly incorrect and causes the search term to not be displayed when opening a saved search for the first time. As a better solution for this bug, DolphinSearchBox::setText() now updates the text only if the text has changed. BUG: 473775
2023-08-28Clean obsolete ifdefs since dolphin requires KF 5.101+Méven Car
2023-08-24Special case file opening with middle click for executable scriptsMéven Car
Since the first action would launch the script, we can use the first application associated to open the file.
2023-08-23On middle-click, open file with the second application for the file mimeMéven Car
FEATURE: 390631
2023-07-05Add explicit moc includes to sources for moc-covered headersFriedrich W. H. Kossebau
* speeds up incremental builds as changes to a header will not always need the full mocs_compilation.cpp for all the target's headers rebuild, while having a moc file sourced into a source file only adds minor extra costs, due to small own code and the used headers usually already covered by the source file, being for the same class/struct * seems to not slow down clean builds, due to empty mocs_compilation.cpp resulting in those quickly processed, while the minor extra cost of the sourced moc files does not outweigh that in summary. Measured times actually improved by some percent points. (ideally CMake would just skip empty mocs_compilation.cpp & its object file one day) * enables compiler to see all methods of a class in same compilation unit to do some sanity checks * potentially more inlining in general, due to more in the compilation unit * allows to keep using more forward declarations in the header, as with the moc code being sourced into the cpp file there definitions can be ensured and often are already for the needs of the normal class methods
2023-06-29Use ellipsis everywhere instead of three dotsTem PQD
Better for screen readers etc.
2023-06-28Move focus from hiding selection mode bars to viewFelix Ernst
When a user exits selection mode for example by clicking the "Exit Selection Mode" button, the bar is closed but the focus doesn't return to the view which would be expected. This commit actively moves the focus to the view in such a scenario. BUG: 469621
2023-06-13Settings Add ViewModes > Content displayMéven Car
This does not move the settings location in files though. baby step for https://invent.kde.org/system/dolphin/-/issues/36
2023-02-25Save a in-thread stat call each time the context menu is displayedMéven Car
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2023-01-25Clear filter bar on clicking current folder in placesSerg Podtynnyi
Reset the filter bar when user clicks on the current folder in places list, also rename slot function to be more clear. BUG: 259382
2022-11-29Exit the deleted directory when it is removedMéven Car
If current directory is a local file, try to find nearest dir ancestor and open it. Display warning to the user.
2022-10-11Remove unused includesLaurent Montel
2022-10-11port to KIO::createDefaultJobUiDelegateLaurent Montel
2022-09-26Add missing include (needed for building qt6)Laurent Montel
2022-09-26Remove unused includesLaurent Montel
2022-08-14Address Nate's UX feedback: Episode 2Felix Ernst
- Make Esc leave selection mode and have it only clear selection when already outside selection mode. - Let translators know that the "More" overflow button should only have a short text on it. - Fix a crash that happened when any code tried to exit selection mode even though selection mode had never been enabled to begin with.
2022-08-14Improve naming consistency and leave mode on EscapeFelix Ernst
2022-08-14Better separation of classesFelix Ernst
Make obvious when actions trigger selection mode.
2022-08-14Keep working towards a reviewable stateFelix Ernst
- Various code improvements - Smoother animations - The bottom bar in General Mode only becomes visible if items are currently selected - Removed the selection mode action from the default toolbar since it can already be toggled in various ways - More documentation - Some cleaning
2022-08-14Add Selection ModeFelix Ernst
The selection mode action is a checkable toggle action named "Select Files and Folders" which has "Space" as the default shortcut. In selection mode a bottom bar with contextual actions is shown. These should mostly mirror the actions which are available through the right-click context menu aka DolphinContextMenu. Resizing of the window might make a overflow button appear in the bottom selection mode bar. This commit makes press and hold in the view activate selection mode. This behaviour is not triggered if the press and hold is used to either start a rubberband selection or a drag operation within a short time. The length of the short timeframe is defined by a QStyleHint. This is currently not implemented in touch because I can't test it. Mix the selection mode bars' background colors using a nice combination of colors from the current color scheme BUG: 427202
2022-06-15Use cmakedefine01Ahmad Samir
This way we get a build time warning if the var isn't defined at all, e.g. a missing check_include_files() CMake call.
2022-02-04Merge branch 'release/21.12'Nicolas Fella
2022-02-04Fix opening FTP files in their preferred appNicolas Fella
When passing an URL like ftp://foo/bar.txt OpenUrlJob opens it in the default handler for ftp urls, not the one for txt files, which would be more appropriate here By passing along the mimetype we can change that behavior to what we want BUG: 443253
2021-12-17Enable Ctrl/Shift-Click to open folder in a new tab/windowAlessio Bonfiglio
and more
2021-12-08Show OpenUrlJob errors as inline messageKai Uwe Broulik
Avoids an ugly message box when opening a file fails or is forbidden.
2021-12-02[Location Bar] Add the ability to show hidden folders in the subdirectories ↵Eugene Popov
popup
2021-12-01Port away from deprecated KFileItemActions::runPreferredApplications overloadAlexander Lohnau
2021-11-13Fix updating window and tab titlesEugene Popov
This MR fixes an issue where the window and tab titles don't properly handle creating/deleting/renaming items in the places bar, as well as switching to the Search mode.
2021-11-02Remove duplicate include from .h/.cppLaurent Montel