Commit graph

770 commits

Author SHA1 Message Date
Nate Graham c161b895ff Merge branch 'release/20.12' 2021-01-25 10:25:51 -07:00
Harald Sitter 5ed12ed44a don't crash when building without baloo
show_information_panel is only created when building with baloo. only
access it when built with baloo, otherwise always report the panel as
off.

this fixes a nullptr deref because action() would return a nullptr since
show_information_panel isn't a thing in all build configurations

(full disclosure: I can't reproduce the crash, nor did I build without
baloo)

BUG: 431730
2021-01-25 10:12:53 +01:00
Anthony Fieroni a73e81bf6a Open new tab placement option
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2021-01-10 21:54:45 +00:00
Felix Ernst f01a61b76c Animate split view mode toggling
Have the secondary ViewContainer slide into/out of view when split view mode is switched on or off by the user.

This should help users understand what split view mode is about. Without the animation it might seem like the only thing the button does is creating a weird vertical line in the middle of the view or something. With the animation it should be clear that the second view is a separate entity that was added. The closing animation will help users understand which of the ViewContainers was just closed.
2021-01-02 17:48:52 +00:00
Piotr Henryk Dabrowski a19469d83d use 'compass' instead of 'bookmarks' icon in Show Places Panel button
'bookmark' icon is already used for Bookmarks Menu
2020-12-30 00:05:49 +01:00
Duong Do Minh Chau 238eb86db7 Share actions with main window to avoid duplicating icon name and text 2020-12-28 20:18:31 +00:00
Eike Hein b339ac1b5f Use a faster way to determine kio-stash isn't installed
Summary:
Dolphin needs to figure out whether or not kio-stash is installed
to set the enabled state of a UI action.

When KProtocolInfo::isKnownProtocol can't find a protocol it gets
worried its protocol cache might be out of date, so it rebuilds it
(doing plenty of disk I/O) and looks again. kio-stash is currently
not yet installed on many systems, so this means most Dolphin
startups out there.

This patch switches to using QDBusConnectionInterface::isServiceRegistered
instead to determine whether the stash notifier daemon is running,
which should be faster than doing disk I/O.

Reviewers: davidedmundson, elvisangelaccio, shortstheory

Subscribers: emmanuelp, alexeymin, ngraham, #dolphin

Differential Revision: https://phabricator.kde.org/D9094
2020-12-28 17:59:14 +01:00
Ahmad Samir d74853ef85 Merge branch 'release/20.12' 2020-12-16 23:53:57 +02:00
Ahmad Samir c03b43b4a1 Use setShowOpenOrExecuteDialog(true) with OpenUrlJob
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-16 23:51:06 +02:00
Alexander Lohnau 20370b4c9f Do not create instance of GeneralSettings just to access static members 2020-12-11 20:06:51 +01:00
Laurent Montel d2f044b32d operator+/- is disabled for QFlags in qt6 2020-12-09 07:55:44 +01:00
Elvis Angelaccio c4a1903dd1 Add missing const 2020-12-05 16:58:04 +01:00
Méven Car 60b9eaa4c1 Toolbar: move and rename filter to edit menu above Search
This is to expose more filter.
Also rename "Show Filter Bar" to simply "Filter", keep "Show Filter Bar" as tooltip

Adds a toggle filter bar action.
2020-12-02 07:07:41 +00:00
Nate Graham f46e630dda Merge branch 'release/20.12' 2020-11-20 11:32:49 -07:00
Felix Ernst 50ca5af7e0 Allow having the UrlNavigators below the tab bar
This commit restores the possibility to have the UrlNavigators below
the tab bar. This will happen automatically whenever the UrlNavigator
is removed from the toolbar.

It is also now again possible to have the toolbar on the side. This
option is disabled while the toolbar contains the UrlNavigators.

This commit makes no changes to the new default which is having the
UrlNavigators in the toolbar but makes sure that upgrading users won't
be affected.
2020-11-19 21:22:27 +00:00
Alexander Lohnau 154843406d Different icon to launch Konsole terminal 2020-11-18 18:59:04 +00:00
Felix Ernst 2d4d2ce9a1 Adress most of the second round of Angelaccio's review comments
This commit applies most suggestions which were made on the MR.
Most notably the DolphinUrlNavigator class is split up which leads to
the creation of a DolphinUrlNavigatorsController class.

Additionally some minor coding style and const correctness changes are
included.

The error value of cached integers is changed from -1 to INT_MIN
because situations could come up in which -1 would be a valid value.
2020-11-09 23:49:07 +01:00
Felix Ernst 4202383137 Apply Méven Car's suggestions 2020-11-09 23:49:07 +01:00
Felix Ernst a418d6229e Fix a crash and extract unrelated changes
The secondary UrlNavigator is now created when and only when:
- split view mode is activated for the active tab
OR
- switching to a tab that has split view already enabled.
This fixes a crash that occurs when the setting to always start in
split view mode is enabled.

An animation for activating split view is also removed from this and
moved into a separate MR. Another unrelated name change left over from
a previous commit (viewContainers() -> activeViewContainers()) is
dropped.
2020-11-09 23:49:07 +01:00
Felix Ernst 37327c9b0a Make UrlNavigators in the toolbar the only option
The UrlNavigators will be automatically added to the toolbar. The Sort By
action is removed from the default toolbar to make space.

Remove all options to have UrlNavigators outside the toolbar and remove
those code paths.

Make it so the new NavigatorsWidgetAction contains two UrlNavigators when
in split view mode. Spacing was also added to align these UrlNavigators
with the ViewContainers when enough space is available.

Force the toolbar to be either at the top or bottom of the window.

Set a sane sizeHint for DolphinUrlNavigator. It would be better to do this
in KUrlNavigator in the future.

This commit also contains a changes which should be moved to a separate
merge requests before this gets merged:
- Add an expansion animation when split view is enabled by the user
2020-11-09 23:49:07 +01:00
Felix Ernst 6151a7aec0 Add the UrlNavigator to the toolbar automatically if needed
This commit adds the DolphinUrlNavigatorWidgetAction::addToToolbarAndSave()
method which changes the users toolbar configuration to contain an
Url Navigator. This way the user doesn't need to do anything manually.

Aside from that a bunch of minor fixes like renaming and reordering
2020-11-09 23:49:07 +01:00
Felix Ernst b6fc58c3c3 Adress the first round of Angelaccio's review comments
- Split the viewContainers(bool includeInActive) into two methods
    without parameters
- Prevent users from accidently hiding all Url Navigators by
    preventing the dangerous action and then displaying a helpful
    message instead
Unrelated to review comments: Remove a useless line of code
2020-11-09 23:49:07 +01:00
Felix Ernst 00abc6d280 trailing whitespaces 2020-11-09 23:49:07 +01:00
Felix Ernst ad5d3367c7 Add an option to use an UrlNavigator in the toolbar instead
This commit adds a locationInToolbar KToggleAction to switch between
using a location bar to navigate or using a new custom QWidgetAction
in the toolbar.

A big portion of this MR is refactoring because until now the
UrlNavigator was tightly intertwined with the DolphinViewContainer.
With this MR an UrlNavigator for controlling a View can be freely
connected or disconnected with a single method call.

A DolphinUrlNavigator class is created in the process which contains all
Dolphin-specific UrlNavigator code which did previously reside in the
DolphinViewContainer class. Other application parts that belong to
UrlNavigator-management are also moved here.
2020-11-09 23:49:07 +01:00
Elvis Angelaccio 465e06138e Add support for KUserFeedback
This commit introduces KUserFeedback in dolphin with some basic data
sources and with a settings page to configure the telemetry values.

There are also a couple custom data sources as proof of concept: a bunch
of settings and the count of available network shares as listed by Solid.

The settings page is shown only if the user feedback framework is
enabled, but currently in Plasma we don't have a global kill switch to
disable it.

At the moment we never show an encouragement message. We need to connect
to the `Provider::showEncouragementMessage()` signal, but first we
should agree to a common way to show a non-annoying message to the users.
2020-11-05 18:31:28 +00:00
Alexander Lohnau 97415729c3 Compile with QT_NO_KEYWORDS 2020-10-23 18:23:06 +00:00
Alexander Lohnau a24327cd50 Compile without foreach 2020-10-23 18:23:06 +00:00
Nate Graham c733b3aa97 Don't session-restore invalid paths
When session restore is populating the main window, it's unconditional;
you'll get whatever was there before. This can be a problem if any of
those things are now missing. For example, maybe you were browsing files
on a removable disk, then quit Dolphin, and finally removed the disk. The
next time you launch Dolphin again, it will try to show you the
view from the now-missing removable disk.

To prevent this, we now look at all the URLs in all of the view
containers that were created after session-restore has finished doing
its thing; if any of them are invalid local URLs, we change the URL to
the home folder instead to avoid showing the user a view with an invalid
location in it.

BUG: 427619
FIXED-IN: 20.12
2020-10-23 17:00:09 +00:00
Nate Graham ae1d441dac Show home folder if needed after unmounting mounted disk
Right now, when you unmount a device that any active view containers are
displaying, nothing in the view changes. As a result, it's possible to
try to navigate to files or folders in that view, which cannot be done
because the disk that the files or folders are located on has been
unmounted!

With this commit, we detect that case and switch the view containers
to show the home folder after the disk whose contents they are displaying
gets unmounted.

BUG: 158934
FIXED-IN: 20.12
2020-10-23 17:00:09 +00:00
Nate Graham 1501825d44 Fix DolphinMainWindow::viewContainers() to take into account split views
The function was previously assuming that each tab view has exactly one
view container, which is not necessarily accurate; some could have a
split view open.
2020-10-23 17:00:09 +00:00
Laurent Montel 47a5071fc9 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:43:43 +02:00
Nate Graham 462982faa3 Merge branch 'release/20.08' into master 2020-10-05 15:19:04 -06:00
Nate Graham 6cf628cbd0 Don't warn when closing multiple tabs if restoring window state
When we're using the "restore window state" feature, there's no need to
warn when closing multiple tabs, because they're saved and you can just
re-open the window.
2020-10-03 09:39:16 -06:00
Ahmad Samir 9b83378c08 Check protocol Class before creating a StatJob
StatJob::mostLocalUrl only works with ":local" protocols, adjust the code
accordingly.

Make the code async.

Remove activeContainerLocalPath() method as it isn't needed anymore.

Drive-by change: minimum required version of Qt should be 5.12 because
that's what KF >= 5.73 already requires.
2020-09-20 21:29:23 +00:00
Steffen Hartleib d7b33b76a1 Improve Touch support
With this patch dolphin now supports the following touch gestures:

* Tap gesture to interact/open with directories, files and so on
* TapAndHold and release gesture for access to the context menu (main window, panel folder, places and information)
* TapAndHold and moving gesture for drag and drop action (main windows, panel folder and places)
* pinch gesture for zoom in main window
* kinetic scrolling (QScroller) for main window, panel folder, panel places, panel information, setting preview and service
* two fingers swipe gesture to left, right and up as shortcut to navigate back, forward and up
* two finger tap gesture to toggle item selection, similar to Ctrl and left mouse click

FEATURE: 385066
FIXED-IN: 20.11.80

 You are currently rebasing branch 'touch' on '85241a924'.
2020-09-13 18:53:32 +00:00
Alexander Lohnau 8d7775b174 Allow Open Terminal action on Windows 2020-08-31 08:21:59 +00:00
Nikita Churaev 7c2559dd0b Text style fixes 2020-08-26 03:37:31 +03:00
Elvis Angelaccio 954e8c4790 Output of licensedigger + manual cleanup afterwards.
Unfortunately licensedigger does not strip the trailing * characters.
While at it, use a common style for all source files.
2020-08-25 17:07:38 +00:00
Ahmad Samir 257eeebf4b Port KRun to OpenUrlJob
In DolphinMainWindow, since KRun allows running executables by default, use
setRunExecutables(true) so as not to change the behaviour.

Remove the now redundant slotHandleUrlStatFinished, that whole StatJob
logic is now handled by OpenUrlJob.

Bump KF required version to 5.73, since that's where
OpenUrlJob::setShowOpenOrExecuteDialog was introduced.
2020-08-18 08:43:58 +00:00
Yann Holme-Nielsen 86e3b82efb ## Summary
* Adds a "Copy location" item, after the "Copy" Context item and Edit Menu, which will attempt to copy the path of the fist item into clipboard.

## Reasoning
Most File Managers have this option through one or another way.
Also using the default Copy option often results in different behaviour depending on the target software, Konsole will take the path. Other Programs will use the URI. Which ultimately could lead to non optimal User Experience.

## Notes
* Should the target file **not** be on a local hard drive, this fallback to using the remote URL, feedback is wanted on that matter.

FEATURE: 407004
2020-06-29 22:27:33 +00:00
Nate Graham b6700f77dd Merge branch 'release/20.04' 2020-05-24 08:26:34 -06:00
Piotr Henryk Dabrowski 29e6cf01df use KSycoca for updating OpenPreferredSearchTool action
Summary:
Remove all random updates of OpenPreferredSearchTool action, and
use KSycoca for updating it as discussed in https://phabricator.kde.org/D22594#663847

Enhancement for D29441 for bug #420911 caused by D22594.
The bug was fixed by D29442.

CCBUG: 420911

Test Plan:
```
$ cd ${KDE_INSTALL_DIR}/usr/share/applications

$ sudo mv org.kde.kfind.desktop org.kde.kfind.desktop_
$ kbuildsycoca5

$ sudo mv org.kde.kfind.desktop_ org.kde.kfind.desktop
$ kbuildsycoca5
```

Reviewers: broulik, elvisangelaccio, ngraham, #dolphin

Reviewed By: elvisangelaccio, #dolphin

Subscribers: anthonyfieroni, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D29568
2020-05-24 08:26:25 -06:00
Antonio Prcela a291c59990 Allow to copy or move selection to the other split view
Summary:
FEATURE: 276167

Default keyboard shortcuts set to `SHIFT+F5` for `copy`, `SHIFT+F6` for `move`

Reviewers: #dolphin, elvisangelaccio, ngraham, meven, dfaure

Reviewed By: #dolphin, elvisangelaccio, ngraham, meven, dfaure

Subscribers: yurchor, kde-doc-english, dfaure, meven, kfm-devel

Tags: #dolphin, #documentation

Differential Revision: https://phabricator.kde.org/D29006
2020-05-14 16:20:14 -06:00
Elvis Angelaccio 42148dd356 DolphinView: rename cutSelectedItems to cutSelectedItemsToClipboard
For consistency with d1a70c0b62.
2020-05-11 22:54:08 +02:00
Elvis Angelaccio d1a70c0b62 DolphinView: rename copySelectedItems to copySelectedItemsToClipboard
This makes it explicit that this is just a copy to clipboard, so that
we can use the name for an actual KIO::copy().
2020-05-11 19:31:29 +02:00
Kai Uwe Broulik 37deaaef2c Merge branch 'release/20.04' 2020-05-06 10:52:38 +02:00
Kai Uwe Broulik 801fdf4c59 Don't update preferred search action on window activation
I don't see why this is necessary and causes a blocking(!) StatJob every single time the window is focussed,
worse, ends up in an infinite loop when the window loses focus on an auth prompt.

CCBUG: 420911

Differential Revision: https://phabricator.kde.org/D29441
2020-05-06 10:52:09 +02:00
Kai Uwe Broulik ecede34048 Merge branch 'release/20.04' 2020-05-05 12:05:49 +02:00
Kai Uwe Broulik 9f268f5f76 Don't use local URL for KMoreTool
This method is called a billion times and spawns a blocking(!) StatJob.
KFind can search local URLs, too, so I don't see why this is necessary.
Either way, I'd rather have a non-KDE search tool broken than the app.
Ideally, I'd like this entire thing redone to use an async StatJob, if any.
Fwiw the KMoreTools in the free space bar doesn't use a local URL either.

BUG: 420911
FIXED-IN: 20.04.1

Differential Revision: https://phabricator.kde.org/D29442
2020-05-05 12:05:18 +02:00
Nate Graham caf2fe1c43 Add an option to show tabs from last time when Dolphin starts
Summary:
All modern web browsers offer a function to show tabs from last time when a browser starts, and many apps today
restore their prior state when they're launched. This patch implements thatfunctionality as an option and turns it on by default.

The settings window is accordingly adjusted to be clear about what applies when:

{F7681752}

FEATURE: 413564
FIXED-IN: 20.08.0

Depends on D25106
Depends on D25219

Test Plan:
With the new setting turned off:
- No behavioral changes at all

With the new setting turned on:
- When launched from the GUI or CLI without any URLs, dolphin restores session
- When rebooting with Dolphin open, it restores session normally after the system comes back (i.e. no behavioral change here)
- When launched with URLs, Dolphin window is opened showing those URLs instead of restoring session
- When Dolphin is already running and a new window is opened, that new window shows a single tab with the same URL as was visible in the previously-open Dolphin instance (i.e. no behavioral change here)
- "Open Containing folder" functionality in other apps works regardless of whether or not Dolphin is running

Reviewers: #dolphin, #vdg, feverfew, meven, elvisangelaccio, ndavis

Reviewed By: #dolphin, #vdg, feverfew, elvisangelaccio, ndavis

Subscribers: davidedmundson, ndavis, intika, feverfew, kfm-devel, ngraham, broulik, #dolphin

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D11382
2020-04-26 12:14:56 -06:00