Commit graph

7035 commits

Author SHA1 Message Date
Felix Ernst 5c7887a763 Fix rubberband selection on icon in icon view mode
As an unintended side-effect of d9a18b04ea
items would no longer be selected in icon view mode when the selection
rectangle intersected with the item's icon. This commit fixes this.
2023-10-23 14:26:52 +00:00
Kai Uwe Broulik 2de810e6c3 Mention invalid protocol name
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-22 09:11:56 +00:00
Nicolas Fella 7379cf59f6 Remove unused include 2023-10-22 00:13:46 +02:00
Alexander Lohnau c907ef92c1 Port away from KDesktopFileActions::userDefinedServices
This is planned to go away since the only real user being kdesvn and that is ported to a C++ plugin
2023-10-21 07:10:42 +02:00
Nicolas Fella 064b2539de Adapt to KBookmarkManager API change 2023-10-20 16:37:53 +02:00
Felix Ernst c90afc3e88 Replace a deprecated qAsConst with std::as_const 2023-10-19 11:44:59 +02:00
Felix Ernst f38d788a97 Never show status bar context menu away from status bar
The status bar context menu was hard-coded to always appear at the
cursor position. However, context menus can also be triggered by
keyboard, for example with the Menu key, in which case it makes no
sense to show the context menu at whatever random position the
mouse cursor currently is.

Instead invoke the context menu in the middle of the status bar
when it is opened by keyboard.
2023-10-18 08:27:27 +00:00
Amol Godbole a59d9f85fa KItemListView: add view position in scrollToItem()
An item, on being scrolled to, is always located at the nearest edge of
the view. This is not always convenient. Allow specifying where the item
should be positioned with respect to the view in scrollToItem().

BUG: 423884
2023-10-17 15:47:34 +00:00
Felix Ernst 6271ee8a5a Remove new tab shortcut Ctrl+Shift+N
Since https://commits.kde.org/kconfig/782e43f8076e5f4a10111a6b4d2cc6b1741c9798
Ctrl+Shift+N is the standard shortcut for creating a new folder
which leads to a shortcut conflict when this key combination is
invoked in Dolphin.

"New Tab" already has the more popular shortcut Ctrl+T assigned to
it, so Ctrl+Shift+N can simply be removed.
2023-10-16 15:05:23 +00:00
Amol Godbole 2f39eb51b6 DolphinView: get rid of writeStateChanged signal in setActive()
The signal writeStateChanged() was not working because it is not connected
to slotWriteStateChanged() slots when the active view changes. Replace the
signal with direct calls to the slots.

Also, do not delay openRequest signal in DolphinSearchBox::slotSearchTextChanged.
It's no longer required.

BUG: 440366
2023-10-12 09:43:37 +00:00
Nicolas Fella 4199e7ef20 Adapt to new KBookmarksWidgets library 2023-10-07 16:56:15 +00:00
Heiko Becker c4b95a7798 GIT_SILENT Update Appstream for new release
(cherry picked from commit 825804a8a6)
2023-10-07 17:15:56 +02:00
Nate Graham 30a807e44a Merge branch 'master' into kf6 2023-10-05 09:15:35 -06:00
Felix Ernst b58fead9be Add test for accessibility ancestor tree
This is to make sure that all items that can be tabbed to and their
accessible children have the main window somewhere in their
ancestry/ancestor tree.
2023-10-05 12:09:25 +00:00
Felix Ernst 549fad2dae Fix accessibility ancestor tree
Before this commit, KItemListViewAccessible would always return
nullptr as its parent. This meant that accessibility software would
have to guess to which window/hierarchy the KItemListView belongs
to. Guessing shouldn't be necessary here.

This commit makes sure that the KItemListView always returns a
sensible parent in the accessible hierarchy. It does so by
explicitly setting the accessible parent for every KItemListView
after construction in the DolphinView contructor. Since
KItemListView now always knows about its accessible parent, the
accessibleInterfaceFactory can always ask the KItemListView for
that information when constructing the QAccessibleInterfaces.

Fixes https://invent.kde.org/system/dolphin/-/issues/47.
2023-10-05 12:09:25 +00:00
Méven Car 7a6cba7f51 KItemListWidget: make unfocused alternate background slightly lighter 2023-10-05 11:46:47 +00:00
Amol Godbole 4d018e1c3c DolphinViewContainer: Keep search box open when URL is changed
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-10-05 09:43:23 +00:00
Amol Godbole e1de6c3492 DolphinRecentTabsMenu: Fix blank text for closed search tab
The recently closed menu adds a blank item when a search tab is closed.
Add the search term and path to the item text.

BUG: 474999
2023-10-03 00:44:55 -05:00
Méven Car cff402356e DolphinPlacesModel: remove usage of alternativeApplicationName
This is now not needed anymore since `PlacesItemModel::cleanupBookmarks` (now removed) from https://phabricator.kde.org/D9333 has run for on users systems.
2023-09-30 07:15:18 +00:00
Méven Car b6d9cb9949 TerminalPanel: Disconnect signal in destructor only when we have a konsolePart 2023-09-28 13:18:31 +02:00
Marco Savelli d9a18b04ea selection: fix rubberband vertices 2023-09-23 08:36:53 +00:00
Marco Savelli 2a4dd2aa43 selection: select-on-rubberband-on-row as new default
Sets a rectangular, non-full-width rubberband as the new default.
User selection is made wherever the rubberband intersects with the row.
2023-09-23 08:36:53 +00:00
Kai Uwe Broulik 856716e8b6 TerminalPanel: Disconnect destroyed signal in destructor
Otherwise, when QObject cleanup, which runs after our destructor,
destroys the terminalPart, it would call back into us
when we're already half-destroyed.

This trips an assert in Qt "Called object is not of the correct
type (class destructor may have already run)"
2023-09-19 22:43:14 +02:00
Nate Graham 64e40c1d93 Merge branch 'master' into kf6 2023-09-19 08:29:35 -06:00
Oliver Beard 38342ae820 terminalpanel: Improve Konsole missing message
It now forces the pane to fit its height, and will animate on every appearance.
2023-09-16 15:37:17 +00:00
Méven Car 4cbeb81b2b Merge remote-tracking branch 'origin/master' into kf6 2023-09-10 15:24:39 +02:00
Méven Car b58a346be9 Replace qAsConst with std::as_const 2023-09-10 15:19:13 +02:00
Méven Car 5c33e0211f Copy Location: Make sure to export path with native separators 2023-09-10 14:58:36 +02:00
Eric Armbruster a85863befd Add open in split view action
This action is shown only if a single folder is selected. The action
opens the selected folder in the inactive split view (and opens the
split view if necessary).

FEATURE: 465500
2023-09-09 15:45:26 +00:00
Heiko Becker f900801540 GIT_SILENT Update Appstream for new release
(cherry picked from commit 6fe9932a17)
2023-09-09 10:26:40 +02:00
Méven Car 6eb8f9b47a DolphinContextMenu: Use targetUrl in addOpenParentFolderActions
Amends 3aa8cf00ee
2023-09-06 19:10:21 +02:00
Méven Car 3aa8cf00ee Add open containing folder options for files in recentlyused:/ 2023-09-06 14:39:15 +02:00
Amol Godbole 0e4d428e84 DolphinView: Reset scrollbars before changing view mode
When view modes are changed, the scrollbars are not reset. This can
cause the scroll area to be moved out of view after changing the view
mode, making the view unusable. This commit resets the scrollbars.

BUG: 393152
2023-09-05 04:58:05 +00:00
Amol Godbole 385146a1e8 KItemListView: Fix inconsistencies in requiredWidth calculation
Commits d3839617 and 3bf471e0 introduced a few changes to requiredWidth calculation.
This commit makes the calculation of requiredWidth consistent across KItemListView.
2023-09-05 04:58:05 +00:00
Amol Godbole c4bb3db022 Restore the URL when DolphinSearchBox is cleared
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-09-04 07:39:13 +00:00
Amol Godbole 9ba0904013 KFileItemModel: Delay emitting currentDirectoryRemoved() signal
The KCoreDirLister object is modified before KCoreDirListerCache::deleteDir()
returns because the signal currentDirectoryRemoved() is emitted.
This prevents removal of the deleted lister from dirData.listersCurrentlyHolding
in KCoreDirListerCache::forgetDirs() when the tab is closed, which causes the
crash described in the bug. Hence, the signal currentDirectoryRemoved()
is delayed to ensure this does not occur.

BUG: 473377
2023-09-04 00:53:38 -05:00
Méven Car 741bea8324 fix test in FreeBsd KItemListControllerExpandTest::testDirExpand 2023-09-02 17:27:25 +02:00
Méven Car fae5fec964 Add focusOut and focusIn event support for KFileItemListView and update selected widget on focus change 2023-09-02 14:42:54 +02:00
Oliver Beard 012f8a224a k[standard]itemlistwidget: Account for view focus in selection highlight 2023-09-02 07:41:49 +02:00
Méven Car 079f903bc8 Fix a bunch of clazy warnings 2023-08-29 07:18:51 +00:00
Méven Car 0cbc912319 Use KMessageBox::warningContinueCancel when appropriate
This will prevent saving the "Cancel" + "don't show again" result, which is meaningless.
2023-08-28 14:08:53 +02:00
Méven Car b45c57332f Confirmations setting: Add checkbox for ConfirmOpenManyFolders and ConfirmOpenManyTerminals
We have to special handle the values saved as it is interpreted by KMessageBox
2023-08-28 13:59:09 +02:00
Méven Car 1318f16fd7 Clean obsolete ifdefs since dolphin requires KF 5.101+ 2023-08-28 10:36:37 +02:00
Méven Car 46d2d147bf Special case file opening with middle click for executable scripts
Since the first action would launch the script, we can use the first application associated to open the file.
2023-08-24 18:27:23 +02:00
Kai Uwe Broulik 5a7b749f5b KStandardItemListWidget: Render pixmap with explicit dpr
Instead of using the one from QApplication, use the one from the window.
2023-08-23 19:48:05 +00:00
Méven Car ae1980442d Merge branch 'master' into kf6 2023-08-23 18:56:41 +02:00
Felix Ernst 11fb9344c0 Allow to not ask again confirmation when opening 5 or more files or terminal at once
BUG: 473513
2023-08-23 16:54:52 +00:00
Méven Car d27ee07de7 On middle-click, open file with the second application for the file mime
FEATURE: 390631
2023-08-23 12:35:48 +00:00
Méven Car ff852b97f1 Re-Allow to set settings in Settings-> View-> General page
Regressed in 489b56b68b

Simplify implementation by sharing making class ViewSettingsPage implement SettingsPageBase sharing implementation with other tabs in viewsettingspage
2023-08-23 14:26:09 +02:00
Ilya Bizyaev d37cb5eb36
Swap "Open Path in New Tab" and "Open Path in New Window"
Looks like I missed it back in
402f7f3041
— so fixing now :)
2023-08-22 23:22:05 +02:00
Kai Uwe Broulik 21cd9da8fd KItemListView: Use own palette rather than go hunt for the scene
Documentation for `QGraphicsWidget::palette` says:
> When a widget's palette changes, it resolves its entries against its
> parent widget, or if it doesn't have a parent widget, it resolves against the scene.

So I don't see why we would need to do that ourselves.

More importantly, though, it seems in Qt 6 the palette isn't updated in time,
so when changing color schemes, Dolphin picks the old color instead of the new one,
leading to illegible font when e.g. switching between Breeze Light and Dark.
2023-08-20 20:08:58 +00:00
Nicolas Fella b7e859827d Adapt to KNotifcations API change 2023-08-18 20:39:15 +00:00
Dimosthenis Krallis 489b56b68b Dolphin settings revamp
It includes a move of the settings in the Navigation and Startup sections to the Interface (formerly Behavior) section.
It also includes a new tab in the View (formerly View Mode) section, called General where some settings regarding Display style, Browsing and Miscellaneous settings
The Interface section has new tabs named Folders & Tabs and Status & Location bars respectively where most of the Startup and Navigation settings moved.

The `dolphin/kcms/kcm_dolphinnavigation` kcm is removed.
2023-08-18 07:07:48 +00:00
K. Cottonears 1165a1bc52 Set Maximum Tab Width for folders to Tab bar
There is no limit to the width of tabs with the tab bar of the main window. If the directory name is too long, tabs can take up a lot of space and can lead to inconsistent tab widths.

To alleviate this, set a maximum tab bar text width of 40 characters for each folder.

BUG: 420870
2023-08-17 07:22:49 +00:00
Heiko Becker 399309d36c GIT_SILENT Update Appstream for new release
(cherry picked from commit c08f661a2c)
2023-08-16 22:48:35 +02:00
Nicolas Fella 62ba2dd877 Adapt to kbookmarks API change 2023-08-14 23:18:19 +02:00
Méven Car aded2d716d Don't compute size for non-local urls
Hide progressInfo for listDir job on the non-recursize path.

BUG: 472912
2023-08-13 08:44:24 +00:00
Bart Ribbers 32a5f1c041 Fix musl build by using fts_* from external library
musl does not support fts. There is however a standalone package that
can be used, but it must be linked against. This commit adds a check
that makes sure to link to the external library if it is required.
2023-08-11 08:45:13 +00:00
Nicolas Fella 521f4937d5 Merge branch 'master' into kf6 2023-08-10 14:42:08 +02:00
Kai Uwe Broulik fc6fa9ba98 Set Notify flag on close running terminal app prompt
Ensures the warning sound is played.
2023-08-10 14:13:13 +02:00
Kai Uwe Broulik 23b7d64d9c Adjust to changes in KToolBarPopupAction
`menu()` will be null, instead use the provided `popupMenu()`.
Use `KToolBarPopupAction`'s mode enum instead of `QToolBar`'s
2023-08-03 13:26:43 +02:00
Amol Godbole 0dac2ea9e9 Add alternate shortcut for replaceLocation action
Alt + D is a common shortcut for replacing location. Add this as an alternate shortcut.

BUG: 468445
2023-08-03 11:00:51 +00:00
Amol Godbole c1b2605243 DolphinView: initialize m_controlWheelAccumulatedDelta
Ctrl + scroll wheel zoom was not working as designed after Dolphin is launched. Initialize m_controlWheelAccumulatedDelta in DolphinView's constructor. 

BUG: 469354
2023-08-03 10:44:20 +00:00
Steffen Hartleib 89dcef3af4 Enter selection mode by tap-and-holding an already selected item
Allow entering selection mode by touching an already selected item.

BUG: 462778
2023-08-01 10:10:28 +00:00
Amol Godbole 567f2858ac Fix incorrect file selection after file rename
forceUrlsSelection() needs to be called only when new name of renamed
file does not exist.

BUG: 417930
2023-08-01 09:59:57 +00:00
l10n daemon script 2f0369b333 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-28 01:43:52 +00:00
Steffen Hartleib 3123c086a7 Avoid unwanted drag and drop action
Use the screen position for a touch event to calculate the start drag distance.

BUG: 464594
2023-07-27 09:23:07 +00:00
Méven Car 2f36c05b9c Minor code improvement
NO_CHANGELOG
2023-07-27 09:50:28 +02:00
Méven Car a9123455de Update following removing of KIO::FileSystemFreeSpaceJob::result overload
NO_CHANGELOG
2023-07-26 10:13:50 +02:00
Nate Graham 6ae9e38a55 Add contribute link to AppStream metadata
Pointing to the readme file is reasonable enough.
2023-07-18 16:05:18 +03:00
Nicolas Fella c34b2f04fd Replace ServiceItemDelegate with standard Qt item delegate
We don't need a custom delegate here

Using the standard one from Qt also slightly improves margins
2023-07-09 00:21:42 +02:00
Nicolas Fella 31a8866ac0 Fix usage of Qt::CheckStateRole in preview model
Qt::CheckStateRole expects an enum, not a bool

Also set the flag that the item it user checkable, otherwise it can't be changed

BUG: 471999
2023-07-09 00:11:23 +02:00
Nicolas Fella 88ebcd42db Fix plugin query
QT_MAJOR_VERSION is undefined, the proper thing is QT_VERSION_MAJOR

This causes the plugin query to not find any plugins

Since we only target KF6 we might as well hardcode that
2023-07-08 22:42:32 +02:00
Nicolas Fella f60628cdfa Fix konsolepart lookup
The location changed for KF6
2023-07-07 11:53:39 +02:00
Nicolas Fella 49f9a28f4a Always enable panel dockwidget actions
Otherwise they are disabled when the docks are locked and panels can't be toggled

BUG: 471974
2023-07-05 23:14:43 +02:00
Nicolas Fella f510339f03 Merge branch 'master' into kf6 2023-07-05 22:44:40 +02:00
Friedrich W. H. Kossebau ed2d352c42 Add explicit moc includes to sources for moc-covered headers
* 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-07-05 07:59:18 +00:00
Tem PQD 4d930992c4 Use ellipsis everywhere instead of three dots
Better for screen readers etc.
2023-06-29 22:42:34 +00:00
Heiko Becker cf3a570afc GIT_SILENT Update Appstream for new release
(cherry picked from commit e3ad78194c)
2023-06-30 00:10:33 +02:00
Felix Ernst 0bf439833c Move focus from hiding selection mode bars to view
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-28 16:35:56 +00:00
Méven Car cd2e64154f Merge branch 'master' into kf6 2023-06-28 09:49:46 +02:00
Tem PQD b92bb43e9d Fix Refresh tooltip text and add Refresh whatsThis text
BUG: 469263
2023-06-26 19:32:00 +00:00
l10n daemon script 7458d21bb7 GIT_SILENT made messages (after extraction) 2023-06-25 00:55:37 +00:00
Volker Krause dcd5c994bb Use non-deprecated Phonon includes 2023-06-20 19:44:19 +02:00
l10n daemon script 2fb1fc1d5c GIT_SILENT made messages (after extraction) 2023-06-20 00:56:01 +00:00
Méven Car 7f3967cf38 Hide application/x-trash files following showHidenFiles
BUG: 3212
2023-06-17 07:09:50 +00:00
l10n daemon script 51fcd600a8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-16 01:40:55 +00:00
Méven Car cf14a888ce Tabbar: duplicate tab when double clicking on it
BUG: 470388
2023-06-13 09:48:55 +00:00
Méven Car 3338c2834a Settings Add ViewModes > Content display
This does not move the settings location in files though.

baby step for https://invent.kde.org/system/dolphin/-/issues/36
2023-06-13 09:40:27 +00:00
Alexander Lohnau 3d0c946eef Adjust KCMs to no longer do cast manually
KCModule::widget returns the widget that should be a parent for widgets the KCM creates
2023-06-10 10:26:58 +02:00
Felix Ernst e5abe2c67b Update my eMail to the KDE-provided one
GIT_SILENT
NO_CHANGELOG
2023-06-04 18:09:42 +02:00
Heiko Becker 05e99b3dd1 GIT_SILENT Update Appstream for new release
(cherry picked from commit db3c01a34a)
2023-06-02 20:44:17 +02:00
Nicolas Fella 1c393f50d5 Only use KStartupInfo on X11 2023-05-31 12:43:57 +00:00
Méven Car c17e6c8d2b Expand or collapse all selected folders on Key Right/Left
CCBUG: 196772
2023-05-26 16:10:38 +00:00
Méven Car a1c5c5cf81 KDirectoryContentsCounter: show intermediate dir size counting results, improve stopping, improve data caching
Two user visible changes:
 * we can see the dir size changing as it is updated.
 * This makes the file counting a lot more reactive, when changing directories for instance.

`KDirectoryContentsCounterWorker::walkDir` is not recursive anymore.

The cache is now shared and only a single thread is used to count size recursively.
2023-05-26 15:10:09 +00:00
Méven Car ee8b71e556 Revert "Restrict attaching instances to those on the same activity or same virtual desktop"
This reverts commit b99f6f50ee.

BUG: 408919

Reintroduces:
CCBUG: 408919
2023-05-24 10:11:41 +00:00
Méven Car b01329bf36 Revert "global.cpp: Ensure qApp does not emit signal because of local QEventLoop"
This reverts commit dec80fb0f9.
2023-05-24 10:11:41 +00:00
Méven Car dec80fb0f9 global.cpp: Ensure qApp does not emit signal because of local QEventLoop
BUG: 469656
2023-05-19 15:31:42 +00:00
Jakob Petsovits b5b6762b15 Bring back the "Create New" menu in the menu bar
This commit is the result of a three-way diff that
combines my own initial patch with related changes from
Felix Ernst's MR !545 and further suggestions by Méven Car.

Fixes DolphinMainWindowTest::testNewFileMenuEnabled().
Tests are now passing again for my build.

"Create New" was broken by commit c64059bd which switched to the
new, non-deprecated KNewFileMenu constructor (kio commit 89bc6bad)
that doesn't add itself to the passed KActionCollection parameter.
After the switch, hamburger menu and context menu was still working
as intended but the menu bar was missing the "Create New" menu.

This commit adds the addAction("new_menu") call to the File menu
setup that would have previously been called by the deprecated
KNewFileMenu constructor. The corresponding test can now find
the QObject for the menu's named action again, verifying its
existence and enabled-ness like it did before.

The DolphinNewFileMenu constructor's unused actionCollection
parameter serves no use anymore except to confuse people.
We replace it with a single QAction* parameter, createDirAction,
which gets passed to setNewFolderShortcutAction().

2 out of 3 constructor call sites have access to this action,
while the remaining call site in dolphinmainwindow.cpp must wait
until after it has been initialized by DolphinViewActionHandler.
In this case, setNewFolderShortcutAction() is still called manually
at a later time.
2023-05-16 11:11:51 -04:00
Jakob Petsovits 1b0caf69a8 Remove deprecated, ifdef'd code for old KIO versions 2023-05-12 16:56:36 -04:00