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
d1ec5682
Commit
d1ec5682
authored
Sep 08, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Sep 08, 2022
Browse files
Project: Hide actions that are not applicable
parent
9ae27085
Pipeline
#229325
passed with stage
in 8 minutes and 14 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectpluginview.cpp
View file @
d1ec5682
...
...
@@ -291,8 +291,7 @@ void KateProjectPluginView::slotConfigUpdated()
}
// update action state
m_gotoSymbolActionAppMenu
->
setEnabled
(
m_toolMultiView
);
m_gotoSymbolAction
->
setEnabled
(
m_toolMultiView
);
updateActions
();
}
QPair
<
KateProjectView
*
,
KateProjectInfoView
*>
KateProjectPluginView
::
viewForProject
(
KateProject
*
project
)
...
...
@@ -850,6 +849,7 @@ QString KateProjectPluginView::projectBaseDirForUrl(const QUrl &url)
void
KateProjectPluginView
::
updateActions
()
{
const
bool
hasMultipleProjects
=
m_projectsCombo
->
count
()
>
1
;
// currently some project active?
const
bool
projectActive
=
!
projectBaseDir
().
isEmpty
();
m_projectsCombo
->
setEnabled
(
projectActive
);
...
...
@@ -857,16 +857,19 @@ void KateProjectPluginView::updateActions()
m_reloadButton
->
setEnabled
(
projectActive
);
m_closeProjectButton
->
setEnabled
(
projectActive
);
m_gitStatusRefreshButton
->
setEnabled
(
projectActive
);
m_lookupAction
->
setEnabled
(
projectActive
);
m_gotoSymbolAction
->
setEnabled
(
projectActive
);
m_gotoSymbolActionAppMenu
->
setEnabled
(
projectActive
);
m_projectTodosAction
->
setEnabled
(
projectActive
);
m_projectPrevAction
->
setEnabled
(
projectActive
);
m_projectNextAction
->
setEnabled
(
projectActive
);
m_projectGotoIndexAction
->
setEnabled
(
projectActive
);
m_projectPrevAction
->
setEnabled
(
projectActive
&&
hasMultipleProjects
);
m_projectNextAction
->
setEnabled
(
projectActive
&&
hasMultipleProjects
);
m_projectCloseAction
->
setEnabled
(
projectActive
);
m_projectCloseAllAction
->
setEnabled
(
m_projectsCombo
->
count
()
>
0
);
m_projectCloseAllAction
->
setEnabled
(
hasMultipleProjects
);
m_projectCloseWithoutDocumentsAction
->
setEnabled
(
m_projectsCombo
->
count
()
>
0
);
const
bool
hasIndex
=
projectActive
&&
m_plugin
->
getIndexEnabled
();
m_lookupAction
->
setVisible
(
hasIndex
);
m_gotoSymbolAction
->
setVisible
(
hasIndex
);
m_projectGotoIndexAction
->
setVisible
(
hasIndex
);
m_gotoSymbolActionAppMenu
->
setVisible
(
hasIndex
);
actionCollection
()
->
action
(
QStringLiteral
(
"popup_project"
))
->
setVisible
(
hasIndex
);
}
void
KateProjectPluginView
::
slotActivateProject
(
KateProject
*
project
)
...
...
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