┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
AgeCommit message (Collapse)Author
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
2021-07-04Fix regex porting regressionElvis Angelaccio
QAbstractItemModel::match() under the hood uses QRegExp::exactMatch(), so with QRegularExpression we need to use anchoredPattern() on the pattern. Regression spotted by a failing dolphinmainwindowtest.
2021-07-04Port away from deprecated enumElvis Angelaccio
We already require Qt 5.15
2021-04-17PlacesPanel: activating a place does not select its previously selected childrenMéven Car
BUG: 421347
2021-02-08Avoid KJob::exec() in DolphinViewFelix Ernst
This commit replaces an error-prone usage of KIO::StatJob::exec() in DolphinView with the recommended KIO::StatJob::start(). The containing method DolphinView::statusBarText() is changed to be a method without return value: requestStatusBarText() The new status bar text is instead returned through a new setStatusBarText() signal that will be emitted asynchronously if necessary. The calling code that deals with status bar text is refactored to correctly work despite the new asynchronicity. The helper method calculateItemCount() is moved into requestStatusBarText() and some other code from requestStatusBarText() is moved into a new helper method emitStatusBarText(). The documentation of KIO::KJob::exec() explains why it should be avoided. A reproducible crash is the reason for this commit.
2020-12-16Use setShowOpenOrExecuteDialog(true) with OpenUrlJobAhmad Samir
It makes more sense for a file manager to always ask the user: - whether to execute binaries - whether to open an executable script as text or execute it The openOrExecute dialog from KIOWidgets has a "don't ask again" checkbox, and that setting is also accessible from Dolphin's settings dialog. See the discussion at https://bugs.kde.org/show_bug.cgi?id=429839#c10
2020-12-15Fix access url navigator while creating new tab in filename search viewAnthony Fieroni
BUG: 429628 BUG: 430434 Signed-off-by: Anthony Fieroni <[email protected]>
2020-11-24Allow the openURLJob to run executablesNate Graham
Otherwise, excecutable files like AppImages won't be allowed to launch even if they are correctly marked as executable. BUG: 429603 FIXED-IN: 20.12