Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
2e588733
Commit
2e588733
authored
Apr 28, 2022
by
Felix Ernst
🇺🇦
Browse files
Improve naming consistency and leave mode on Escape
parent
78cffd29
Changes
17
Hide whitespace changes
Inline
Side-by-side
src/dolphinmainwindow.cpp
View file @
2e588733
...
...
@@ -167,7 +167,7 @@ DolphinMainWindow::DolphinMainWindow() :
m_actionHandler
=
new
DolphinViewActionHandler
(
actionCollection
(),
m_actionTextHelper
,
this
);
connect
(
m_actionHandler
,
&
DolphinViewActionHandler
::
actionBeingHandled
,
this
,
&
DolphinMainWindow
::
clearStatusBar
);
connect
(
m_actionHandler
,
&
DolphinViewActionHandler
::
createDirectoryTriggered
,
this
,
&
DolphinMainWindow
::
createDirectory
);
connect
(
m_actionHandler
,
&
DolphinViewActionHandler
::
se
tSe
lectionMode
,
this
,
&
DolphinMainWindow
::
slotSetSelectionMode
);
connect
(
m_actionHandler
,
&
DolphinViewActionHandler
::
selectionMode
ChangeTriggered
,
this
,
&
DolphinMainWindow
::
slotSetSelectionMode
);
m_remoteEncoding
=
new
DolphinRemoteEncoding
(
this
,
m_actionHandler
);
connect
(
this
,
&
DolphinMainWindow
::
urlChanged
,
...
...
src/dolphinviewcontainer.cpp
View file @
2e588733
...
...
@@ -376,7 +376,7 @@ void DolphinViewContainer::disconnectUrlNavigator()
void
DolphinViewContainer
::
setSelectionModeEnabled
(
bool
enabled
,
KActionCollection
*
actionCollection
,
SelectionMode
::
BottomBar
::
Contents
bottomBarContents
)
{
const
bool
wasEnabled
=
m_view
->
selectionMode
();
m_view
->
setSelectionMode
(
enabled
);
m_view
->
setSelectionMode
Enabled
(
enabled
);
if
(
!
enabled
)
{
Q_CHECK_PTR
(
m_selectionModeTopBar
);
// there is no point in disabling selectionMode when it wasn't even enabled once.
...
...
@@ -396,7 +396,7 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti
});
m_selectionModeTopBar
=
new
SelectionMode
::
TopBar
(
this
);
// will be created hidden
connect
(
m_selectionModeTopBar
,
&
SelectionMode
::
TopBar
::
leaveS
electionModeRequested
,
this
,
[
this
]()
{
connect
(
m_selectionModeTopBar
,
&
SelectionMode
::
TopBar
::
s
electionMode
Leaving
Requested
,
this
,
[
this
]()
{
setSelectionModeEnabled
(
false
);
});
m_topLayout
->
addWidget
(
m_selectionModeTopBar
,
positionFor
.
selectionModeTopBar
,
0
);
...
...
@@ -410,7 +410,7 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti
connect
(
m_selectionModeBottomBar
,
&
SelectionMode
::
BottomBar
::
error
,
this
,
[
this
](
const
QString
&
errorMessage
)
{
showErrorMessage
(
errorMessage
);
});
connect
(
m_selectionModeBottomBar
,
&
SelectionMode
::
BottomBar
::
leaveS
electionModeRequested
,
this
,
[
this
]()
{
connect
(
m_selectionModeBottomBar
,
&
SelectionMode
::
BottomBar
::
s
electionMode
Leaving
Requested
,
this
,
[
this
]()
{
setSelectionModeEnabled
(
false
);
});
m_topLayout
->
addWidget
(
m_selectionModeBottomBar
,
positionFor
.
selectionModeBottomBar
,
0
);
...
...
src/dolphinviewcontainer.h
View file @
2e588733
...
...
@@ -137,7 +137,20 @@ public:
*/
void
disconnectUrlNavigator
();
/**
* Sets a selection mode that is useful for quick and easy selecting or deselecting of files.
* This method is the central authority about enabling or disabling selection mode:
* All other classes that want to enable or disable selection mode should trigger a call of this method.
*
* This method sets the selection mode for the view of this viewContainer and sets the visibility of the
* selection mode top and bottom bar which also belong to this viewContainer.
*
* @param enabled Whether to enable or disable selection mode.
* @param actionCollection The collection of actions from which the actions on the bottom bar are retrieved.
* @param bottomBarContents The contents the bar is supposed to show after this call.
*/
void
setSelectionModeEnabled
(
bool
enabled
,
KActionCollection
*
actionCollection
=
nullptr
,
SelectionMode
::
BottomBar
::
Contents
bottomBarContents
=
SelectionMode
::
BottomBar
::
Contents
::
GeneralContents
);
/** @see setSelectionModeEnabled() */
bool
isSelectionModeEnabled
()
const
;
/**
...
...
src/kitemviews/kitemlistcontroller.cpp
View file @
2e588733
...
...
@@ -77,7 +77,7 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
m_longPressDetectionTimer
->
setInterval
(
QGuiApplication
::
styleHints
()
->
mousePressAndHoldInterval
());
connect
(
m_longPressDetectionTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
if
(
!
m_selectionMode
)
{
Q_EMIT
selectionModeRequested
();
Q_EMIT
selectionMode
Change
Requested
(
true
);
}
});
...
...
@@ -232,7 +232,7 @@ bool KItemListController::singleClickActivationEnforced() const
return
m_singleClickActivationEnforced
;
}
void
KItemListController
::
setSelectionMode
(
bool
enabled
)
void
KItemListController
::
setSelectionMode
Enabled
(
bool
enabled
)
{
m_selectionMode
=
enabled
;
}
...
...
@@ -430,6 +430,9 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
}
case
Qt
::
Key_Escape
:
if
(
m_selectionMode
&&
m_selectionManager
->
selectedItems
().
count
()
<
1
)
{
Q_EMIT
selectionModeChangeRequested
(
false
);
}
if
(
m_selectionBehavior
!=
SingleSelection
)
{
m_selectionManager
->
clearSelection
();
}
...
...
src/kitemviews/kitemlistcontroller.h
View file @
2e588733
...
...
@@ -126,7 +126,11 @@ public:
void
setSingleClickActivationEnforced
(
bool
singleClick
);
bool
singleClickActivationEnforced
()
const
;
void
setSelectionMode
(
bool
enabled
);
/**
* Setting the selection mode to enabled will make selecting and deselecting easier by acting
* kind of similar to when the Control Key is held down.
*/
void
setSelectionModeEnabled
(
bool
enabled
);
bool
selectionMode
()
const
;
bool
processEvent
(
QEvent
*
event
,
const
QTransform
&
transform
);
...
...
@@ -213,12 +217,15 @@ Q_SIGNALS:
void
escapePressed
();
/**
* Is emitted if left click is pressed down for a long time without moving the cursor too much.
* Used to request either entering or leaving of selection mode
* Leaving is requested by pressing Escape when no item is selected.
*
* Entering is requested if left click is pressed down for a long time without moving the cursor too much.
* Moving the cursor would either trigger an item drag if the click was initiated on top of an item
* or a selection rectangle if the click was not initiated on top of an item.
* So long press is only emitted if there wasn't a lot of cursor movement.
*/
void
selectionModeRequested
();
void
selectionMode
Change
Requested
(
bool
enabled
);
void
modelChanged
(
KItemModelBase
*
current
,
KItemModelBase
*
previous
);
void
viewChanged
(
KItemListView
*
current
,
KItemListView
*
previous
);
...
...
src/selectionmode/bottombar.cpp
View file @
2e588733
...
...
@@ -52,7 +52,7 @@ BottomBar::BottomBar(KActionCollection *actionCollection, QWidget *parent) :
}
setVisibleInternal
(
visible
,
WithAnimation
);
});
connect
(
m_contentsContainer
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
,
this
,
&
BottomBar
::
leaveS
electionModeRequested
);
connect
(
m_contentsContainer
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
,
this
,
&
BottomBar
::
s
electionMode
Leaving
Requested
);
BackgroundColorHelper
::
instance
()
->
controlBackgroundColor
(
this
);
}
...
...
@@ -114,7 +114,7 @@ void BottomBar::slotSplitTabDisabled()
switch
(
contents
())
{
case
CopyToOtherViewContents
:
case
MoveToOtherViewContents
:
Q_EMIT
leaveS
electionModeRequested
();
Q_EMIT
s
electionMode
Leaving
Requested
();
default:
return
;
}
...
...
src/selectionmode/bottombar.h
View file @
2e588733
...
...
@@ -100,7 +100,7 @@ Q_SIGNALS:
*/
void
error
(
const
QString
&
errorMessage
);
void
leaveS
electionModeRequested
();
void
s
electionMode
Leaving
Requested
();
protected:
/** Is installed on an internal widget to make sure that the height of the bar is adjusted to its contents. */
...
...
src/selectionmode/bottombarcontentscontainer.cpp
View file @
2e588733
...
...
@@ -158,7 +158,7 @@ void BottomBarContentsContainer::addCopyContents()
// i18n: Aborts the current step-by-step process to copy files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Copying"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
copyButton
=
new
QPushButton
(
this
);
...
...
@@ -176,7 +176,7 @@ void BottomBarContentsContainer::addCopyContents()
resetContents
(
BottomBar
::
Contents
::
PasteContents
);
// resetContents() needs to be connected last because
// it instantly deletes the button and then the other slots won't be called.
}
Q_EMIT
leaveS
electionModeRequested
();
Q_EMIT
s
electionMode
Leaving
Requested
();
});
updateMainActionButton
(
KFileItemList
());
m_layout
->
addWidget
(
copyButton
);
...
...
@@ -191,7 +191,7 @@ void BottomBarContentsContainer::addCopyLocationContents()
// i18n: Aborts the current step-by-step process to copy the location of files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Copying"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
copyLocationButton
=
new
QPushButton
(
this
);
...
...
@@ -210,7 +210,7 @@ void BottomBarContentsContainer::addCopyToOtherViewContents()
// i18n: Aborts the current step-by-step process to copy the location of files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Copying"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
copyToOtherViewButton
=
new
QPushButton
(
this
);
...
...
@@ -228,7 +228,7 @@ void BottomBarContentsContainer::addCutContents()
// i18n: Aborts the current step-by-step process to cut files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Cutting"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
cutButton
=
new
QPushButton
(
this
);
...
...
@@ -246,7 +246,7 @@ void BottomBarContentsContainer::addCutContents()
resetContents
(
BottomBar
::
Contents
::
PasteContents
);
// resetContents() needs to be connected last because
// it instantly deletes the button and then the other slots won't be called.
}
Q_EMIT
leaveS
electionModeRequested
();
Q_EMIT
s
electionMode
Leaving
Requested
();
});
updateMainActionButton
(
KFileItemList
());
m_layout
->
addWidget
(
cutButton
);
...
...
@@ -261,7 +261,7 @@ void BottomBarContentsContainer::addDeleteContents()
// i18n: Aborts the current step-by-step process to delete files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
deleteButton
=
new
QPushButton
(
this
);
...
...
@@ -279,7 +279,7 @@ void BottomBarContentsContainer::addDuplicateContents()
// i18n: Aborts the current step-by-step process to duplicate files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Duplicating"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
duplicateButton
=
new
QPushButton
(
this
);
...
...
@@ -349,7 +349,7 @@ void BottomBarContentsContainer::addMoveToOtherViewContents()
// i18n: Aborts the current step-by-step process to copy the location of files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort Moving"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
moveToOtherViewButton
=
new
QPushButton
(
this
);
...
...
@@ -367,7 +367,7 @@ void BottomBarContentsContainer::addMoveToTrashContents()
// i18n: Aborts the current step-by-step process of moving files to the trash by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Abort"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
moveToTrashButton
=
new
QPushButton
(
this
);
...
...
@@ -393,7 +393,7 @@ void BottomBarContentsContainer::addPasteContents()
* So we first have to claim that we have different contents before requesting to leave selection mode. */
auto
actuallyLeaveSelectionMode
=
[
this
]()
{
m_contents
=
BottomBar
::
Contents
::
CopyLocationContents
;
Q_EMIT
leaveS
electionModeRequested
();
Q_EMIT
s
electionMode
Leaving
Requested
();
};
auto
*
pasteButton
=
new
QPushButton
(
this
);
...
...
@@ -428,7 +428,7 @@ void BottomBarContentsContainer::addRenameContents()
// i18n: Aborts the current step-by-step process to delete files by leaving the selection mode.
auto
*
cancelButton
=
new
QPushButton
(
i18nc
(
"@action:button"
,
"Stop Renaming"
),
this
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
leaveS
electionModeRequested
);
connect
(
cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
BottomBarContentsContainer
::
s
electionMode
Leaving
Requested
);
m_layout
->
addWidget
(
cancelButton
);
auto
*
renameButton
=
new
QPushButton
(
this
);
...
...
src/selectionmode/bottombarcontentscontainer.h
View file @
2e588733
...
...
@@ -78,7 +78,7 @@ Q_SIGNALS:
*/
void
barVisibilityChangeRequested
(
bool
visible
);
void
leaveS
electionModeRequested
();
void
s
electionMode
Leaving
Requested
();
private:
void
addCopyContents
();
...
...
src/selectionmode/selectionmodebottombar.h
0 → 100644
View file @
2e588733
src/selectionmode/selectionmodetopbar.h
0 → 100644
View file @
2e588733
src/selectionmode/topbar.cpp
View file @
2e588733
...
...
@@ -70,7 +70,7 @@ TopBar::TopBar(QWidget *parent) :
m_closeButton
->
setAccessibleName
(
m_closeButton
->
toolTip
());
m_closeButton
->
setFlat
(
true
);
connect
(
m_closeButton
,
&
QAbstractButton
::
pressed
,
this
,
&
TopBar
::
leaveS
electionModeRequested
);
this
,
&
TopBar
::
s
electionMode
Leaving
Requested
);
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
contentsContainer
);
auto
contentsMargins
=
layout
->
contentsMargins
();
...
...
src/selectionmode/topbar.h
View file @
2e588733
...
...
@@ -42,7 +42,7 @@ public:
void
setVisible
(
bool
visible
,
Animated
animated
);
Q_SIGNALS:
void
leaveS
electionModeRequested
();
void
s
electionMode
Leaving
Requested
();
protected:
/** Calls updateLabelString() */
...
...
src/views/dolphinview.cpp
View file @
2e588733
...
...
@@ -173,7 +173,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
connect
(
controller
,
&
KItemListController
::
increaseZoom
,
this
,
&
DolphinView
::
slotIncreaseZoom
);
connect
(
controller
,
&
KItemListController
::
decreaseZoom
,
this
,
&
DolphinView
::
slotDecreaseZoom
);
connect
(
controller
,
&
KItemListController
::
swipeUp
,
this
,
&
DolphinView
::
slotSwipeUp
);
connect
(
controller
,
&
KItemListController
::
selectionModeRequested
,
this
,
&
DolphinView
::
selectionModeRequested
);
connect
(
controller
,
&
KItemListController
::
selectionMode
Change
Requested
,
this
,
&
DolphinView
::
selectionMode
Change
Requested
);
connect
(
m_model
,
&
KFileItemModel
::
directoryLoadingStarted
,
this
,
&
DolphinView
::
slotDirectoryLoadingStarted
);
connect
(
m_model
,
&
KFileItemModel
::
directoryLoadingCompleted
,
this
,
&
DolphinView
::
slotDirectoryLoadingCompleted
);
...
...
@@ -283,7 +283,7 @@ DolphinView::Mode DolphinView::viewMode() const
return
m_mode
;
}
void
DolphinView
::
setSelectionMode
(
const
bool
enabled
)
void
DolphinView
::
setSelectionMode
Enabled
(
const
bool
enabled
)
{
if
(
enabled
)
{
m_proxyStyle
=
std
::
make_unique
<
SelectionMode
::
SingleClickSelectionProxyStyle
>
();
...
...
@@ -293,7 +293,7 @@ void DolphinView::setSelectionMode(const bool enabled)
setStyle
(
QApplication
::
style
());
m_view
->
setStyle
(
QApplication
::
style
());
}
m_container
->
controller
()
->
setSelectionMode
(
enabled
);
m_container
->
controller
()
->
setSelectionMode
Enabled
(
enabled
);
}
bool
DolphinView
::
selectionMode
()
const
...
...
src/views/dolphinview.h
View file @
2e588733
...
...
@@ -115,7 +115,7 @@ public:
/**
* Enables or disables a mode for quick and easy selection of items.
*/
void
setSelectionMode
(
bool
enabled
);
void
setSelectionMode
Enabled
(
bool
enabled
);
bool
selectionMode
()
const
;
/**
...
...
@@ -609,11 +609,11 @@ Q_SIGNALS:
void
goForwardRequested
();
/**
*
Is
e
m
it
ted when the selection mode is requested for the current view.
*
Th
is typically
happens
on press and hold.
*
@see KI
tem
L
is
tController::longPress()
*
Used to request
eit
her entering or leaving of selection mode
*
Entering
is typically
requested
on press and hold.
*
Leaving by pressing Escape when no i
tem
is
selected.
*/
void
selectionModeRequested
();
void
selectionMode
Change
Requested
(
bool
enabled
);
/**
* Is emitted when the user wants to move the focus to another view.
...
...
src/views/dolphinviewactionhandler.cpp
View file @
2e588733
...
...
@@ -73,8 +73,8 @@ void DolphinViewActionHandler::setCurrentView(DolphinView* view)
this
,
&
DolphinViewActionHandler
::
slotZoomLevelChanged
);
connect
(
view
,
&
DolphinView
::
writeStateChanged
,
this
,
&
DolphinViewActionHandler
::
slotWriteStateChanged
);
connect
(
view
,
&
DolphinView
::
selectionModeRequested
,
this
,
[
this
]()
{
Q_EMIT
se
tSe
lectionMode
(
true
);
});
connect
(
view
,
&
DolphinView
::
selectionMode
Change
Requested
,
this
,
[
this
](
bool
enabled
)
{
Q_EMIT
selectionMode
ChangeTriggered
(
enabled
);
});
connect
(
view
,
&
DolphinView
::
selectionChanged
,
this
,
&
DolphinViewActionHandler
::
slotSelectionChanged
);
slotSelectionChanged
(
m_currentView
->
selectedItems
());
...
...
@@ -435,7 +435,7 @@ void DolphinViewActionHandler::slotViewModeActionTriggered(QAction* action)
void
DolphinViewActionHandler
::
slotRename
()
{
if
(
m_currentView
->
selectedItemsCount
()
==
0
)
{
Q_EMIT
se
tSe
lectionMode
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
RenameContents
);
Q_EMIT
selectionMode
ChangeTriggered
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
RenameContents
);
}
else
{
Q_EMIT
actionBeingHandled
();
m_currentView
->
renameSelectedItems
();
...
...
@@ -446,22 +446,22 @@ void DolphinViewActionHandler::slotRename()
void
DolphinViewActionHandler
::
slotTrashActivated
()
{
if
(
m_currentView
->
selectedItemsCount
()
==
0
)
{
Q_EMIT
se
tSe
lectionMode
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
MoveToTrashContents
);
Q_EMIT
selectionMode
ChangeTriggered
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
MoveToTrashContents
);
}
else
{
Q_EMIT
actionBeingHandled
();
m_currentView
->
trashSelectedItems
();
Q_EMIT
se
tSe
lectionMode
(
false
);
Q_EMIT
selectionMode
ChangeTriggered
(
false
);
}
}
void
DolphinViewActionHandler
::
slotDeleteItems
()
{
if
(
m_currentView
->
selectedItemsCount
()
==
0
)
{
Q_EMIT
se
tSe
lectionMode
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
DeleteContents
);
Q_EMIT
selectionMode
ChangeTriggered
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
DeleteContents
);
}
else
{
Q_EMIT
actionBeingHandled
();
m_currentView
->
deleteSelectedItems
();
Q_EMIT
se
tSe
lectionMode
(
false
);
Q_EMIT
selectionMode
ChangeTriggered
(
false
);
}
}
...
...
@@ -762,11 +762,11 @@ void DolphinViewActionHandler::slotAdjustViewProperties()
void
DolphinViewActionHandler
::
slotDuplicate
()
{
if
(
m_currentView
->
selectedItemsCount
()
==
0
)
{
Q_EMIT
se
tSe
lectionMode
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
DuplicateContents
);
Q_EMIT
selectionMode
ChangeTriggered
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
DuplicateContents
);
}
else
{
Q_EMIT
actionBeingHandled
();
m_currentView
->
duplicateSelectedItems
();
Q_EMIT
se
tSe
lectionMode
(
false
);
Q_EMIT
selectionMode
ChangeTriggered
(
false
);
}
}
...
...
@@ -790,10 +790,10 @@ void DolphinViewActionHandler::slotProperties()
void
DolphinViewActionHandler
::
slotCopyPath
()
{
if
(
m_currentView
->
selectedItemsCount
()
==
0
)
{
Q_EMIT
se
tSe
lectionMode
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
CopyLocationContents
);
Q_EMIT
selectionMode
ChangeTriggered
(
true
,
SelectionMode
::
BottomBar
::
Contents
::
CopyLocationContents
);
}
else
{
m_currentView
->
copyPathToClipboard
();
Q_EMIT
se
tSe
lectionMode
(
false
);
Q_EMIT
selectionMode
ChangeTriggered
(
false
);
}
}
...
...
src/views/dolphinviewactionhandler.h
View file @
2e588733
...
...
@@ -87,8 +87,8 @@ Q_SIGNALS:
*/
void
createDirectoryTriggered
();
/** Used to request selection mode */
void
se
tSe
lectionMode
(
bool
enabled
,
SelectionMode
::
BottomBar
::
Contents
bottomBarContents
=
SelectionMode
::
BottomBar
::
Contents
::
GeneralContents
);
/** Used to request
either entering or leaving of
selection mode */
void
selectionMode
ChangeTriggered
(
bool
enabled
,
SelectionMode
::
BottomBar
::
Contents
bottomBarContents
=
SelectionMode
::
BottomBar
::
Contents
::
GeneralContents
);
private
Q_SLOTS
:
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment