Commit graph

33 commits

Author SHA1 Message Date
Andrey Yashkin 9d4c75d2f7 Fix an issue with a new tab focus
Summary:
When opening a new tab in the background and switching to that tab the focus is set on the location bar instead of the files view. If you switch back to the original tab and then to the new tab again focus will be set on the files view. The problem is caused by creation of //DolphinTabPage// in an active state which leads to skipping by //return// in //DolphinView::setActive(bool active)// without setting the focus on the view. This patch fixes this defect.

BUG: 407604
FIXED-IN: 19.11.80

Test Plan:
1. Open a new tab in the background
2. Switch to the new tab
3. Check current focus widget by the up/down arrows on the keyboard with and without changes.

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: ngraham

Subscribers: anthonyfieroni, ngraham, elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D22386
2019-07-28 16:18:17 +02:00
Alexander Saoutkin 27e3907a3d Open externally called files/directories in new tabs
Summary:
FEATURE: 183429
FIXED-IN: 19.08.0
GUI: new cli argument --new-window

Externally called files/directories are opened in a a new tab of an instance of Dolphin that already exists. If any of the given URIs are already open in a tab, then those tabs are activated instead of a new tab being opened.  If there is no instance then the files/directories are opened in a new window. The newly opened file/directory has its tab activated, and consequently, the window is also activated.

When the user clicks "Open In New Window" or "Detach Tab", the files/directories are opened in a new window.

Test Plan:
[Manual]
Before testing, set the default file manager in system settings as the newly built Dolphin executable.
One must also include the new dolphin executable in the $PATH, otherwise some functions will attempt to open the system dolphin instead of the new one.

Furthermore, running two different versions of Dolphin (in particular, where one does not have this patch included) can result in bugs appearing, in particular, new tabs not opening as old instances will not recognise the DBus commands sent to it. However, I see no reason why a user will have two different versions of Dolphin (apart from people like us :D).

Open directories with the help of auxillary programs (i.e. a browser). The files/directories should appear in a new window if an instance does not exist. If an existence already exists, then a new tab should be opened and activated in that instance and the window activated.
Use QDBusViewer to open folders/items by calling the ShowFolders/ShowItems methods in org.freedesktop.FileManager1 of the Dolphin instance.
When a user chooses to "Open In New Window"/"Detach Tab" then the files/directories should be opened in a new window.

Reviewers: #dolphin, elvisangelaccio

Subscribers: zzag, dfaure, fvogt, fikrim, magar, fbg13, davidedmundson, kwin, ngraham, elvisangelaccio, anthonyfieroni, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D16648
2019-05-30 22:40:08 +02:00
Nate Graham 2907a34bb5 Merge branch 'Applications/19.04' 2019-05-20 07:15:05 -06:00
Nate Graham d863dd9ad4 Elide tab titles left so key information at the end of the string doesn't get cut off
Summary:
Tab Titles currently elide right. Generally the more useful information is at the right
side of the string--even more so when full paths are being used.

BUG: 406569
FIXED-IN: 19.04.2

Test Plan:
- No change when tab titles don't get elided
- When tabs show the full path and titles are elided, they're now useful: {F6782447}
- When tabs don't show the full path and are elided, they're elided on the other side which seems maybe a tiny bit better, but at least no worse: {F6782448}

Reviewers: #dolphin, #vdg, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: ndavis, elvisangelaccio, kneckermcknacksack, filipf, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D20689
2019-05-20 07:14:49 -06:00
Elvis Angelaccio 9d11e5d4b4 Get rid of ugly static_cast usages in connect() calls 2019-05-05 17:53:29 +02:00
David Hallas 17af8ae0ad New tab should be placed after the current tab
Summary:
When opening a new using the context menu the new tab should be placed
after the currently open tab, not at the end of the tab list.

BUG: 403690

Test Plan:
Open multiple tabs and select a different tab than the last one.
Open a new tab using the context menu and see that it opens after the currently
selected tab.
Open a tab using Ctrl+T and see that it opens at the end.

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: elvisangelaccio, ngraham, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D18945
2019-02-16 16:51:44 +01:00
Nate Graham b7ceb51b44 After opening and switching to a new tab, always focus the view
Summary:
When Dolphin opens a new tab and immediately switches to it, the URL navigator gets focus if it's editable. If it's not, the breadcrumbs bar gets keyboard focus, which is not very useful since it's not really intended for keyboard navigation.

This patch changes that behavior so that the view always gets focus, which seems more useful and more consistent.

BUG: 401899
FIXED-IN: 19.04.0

Test Plan:
1. Put the URL navigator into breadcrumbs mode
2. Open a new tab
3. Observe that the view gets keyboard focus
4. Put the URL navigator into editable mode
5. Open a new tab
6. Observe that the view still gets keyboard focus

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: emateli, elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D17635
2019-01-29 06:33:27 -07:00
Alexander Saoutkin ac118ae1c2 Close Dolphin if last tab closed
Summary:
Allows closing of last tab via shortcut or menubar (File->Close Tab), which then results in closing dolphin.

FEATURE: 397101

Test Plan: [Manual] Check closing tab closes dolphin via shortcut and menubar.

Reviewers: #dolphin, ngraham, #vdg, elvisangelaccio

Reviewed By: #dolphin, ngraham, #vdg, elvisangelaccio

Subscribers: thsurrel, svenmauch, abetts, elvisangelaccio, ngraham, #dolphin, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D15278
2018-10-27 11:24:49 +02:00
David Hallas aaaaea8e28 Renames DolphinViewContainer::getCaption to caption
Summary:
This commit renames the DolphinViewContainer::getCaption to simply
caption, this was a review comment that I failed to fix in a previous
commit.

Test Plan: None

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D15114
2018-09-02 11:11:41 +02:00
David Hallas 5a9567730d Changes the tabName function to return the name of a specific tab
Summary:
Changes the tabName function to return the name of the passed in
DolphinTabPage. Previously it would return the name of the active tab,
which causes in-active tabs to get the wrong name.

Test Plan:
Open Dolphin
Right click a folder and select 'Open in new tab'
Notice that the new tab has the wrong title

BUG: 397910

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D15112
2018-09-02 11:08:15 +02:00
David Hallas 44a21ea51a Unify window and tab title
Summary:
Previously the title of tabs was a prettyfied version of the URL.
This is inconsistent with the title of the Window and in some cases
for specials URLs kind of misleading. This commit generalizes the
code from DolphinMainWindow so that both the DolphinMainWindow title
and the tab title uses the same function for the title. This also
means that the 'Show Full Path in Title Bar' also applies to the
tab title, and also that searches changes the tab title.

FEATURE: 387851

Test Plan: Open a new tab from the places panel and navigate around.

Reviewers: #dolphin, ngraham, elvisangelaccio, markg

Reviewed By: #dolphin, ngraham, markg

Subscribers: markg, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D14442
2018-08-24 12:09:26 +02:00
Nathaniel Graham b12a7b0f24 Add more tab access functions
Summary: These new functions to access the next and previous tabs are not used by anything yet, but it is envisioned that they would be useful for a variety of purposes--such as the "open path in new tab" feature from D11703

Test Plan: Dolphin still compiled and runs; new code is not actually used anywhere

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Differential Revision: https://phabricator.kde.org/D12039
2018-04-09 17:00:47 -06:00
Elvis Angelaccio 2523442d4d Revert "Fix some compile warnings"
This reverts commit 533f050855.

D10995 has not been approved.
2018-03-05 21:56:15 +01:00
Roman Inflianskas 48b58f830a Remove unused #include
Summary: I used CLion inspection to hunt all unused #include

Reviewers: #dolphin, elvisangelaccio, markg

Reviewed By: #dolphin, elvisangelaccio, markg

Subscribers: bcooksley, markg, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10985
2018-03-04 21:00:47 +03:00
Roman Inflianskas 533f050855 Fix some compile warnings
Reviewers: #dolphin, markg

Reviewed By: markg

Subscribers: elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10995
2018-03-04 10:27:31 +03:00
Elvis Angelaccio c3de867622 Fix drop menu position with urlnavigator drops
Commit 1e251d2f6a in kio broke drop menus when dropping on the URL
navigator (menus show up in the DolphinView rather than the URL bar).
This happens because in DolphinView::dropUrls() we set `this` as the
widget passed to KJobWidgets::setWindow() (in DragAndDropHelper::dropUrls()).

We need to replace `this` with the actual widget that received the QDropEvent
and that can mapToGlobal() the relative pos of the drop event.
Unfortunately this widget is not KUrlNavigator itself, but one of its
KUrlNavigatorButton children (private class, not exported). So
unfortunately we need a new API in KIO that exposes this child widget.

Differential Revision: https://phabricator.kde.org/D6684
2017-07-27 15:49:52 +02:00
Anthony Fieroni 43da84eefc Correct searchbox, split view transitions between tabs
Differential Revision: https://phabricator.kde.org/D5864

BUG: 379135
BUG: 380032
FIXED-IN: 17.04.2

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2017-05-22 20:35:29 +03:00
Martin T. H. Sandsmark 6af0dad2ee Fix updating of new item menu when changing tabs
Correctly set the active status of views when changing tabs.

Before: Right click in home folder, see create new enabled, open tab, go
to /usr, right click and see it is disabled, switch back to first tab
and right click, and it is still disabled.

After: It is enabled and disabled as appropriate when switching tab.

REVIEW: 129664
2016-12-28 13:49:37 +01:00
Artur Puzio 5593c252e8 [CLAZY] Fixed all level 1 and level 2 warnings with small exceptions
REVIEW: 126771
2016-03-16 22:17:37 +01:00
Emmanuel Pescosta 4d6cd761d8 Fix detach tab not working when path contains spaces.
BUG: 352420
FIXED-IN: 15.08.3
REVIEW: 125587
2015-10-21 13:45:01 +02:00
Emmanuel Pescosta 5acfb27760 Simplify startup split view handling
* Instead of setting and resetting GeneralSettings's split view option, just pass it on to openFiles/openDirectories.
* Require at least one url in openFiles/openDirectories

REVIEW: 123395
2015-04-27 12:55:53 +02:00
David Faure 7bd5bec219 Dolphin: port from KonqOperations::doDrop to the new KIO::DropJob
REVIEW: 121678
2015-01-05 09:07:10 +01:00
Arjun AK 1d7b3b8df5 Fix KUrl -> QUrl porting error
Trailing slashes should be removed before calling QUrl::filename(),
else it will return an empty string.

BUG: 341411
REVIEW: 121293
2014-12-01 17:31:39 +05:30
Lukáš Tinkl a8b39ff601 address 2 more KUrl -> QUrl issues mentioned in rr#120688 2014-10-21 22:02:26 +02:00
Lukáš Tinkl 1b4572dac9 port Dolphin from KUrl to QUrl
REVIEW: 120688
2014-10-21 21:19:14 +02:00
Lukáš Tinkl d9d7926c49 port Konqueror from KUrl to QUrl
REVIEW: 120650
2014-10-21 00:28:58 +02:00
Luca Beltrame 39cfd051ef Merge branch 'master' into frameworks 2014-09-10 10:08:20 +02:00
Emmanuel Pescosta c19c4590cf Set the focus to the active view if the current tab has been changed.
BUG: 338892
FIXED-IN: 4.15.0
REVIEW: 120125
2014-09-10 09:41:17 +02:00
Emmanuel Pescosta d4fb129710 Merge branch 'master' into frameworks
Conflicts:
	dolphin/src/dolphinmainwindow.cpp
	dolphin/src/dolphinmainwindow.h
	dolphin/src/dolphinrecenttabsmenu.cpp
	dolphin/src/dolphinviewcontainer.cpp
	kfind/CMakeLists.txt
2014-08-22 23:17:02 +02:00
Emmanuel Pescosta 2d2d55f3df Save the view states in addition to the view urls and splitter state in DolphinTabPage.
Also added version numbers to view and tab state.

REVIEW: 119792
2014-08-20 23:06:39 +02:00
Emmanuel Pescosta 39d8fb12c1 React on the redirection signal from DolphinView to properly update the tab and window titles.
REVIEW: 119697
BUG: 305721
2014-08-13 22:06:28 +02:00
Emmanuel Pescosta 62418c58a5 Use DolphinTabPage saveState/restoreState to remember and re-open closed tabs.
REVIEW: 118968
2014-08-13 20:50:36 +02:00
Emmanuel Pescosta 38381bc6a2 Implemented DolphinTabWidget class to encapsulate the tab handling from DolphinMainWindow.
REVIEW: 119115
2014-08-10 18:52:06 +02:00