Commit 776b63a6 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

avoid to warn during auto-hiding of sidebars

parent 31e1c808
......@@ -178,7 +178,7 @@ KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
// kwrite doesn't want sidebars, we have no plugins there
if (KateApp::isKWrite()) {
setSidebarsVisible(false);
setSidebarsVisibleInternal(false, true);
}
}
......
......@@ -1019,7 +1019,7 @@ void MainWindow::toolViewDeleted(ToolView *widget)
m_toolviews.erase(std::remove(m_toolviews.begin(), m_toolviews.end(), widget), m_toolviews.end());
}
void MainWindow::setSidebarsVisible(bool visible)
void MainWindow::setSidebarsVisibleInternal(bool visible, bool noWarning)
{
bool old_visible = m_sidebarsVisible;
m_sidebarsVisible = visible;
......@@ -1032,7 +1032,7 @@ void MainWindow::setSidebarsVisible(bool visible)
m_guiClient->updateSidebarsVisibleAction();
// show information message box, if the users hides the sidebars
if (old_visible && (!m_sidebarsVisible)) {
if (!noWarning && old_visible && (!m_sidebarsVisible)) {
KMessageBox::information(this,
i18n("<qt>You are about to hide the sidebars. With "
"hidden sidebars it is not possible to directly "
......
......@@ -330,6 +330,15 @@ public:
*/
bool sidebarsVisible() const;
/**
* set the sidebars' visibility to @p visible. If false, the sidebars
* are @e always hidden. Usually you do not have to call this because
* the user can set this in the menu.
* @param visible sidebars visibility
* @param noWarning avoid to warn about hiding the stuff
*/
void setSidebarsVisibleInternal(bool visible, bool noWarning);
public Q_SLOTS:
/**
* set the sidebars' visibility to @p visible. If false, the sidebars
......@@ -337,7 +346,10 @@ public Q_SLOTS:
* the user can set this in the menu.
* @param visible sidebars visibility
*/
void setSidebarsVisible(bool visible);
void setSidebarsVisible(bool visible)
{
setSidebarsVisibleInternal(visible, false);
}
protected:
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment