2020-08-25 17:07:38 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2007 Peter Penz <peter.penz19@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
#ifndef DOLPHINVIEWCONTAINER_H
|
|
|
|
#define DOLPHINVIEWCONTAINER_H
|
|
|
|
|
2019-01-15 17:47:27 +00:00
|
|
|
#include "config-kactivities.h"
|
2020-06-14 14:20:02 +00:00
|
|
|
#include "dolphinurlnavigator.h"
|
2018-03-04 13:38:16 +00:00
|
|
|
#include "views/dolphinview.h"
|
|
|
|
|
|
|
|
#include <KFileItem>
|
2011-02-04 14:43:21 +00:00
|
|
|
#include <KIO/Job>
|
|
|
|
#include <KUrlNavigator>
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2010-10-10 17:11:55 +00:00
|
|
|
#include <QElapsedTimer>
|
Show "Empty Trash" button inside trash directory
Summary:
Show "Empty Trash" button inside trash directory.
FEATURE: 163306
Test Plan: {F5734949}
Reviewers: ngraham, rkflx, markg, elvisangelaccio
Reviewed By: ngraham, markg, elvisangelaccio
Subscribers: markg, emateli, broulik, elvisangelaccio, rkflx, mmustac, ngraham, #dolphin
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D10804
2018-03-11 17:21:24 +00:00
|
|
|
#include <QPushButton>
|
2010-10-10 17:11:55 +00:00
|
|
|
#include <QWidget>
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2019-01-15 17:47:27 +00:00
|
|
|
#ifdef HAVE_KACTIVITIES
|
2012-08-10 15:49:39 +00:00
|
|
|
namespace KActivities {
|
|
|
|
class ResourceInstance;
|
|
|
|
}
|
|
|
|
#endif
|
2010-07-24 21:45:49 +00:00
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
class FilterBar;
|
2012-04-12 21:57:51 +00:00
|
|
|
class KMessageWidget;
|
2014-10-21 19:18:43 +00:00
|
|
|
class QUrl;
|
2010-07-24 16:37:07 +00:00
|
|
|
class DolphinSearchBox;
|
2007-06-07 21:10:48 +00:00
|
|
|
class DolphinStatusBar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short Represents a view for the directory content
|
|
|
|
* including the navigation bar, filter bar and status bar.
|
|
|
|
*
|
2011-07-30 18:13:09 +00:00
|
|
|
* View modes for icons, compact and details are supported. Currently
|
2007-06-07 21:10:48 +00:00
|
|
|
* Dolphin allows to have up to two views inside the main window.
|
|
|
|
*
|
|
|
|
* @see DolphinView
|
|
|
|
* @see FilterBar
|
|
|
|
* @see KUrlNavigator
|
|
|
|
* @see DolphinStatusBar
|
|
|
|
*/
|
|
|
|
class DolphinViewContainer : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-04-12 21:57:51 +00:00
|
|
|
enum MessageType
|
|
|
|
{
|
|
|
|
Information,
|
|
|
|
Warning,
|
|
|
|
Error
|
|
|
|
};
|
|
|
|
|
2014-10-21 19:18:43 +00:00
|
|
|
DolphinViewContainer(const QUrl& url, QWidget* parent);
|
2017-11-20 22:25:06 +00:00
|
|
|
~DolphinViewContainer() override;
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current active URL, where all actions are applied.
|
|
|
|
* The URL navigator is synchronized with this URL.
|
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
QUrl url() const;
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If \a active is true, the view container will marked as active. The active
|
|
|
|
* view container is defined as view where all actions are applied to.
|
|
|
|
*/
|
|
|
|
void setActive(bool active);
|
|
|
|
bool isActive() const;
|
|
|
|
|
2012-04-26 06:31:46 +00:00
|
|
|
/**
|
|
|
|
* If \a grab is set to true, the container automatically grabs the focus
|
|
|
|
* as soon as the URL has been changed. Per default the grabbing
|
|
|
|
* of the focus is enabled.
|
|
|
|
*/
|
|
|
|
void setAutoGrabFocus(bool grab);
|
|
|
|
bool autoGrabFocus() const;
|
|
|
|
|
2017-12-03 14:58:02 +00:00
|
|
|
QString currentSearchText() const;
|
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
const DolphinStatusBar* statusBar() const;
|
|
|
|
DolphinStatusBar* statusBar();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2020-06-14 14:20:02 +00:00
|
|
|
/**
|
|
|
|
* @return An UrlNavigator that is controlling this view
|
|
|
|
* or nullptr if there is none.
|
|
|
|
* @see connectUrlNavigator()
|
|
|
|
* @see disconnectUrlNavigator()
|
2020-09-20 16:53:59 +00:00
|
|
|
*
|
2020-08-27 16:55:18 +00:00
|
|
|
* Use urlNavigatorInternalWithHistory() if you want to access the history.
|
|
|
|
* @see urlNavigatorInternalWithHistory()
|
2020-06-14 14:20:02 +00:00
|
|
|
*/
|
|
|
|
const DolphinUrlNavigator *urlNavigator() const;
|
|
|
|
/**
|
|
|
|
* @return An UrlNavigator that is controlling this view
|
|
|
|
* or nullptr if there is none.
|
|
|
|
* @see connectUrlNavigator()
|
|
|
|
* @see disconnectUrlNavigator()
|
2020-09-20 16:53:59 +00:00
|
|
|
*
|
2020-08-27 16:55:18 +00:00
|
|
|
* Use urlNavigatorInternalWithHistory() if you want to access the history.
|
|
|
|
* @see urlNavigatorInternalWithHistory()
|
2020-06-14 14:20:02 +00:00
|
|
|
*/
|
|
|
|
DolphinUrlNavigator *urlNavigator();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return An UrlNavigator that contains this view's history.
|
|
|
|
* Use urlNavigator() instead when not accessing the history.
|
|
|
|
*/
|
2020-08-27 16:55:18 +00:00
|
|
|
const DolphinUrlNavigator *urlNavigatorInternalWithHistory() const;
|
2020-06-14 14:20:02 +00:00
|
|
|
/**
|
|
|
|
* @return An UrlNavigator that contains this view's history.
|
|
|
|
* Use urlNavigator() instead when not accessing the history.
|
|
|
|
*/
|
2020-08-27 16:55:18 +00:00
|
|
|
DolphinUrlNavigator *urlNavigatorInternalWithHistory();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
const DolphinView* view() const;
|
|
|
|
DolphinView* view();
|
2008-12-12 06:55:26 +00:00
|
|
|
|
2020-06-14 14:20:02 +00:00
|
|
|
/**
|
|
|
|
* @param urlNavigator The UrlNavigator that is supposed to control
|
|
|
|
* this view.
|
|
|
|
*/
|
|
|
|
void connectUrlNavigator(DolphinUrlNavigator *urlNavigator);
|
|
|
|
|
|
|
|
/**
|
2021-12-06 12:59:23 +00:00
|
|
|
* Disconnects the navigator that is currently controlling the view.
|
2020-06-14 14:20:02 +00:00
|
|
|
* This method completely reverses connectUrlNavigator().
|
|
|
|
*/
|
|
|
|
void disconnectUrlNavigator();
|
|
|
|
|
2012-04-12 21:57:51 +00:00
|
|
|
/**
|
|
|
|
* Shows the message \msg with the given type non-modal above
|
|
|
|
* the view-content.
|
|
|
|
*/
|
2020-09-20 16:53:59 +00:00
|
|
|
void showMessage(const QString& msg, MessageType type);
|
2012-04-12 21:57:51 +00:00
|
|
|
|
2008-10-06 18:15:53 +00:00
|
|
|
/**
|
|
|
|
* Refreshes the view container to get synchronized with the (updated) Dolphin settings.
|
|
|
|
*/
|
2012-01-30 15:36:40 +00:00
|
|
|
void readSettings();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
/** Returns true, if the filter bar is visible. */
|
|
|
|
bool isFilterBarVisible() const;
|
|
|
|
|
[dolphin] Add an action to toggle the searchbar
Summary:
Make search action toggle the searchbar instead of just launching it.
The search action in dolphin did only bring up the search bar, but to close it again you had to go to the closing button on the same searchbar.
This behavior in inconsistent with other dolphin actions which toggle panels or tools.
BEFORE:
{F7256652}
AFTER:
{F7256862}
BUG: 344617
FIXED-IN: 19.12.0
Closes T8473
Depends on D23075
Test Plan:
- Enable the search mode: the searchbar appears and the toolbar button gets checked
- Press the search button again, and it goes back to normal mode.
- The search button state is coherent with the searchbox
- Coherence is kept when changing to a split view or different tab
- Shorcut <Ctrl-F> does not close the searchbar, but moves the focus to it.
Reviewers: #dolphin, ngraham, #vdg, elvisangelaccio
Reviewed By: ngraham, #vdg
Subscribers: ndavis, felixernst, elvisangelaccio, kfm-devel
Tags: #dolphin
Maniphest Tasks: T8473
Differential Revision: https://phabricator.kde.org/D23232
2019-09-01 19:59:43 +00:00
|
|
|
|
|
|
|
/** Returns true if the search mode is enabled. */
|
2010-07-24 16:37:07 +00:00
|
|
|
bool isSearchModeEnabled() const;
|
|
|
|
|
2012-06-02 13:45:40 +00:00
|
|
|
/**
|
|
|
|
* @return Text that should be used for the current URL when creating
|
|
|
|
* a new place.
|
|
|
|
*/
|
|
|
|
QString placesText() const;
|
|
|
|
|
2016-10-04 15:30:51 +00:00
|
|
|
/**
|
|
|
|
* Reload the view of this container. This will also hide messages in a messagewidget.
|
|
|
|
*/
|
|
|
|
void reload();
|
|
|
|
|
Do not display full path in the title of the tab
Summary:
Displays the full path only in the window title, not in the tab title.
Screenshot for comparison: ( Dolphin on the right is without D28815 , Dolphin on left has both D28815 and this patch)
{F8240079}
Reviewers: #vdg, #dolphin, ngraham, meven
Reviewed By: #vdg, #dolphin, ngraham, meven
Subscribers: ngraham, elvisangelaccio, meven, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D28857
2020-04-15 15:29:17 +00:00
|
|
|
/**
|
|
|
|
* @return Returns a Caption suitable for display in the window title.
|
|
|
|
* It is calculated depending on GeneralSettings::showFullPathInTitlebar().
|
|
|
|
* If it's false, it calls caption().
|
|
|
|
*/
|
|
|
|
QString captionWindowTitle() const;
|
|
|
|
|
2018-07-28 15:29:00 +00:00
|
|
|
/**
|
|
|
|
* @return Returns a Caption suitable for display to the user. It is
|
|
|
|
* calculated depending on settings, if a search is active and other
|
|
|
|
* factors.
|
|
|
|
*/
|
2018-08-28 07:50:41 +00:00
|
|
|
QString caption() const;
|
2018-07-28 15:29:00 +00:00
|
|
|
|
2020-11-08 07:21:56 +00:00
|
|
|
/**
|
|
|
|
* Disable/enable the behavior of "select child when moving to parent folder"
|
|
|
|
* offered by KUrlNavigator.
|
|
|
|
*
|
|
|
|
* See KUrlNavigator::urlSelectionRequested
|
|
|
|
*/
|
|
|
|
void disableUrlNavigatorSelectionRequests();
|
|
|
|
void enableUrlNavigatorSelectionRequests();
|
|
|
|
|
2021-02-08 22:09:59 +00:00
|
|
|
public Q_SLOTS:
|
2009-11-19 19:38:34 +00:00
|
|
|
/**
|
|
|
|
* Sets the current active URL, where all actions are applied. The
|
|
|
|
* URL navigator is synchronized with this URL. The signals
|
|
|
|
* KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
|
|
|
|
* are emitted.
|
|
|
|
* @see DolphinViewContainer::urlNavigator()
|
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
void setUrl(const QUrl& url);
|
2009-11-19 19:38:34 +00:00
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
/**
|
2010-11-05 17:12:35 +00:00
|
|
|
* Popups the filter bar above the status bar if \a visible is true.
|
2010-11-07 14:55:33 +00:00
|
|
|
* It \a visible is true, it is assured that the filter bar gains
|
|
|
|
* the keyboard focus.
|
2007-06-07 21:10:48 +00:00
|
|
|
*/
|
2010-11-05 17:12:35 +00:00
|
|
|
void setFilterBarVisible(bool visible);
|
2007-06-07 21:10:48 +00:00
|
|
|
|
[dolphin] Add an action to toggle the searchbar
Summary:
Make search action toggle the searchbar instead of just launching it.
The search action in dolphin did only bring up the search bar, but to close it again you had to go to the closing button on the same searchbar.
This behavior in inconsistent with other dolphin actions which toggle panels or tools.
BEFORE:
{F7256652}
AFTER:
{F7256862}
BUG: 344617
FIXED-IN: 19.12.0
Closes T8473
Depends on D23075
Test Plan:
- Enable the search mode: the searchbar appears and the toolbar button gets checked
- Press the search button again, and it goes back to normal mode.
- The search button state is coherent with the searchbox
- Coherence is kept when changing to a split view or different tab
- Shorcut <Ctrl-F> does not close the searchbar, but moves the focus to it.
Reviewers: #dolphin, ngraham, #vdg, elvisangelaccio
Reviewed By: ngraham, #vdg
Subscribers: ndavis, felixernst, elvisangelaccio, kfm-devel
Tags: #dolphin
Maniphest Tasks: T8473
Differential Revision: https://phabricator.kde.org/D23232
2019-09-01 19:59:43 +00:00
|
|
|
/**
|
|
|
|
* Enables the search mode, if \p enabled is true. In the search mode the URL navigator
|
|
|
|
* will be hidden and replaced by a line editor that allows to enter a search term.
|
|
|
|
*/
|
|
|
|
void setSearchModeEnabled(bool enabled);
|
|
|
|
|
2021-02-08 22:09:59 +00:00
|
|
|
Q_SIGNALS:
|
2009-07-11 17:48:05 +00:00
|
|
|
/**
|
|
|
|
* Is emitted whenever the filter bar has changed its visibility state.
|
|
|
|
*/
|
|
|
|
void showFilterBarChanged(bool shown);
|
[dolphin] Add an action to toggle the searchbar
Summary:
Make search action toggle the searchbar instead of just launching it.
The search action in dolphin did only bring up the search bar, but to close it again you had to go to the closing button on the same searchbar.
This behavior in inconsistent with other dolphin actions which toggle panels or tools.
BEFORE:
{F7256652}
AFTER:
{F7256862}
BUG: 344617
FIXED-IN: 19.12.0
Closes T8473
Depends on D23075
Test Plan:
- Enable the search mode: the searchbar appears and the toolbar button gets checked
- Press the search button again, and it goes back to normal mode.
- The search button state is coherent with the searchbox
- Coherence is kept when changing to a split view or different tab
- Shorcut <Ctrl-F> does not close the searchbar, but moves the focus to it.
Reviewers: #dolphin, ngraham, #vdg, elvisangelaccio
Reviewed By: ngraham, #vdg
Subscribers: ndavis, felixernst, elvisangelaccio, kfm-devel
Tags: #dolphin
Maniphest Tasks: T8473
Differential Revision: https://phabricator.kde.org/D23232
2019-09-01 19:59:43 +00:00
|
|
|
/**
|
|
|
|
* Is emitted whenever the search mode has changed its state.
|
|
|
|
*/
|
|
|
|
void searchModeEnabledChanged(bool enabled);
|
2009-07-11 17:48:05 +00:00
|
|
|
|
2010-01-25 07:58:24 +00:00
|
|
|
/**
|
|
|
|
* Is emitted when the write state of the folder has been changed. The application
|
|
|
|
* should disable all actions like "Create New..." that depend on the write
|
|
|
|
* state.
|
|
|
|
*/
|
|
|
|
void writeStateChanged(bool isFolderWritable);
|
|
|
|
|
2021-09-13 15:34:40 +00:00
|
|
|
/**
|
|
|
|
* Is emitted when the Caption has been changed.
|
|
|
|
* @see DolphinViewContainer::caption()
|
|
|
|
*/
|
|
|
|
void captionChanged();
|
|
|
|
|
2021-12-17 14:11:46 +00:00
|
|
|
/**
|
|
|
|
* Is emitted if a new tab should be opened in the background for the URL \a url.
|
|
|
|
*/
|
|
|
|
void tabRequested(const QUrl &url);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is emitted if a new tab should be opened for the URL \a url and set as active.
|
|
|
|
*/
|
|
|
|
void activeTabRequested(const QUrl &url);
|
|
|
|
|
2021-02-08 22:09:59 +00:00
|
|
|
private Q_SLOTS:
|
2007-06-07 21:10:48 +00:00
|
|
|
/**
|
|
|
|
* Updates the number of items (= number of files + number of
|
|
|
|
* directories) in the statusbar. If files are selected, the number
|
2009-07-11 17:48:05 +00:00
|
|
|
* of selected files and the sum of the filesize is shown. The update
|
|
|
|
* is done asynchronously, as getting the sum of the
|
|
|
|
* filesizes can be an expensive operation.
|
2011-03-23 23:45:14 +00:00
|
|
|
* Unless a previous OperationCompletedMessage was set very shortly before
|
|
|
|
* calling this method, it will be overwritten (see DolphinStatusBar::setMessage).
|
|
|
|
* Previous ErrorMessages however are always preserved.
|
2007-06-07 21:10:48 +00:00
|
|
|
*/
|
2009-07-11 17:48:05 +00:00
|
|
|
void delayedStatusBarUpdate();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
/**
|
2009-07-11 17:48:05 +00:00
|
|
|
* Is invoked by DolphinViewContainer::delayedStatusBarUpdate() and
|
|
|
|
* updates the status bar synchronously.
|
2007-06-07 21:10:48 +00:00
|
|
|
*/
|
2009-07-11 17:48:05 +00:00
|
|
|
void updateStatusBar();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2012-04-11 19:52:15 +00:00
|
|
|
void updateDirectoryLoadingProgress(int percent);
|
2012-04-10 14:30:50 +00:00
|
|
|
|
2012-04-11 19:52:15 +00:00
|
|
|
void updateDirectorySortingProgress(int percent);
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2010-12-10 22:54:37 +00:00
|
|
|
/**
|
|
|
|
* Updates the statusbar to show an undetermined progress with the correct
|
|
|
|
* context information whether a searching or a directory loading is done.
|
|
|
|
*/
|
2012-04-11 19:52:15 +00:00
|
|
|
void slotDirectoryLoadingStarted();
|
2010-12-10 22:54:37 +00:00
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
/**
|
2007-10-09 22:32:54 +00:00
|
|
|
* Assures that the viewport position is restored and updates the
|
|
|
|
* statusbar to reflect the current content.
|
2007-06-07 21:10:48 +00:00
|
|
|
*/
|
2012-04-11 19:52:15 +00:00
|
|
|
void slotDirectoryLoadingCompleted();
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2012-10-29 19:54:53 +00:00
|
|
|
/**
|
|
|
|
* Updates the statusbar to show, that the directory loading has
|
|
|
|
* been canceled.
|
|
|
|
*/
|
|
|
|
void slotDirectoryLoadingCanceled();
|
|
|
|
|
2012-06-13 13:15:54 +00:00
|
|
|
/**
|
|
|
|
* Is called if the URL set by DolphinView::setUrl() represents
|
|
|
|
* a file and not a directory. Takes care to activate the file.
|
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
void slotUrlIsFileError(const QUrl& url);
|
2012-06-13 13:15:54 +00:00
|
|
|
|
2007-08-28 17:50:54 +00:00
|
|
|
/**
|
2008-12-12 19:44:28 +00:00
|
|
|
* Handles clicking on an item. If the item is a directory, the
|
|
|
|
* directory is opened in the view. If the item is a file, the file
|
|
|
|
* gets started by the corresponding application.
|
2007-08-28 17:50:54 +00:00
|
|
|
*/
|
2021-12-17 14:11:46 +00:00
|
|
|
void slotItemActivated(const KFileItem &item);
|
2007-08-28 17:50:54 +00:00
|
|
|
|
2012-12-13 21:54:09 +00:00
|
|
|
/**
|
|
|
|
* Handles activation of multiple files. The files get started by
|
|
|
|
* the corresponding applications.
|
|
|
|
*/
|
|
|
|
void slotItemsActivated(const KFileItemList& items);
|
|
|
|
|
2007-06-08 13:44:59 +00:00
|
|
|
/**
|
2007-07-08 20:31:36 +00:00
|
|
|
* Shows the information for the item \a item inside the statusbar. If the
|
|
|
|
* item is null, the default statusbar information is shown.
|
2007-06-08 13:44:59 +00:00
|
|
|
*/
|
2007-07-02 17:24:54 +00:00
|
|
|
void showItemInfo(const KFileItem& item);
|
2007-06-08 13:44:59 +00:00
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
void closeFilterBar();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Filters the currently shown items by \a nameFilter. All items
|
|
|
|
* which contain the given filter string will be shown.
|
|
|
|
*/
|
2007-10-09 22:32:54 +00:00
|
|
|
void setNameFilter(const QString& nameFilter);
|
2007-06-07 21:10:48 +00:00
|
|
|
|
2007-06-13 17:08:39 +00:00
|
|
|
/**
|
|
|
|
* Marks the view container as active
|
|
|
|
* (see DolphinViewContainer::setActive()).
|
|
|
|
*/
|
|
|
|
void activate();
|
|
|
|
|
2011-07-30 18:13:09 +00:00
|
|
|
/**
|
|
|
|
* Is invoked if the signal urlAboutToBeChanged() from the URL navigator
|
|
|
|
* is emitted. Tries to save the view-state.
|
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
void slotUrlNavigatorLocationAboutToBeChanged(const QUrl& url);
|
2007-09-24 13:50:31 +00:00
|
|
|
|
2007-09-25 09:02:29 +00:00
|
|
|
/**
|
2010-01-25 07:58:24 +00:00
|
|
|
* Restores the current view to show \a url and assures
|
|
|
|
* that the root URL of the view is respected.
|
2007-09-25 09:02:29 +00:00
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
void slotUrlNavigatorLocationChanged(const QUrl& url);
|
2008-12-12 06:55:26 +00:00
|
|
|
|
2017-09-21 13:41:26 +00:00
|
|
|
/**
|
|
|
|
* @see KUrlNavigator::urlSelectionRequested
|
|
|
|
*/
|
|
|
|
void slotUrlSelectionRequested(const QUrl& url);
|
|
|
|
|
2008-10-24 19:52:28 +00:00
|
|
|
/**
|
|
|
|
* Is invoked when a redirection is done and changes the
|
|
|
|
* URL of the URL navigator to \a newUrl without triggering
|
|
|
|
* a reloading of the directory.
|
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
void redirect(const QUrl& oldUrl, const QUrl& newUrl);
|
2007-09-25 09:02:29 +00:00
|
|
|
|
2008-12-19 06:41:26 +00:00
|
|
|
/** Requests the focus for the view \a m_view. */
|
|
|
|
void requestFocus();
|
|
|
|
|
2010-07-24 16:37:07 +00:00
|
|
|
/**
|
|
|
|
* Gets the search URL from the searchbox and starts searching.
|
|
|
|
*/
|
2012-05-10 20:40:51 +00:00
|
|
|
void startSearching();
|
2010-07-24 16:37:07 +00:00
|
|
|
void closeSearchBox();
|
|
|
|
|
2010-11-20 17:17:35 +00:00
|
|
|
/**
|
|
|
|
* Stops the loading of a directory. Is connected with the "stopPressed" signal
|
|
|
|
* from the statusbar.
|
|
|
|
*/
|
2012-04-12 21:57:51 +00:00
|
|
|
void stopDirectoryLoading();
|
|
|
|
|
|
|
|
void slotStatusBarZoomLevelChanged(int zoomLevel);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Slot that calls showMessage(msg, Error).
|
|
|
|
*/
|
|
|
|
void showErrorMessage(const QString& msg);
|
|
|
|
|
2021-09-13 15:34:40 +00:00
|
|
|
/**
|
|
|
|
* Is invoked when a KFilePlacesModel has been changed
|
|
|
|
* @see DolphinPlacesModelSingleton::instance().placesModel()
|
|
|
|
*/
|
|
|
|
void slotPlacesModelChanged();
|
|
|
|
|
2021-12-02 09:03:47 +00:00
|
|
|
void slotHiddenFilesShownChanged(bool showHiddenFiles);
|
|
|
|
void slotSortHiddenLastChanged(bool hiddenLast);
|
|
|
|
|
2021-12-08 15:59:05 +00:00
|
|
|
void slotOpenUrlFinished(KJob* job);
|
|
|
|
|
2010-07-24 16:37:07 +00:00
|
|
|
private:
|
2010-11-01 12:31:44 +00:00
|
|
|
/**
|
2014-02-06 19:29:09 +00:00
|
|
|
* @return True if the URL protocol is a search URL (e. g. baloosearch:// or filenamesearch://).
|
2010-11-01 12:31:44 +00:00
|
|
|
*/
|
2014-10-21 19:18:43 +00:00
|
|
|
bool isSearchUrl(const QUrl& url) const;
|
2010-07-24 16:37:07 +00:00
|
|
|
|
2011-07-30 18:13:09 +00:00
|
|
|
/**
|
|
|
|
* Saves the state of the current view: contents position,
|
|
|
|
* root URL, ...
|
|
|
|
*/
|
|
|
|
void saveViewState();
|
|
|
|
|
2017-02-18 19:34:02 +00:00
|
|
|
/**
|
|
|
|
* Restores the state of the current view iff the URL navigator contains a
|
|
|
|
* non-empty location state.
|
|
|
|
*/
|
|
|
|
void tryRestoreViewState();
|
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
private:
|
|
|
|
QVBoxLayout* m_topLayout;
|
2020-06-14 14:20:02 +00:00
|
|
|
|
|
|
|
/**
|
2020-09-20 16:53:59 +00:00
|
|
|
* The internal UrlNavigator which is never visible to the user.
|
|
|
|
* m_urlNavigator is used even when another UrlNavigator is controlling
|
|
|
|
* the view to keep track of this object's history.
|
2020-06-14 14:20:02 +00:00
|
|
|
*/
|
2020-09-20 16:53:59 +00:00
|
|
|
std::unique_ptr<DolphinUrlNavigator> m_urlNavigator;
|
2020-06-14 14:20:02 +00:00
|
|
|
|
|
|
|
/**
|
2020-09-20 16:53:59 +00:00
|
|
|
* The UrlNavigator that is currently connected to the view.
|
|
|
|
* This is a nullptr if no UrlNavigator is connected.
|
|
|
|
* Otherwise it's one of the UrlNavigators visible in the toolbar.
|
2020-06-14 14:20:02 +00:00
|
|
|
*/
|
|
|
|
QPointer<DolphinUrlNavigator> m_urlNavigatorConnected;
|
2010-07-24 16:37:07 +00:00
|
|
|
DolphinSearchBox* m_searchBox;
|
2018-09-27 10:57:18 +00:00
|
|
|
bool m_searchModeEnabled;
|
2012-04-12 21:57:51 +00:00
|
|
|
KMessageWidget* m_messageWidget;
|
2007-06-07 21:10:48 +00:00
|
|
|
|
|
|
|
DolphinView* m_view;
|
|
|
|
|
|
|
|
FilterBar* m_filterBar;
|
2009-07-11 17:48:05 +00:00
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
DolphinStatusBar* m_statusBar;
|
2010-10-10 17:11:55 +00:00
|
|
|
QTimer* m_statusBarTimer; // Triggers a delayed update
|
|
|
|
QElapsedTimer m_statusBarTimestamp; // Time in ms since last update
|
2012-04-26 06:31:46 +00:00
|
|
|
bool m_autoGrabFocus;
|
2020-09-20 16:53:59 +00:00
|
|
|
/**
|
|
|
|
* The visual state to be applied to the next UrlNavigator that gets
|
|
|
|
* connected to this ViewContainer.
|
|
|
|
*/
|
|
|
|
std::unique_ptr<DolphinUrlNavigator::VisualState> m_urlNavigatorVisualState;
|
2012-08-10 15:49:39 +00:00
|
|
|
|
2019-01-15 17:47:27 +00:00
|
|
|
#ifdef HAVE_KACTIVITIES
|
2012-08-10 15:49:39 +00:00
|
|
|
private:
|
|
|
|
KActivities::ResourceInstance * m_activityResourceInstance;
|
|
|
|
#endif
|
2007-06-07 21:10:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DOLPHINVIEWCONTAINER_H
|