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
Utilities
Kate
Commits
0fa3541d
Commit
0fa3541d
authored
Aug 26, 2022
by
Eric Armbruster
🍁
Committed by
Christoph Cullmann
Aug 26, 2022
Browse files
Add close all documents action to tab context menu
parent
d3369d28
Pipeline
#223241
canceled with stage
in 7 minutes and 2 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
apps/lib/kateviewspace.cpp
View file @
0fa3541d
...
...
@@ -902,6 +902,7 @@ void KateViewSpace::showContextMenu(int idx, const QPoint &globalPos)
QMenu
menu
(
this
);
QAction
*
aCloseTab
=
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tab-close"
)),
i18n
(
"&Close Document"
));
QAction
*
aCloseOthers
=
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tab-close-other"
)),
i18n
(
"Close Other &Documents"
));
QAction
*
aCloseAll
=
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tab-close-all"
)),
i18n
(
"Close &All Documents"
));
menu
.
addSeparator
();
QAction
*
aCopyPath
=
addActionFromCollection
(
&
menu
,
"file_copy_filepath"
);
QAction
*
aOpenFolder
=
addActionFromCollection
(
&
menu
,
"file_open_containing_folder"
);
...
...
@@ -958,6 +959,11 @@ void KateViewSpace::showContextMenu(int idx, const QPoint &globalPos)
});
}
else
if
(
choice
==
aCloseOthers
)
{
KateApp
::
self
()
->
documentManager
()
->
closeOtherDocuments
(
doc
);
}
else
if
(
choice
==
aCloseAll
)
{
// use single shot as this action can trigger deletion of this viewspace!
QTimer
::
singleShot
(
0
,
this
,
[]()
{
KateApp
::
self
()
->
documentManager
()
->
closeAllDocuments
();
});
}
else
if
(
choice
==
aCopyPath
)
{
KateFileActions
::
copyFilePathToClipboard
(
doc
);
}
else
if
(
choice
==
aOpenFolder
)
{
...
...
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