Commit 301f15ee authored by con's avatar con

Fix some more actions that were enabled at startup without a reason.

parent 6bea521e
......@@ -602,6 +602,7 @@ void MainWindow::registerDefaultActions()
// Save Action
icon = QIcon::fromTheme(QLatin1String("document-save"), QIcon(Constants::ICON_SAVEFILE));
QAction *tmpaction = new QAction(icon, tr("&Save"), this);
tmpaction->setEnabled(false);
cmd = am->registerAction(tmpaction, Constants::SAVE, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Save);
cmd->setAttribute(Command::CA_UpdateText);
......@@ -611,6 +612,7 @@ void MainWindow::registerDefaultActions()
// Save As Action
icon = QIcon::fromTheme(QLatin1String("document-save-as"));
tmpaction = new QAction(icon, tr("Save &As..."), this);
tmpaction->setEnabled(false);
cmd = am->registerAction(tmpaction, Constants::SAVEAS, globalContext);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
......@@ -631,6 +633,7 @@ void MainWindow::registerDefaultActions()
// Print Action
icon = QIcon::fromTheme(QLatin1String("document-print"));
tmpaction = new QAction(icon, tr("&Print..."), this);
tmpaction->setEnabled(false);
cmd = am->registerAction(tmpaction, Constants::PRINT, globalContext);
cmd->setDefaultKeySequence(QKeySequence::Print);
mfile->addAction(cmd, Constants::G_FILE_PRINT);
......
......@@ -208,6 +208,7 @@ void NavigationWidget::setFactories(const QList<INavigationWidgetFactory *> fact
d->m_factoryModel->appendRow(newRow);
}
d->m_factoryModel->sort(0);
updateToggleText();
}
int NavigationWidget::storedWidth()
......@@ -224,7 +225,7 @@ void NavigationWidget::updateToggleText()
{
bool haveData = d->m_factoryModel->rowCount();
d->m_toggleSideBarAction->setVisible(haveData);
d->m_toggleSideBarAction->setEnabled(haveData);
d->m_toggleSideBarAction->setEnabled(haveData && NavigationWidgetPlaceHolder::m_current);
if (isShown())
d->m_toggleSideBarAction->setToolTip(tr("Hide Sidebar"));
......@@ -234,7 +235,6 @@ void NavigationWidget::updateToggleText()
void NavigationWidget::placeHolderChanged(NavigationWidgetPlaceHolder *holder)
{
d->m_toggleSideBarAction->setEnabled(holder);
d->m_toggleSideBarAction->setChecked(holder && isShown());
updateToggleText();
}
......
Markdown is supported
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