Commit abb6a12a authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

hide all sessions actions

parent f53ac8ac
......@@ -437,33 +437,37 @@ void KateMainWindow::setupActions()
slotWindowActivated();
// session actions
a = actionCollection()->addAction(QStringLiteral("sessions_new"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
a->setText(i18nc("Menu entry Session->New Session", "&New Session"));
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionNew, Qt::QueuedConnection);
a = actionCollection()->addAction(QStringLiteral("sessions_save"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
a->setText(i18n("&Save Session"));
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionSave);
a = actionCollection()->addAction(QStringLiteral("sessions_save_as"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-save-as")));
a->setText(i18n("Save Session &As..."));
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionSaveAs);
a = actionCollection()->addAction(QStringLiteral("sessions_manage"));
a->setIcon(QIcon::fromTheme(QStringLiteral("view-choose")));
a->setText(i18n("&Manage Sessions..."));
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionManage, Qt::QueuedConnection);
// recent sessions menu
a = new KateSessionsAction(i18n("&Recent Sessions"), this, nullptr, false);
actionCollection()->addAction(QStringLiteral("session_open_recent"), a);
// session menu
a = new KateSessionsAction(i18n("&All Sessions"), this, nullptr, true);
actionCollection()->addAction(QStringLiteral("session_open_session"), a);
// session actions, not for KWrite
if (KateApp::isKate()) {
a = actionCollection()->addAction(QStringLiteral("sessions_new"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
a->setText(i18nc("Menu entry Session->New Session", "&New Session"));
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionNew, Qt::QueuedConnection);
a = actionCollection()->addAction(QStringLiteral("sessions_save"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
a->setText(i18n("&Save Session"));
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionSave);
a = actionCollection()->addAction(QStringLiteral("sessions_save_as"));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-save-as")));
a->setText(i18n("Save Session &As..."));
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionSaveAs);
a = actionCollection()->addAction(QStringLiteral("sessions_manage"));
a->setIcon(QIcon::fromTheme(QStringLiteral("view-choose")));
a->setText(i18n("&Manage Sessions..."));
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect(a, &QAction::triggered, KateApp::self()->sessionManager(), &KateSessionManager::sessionManage, Qt::QueuedConnection);
// recent sessions menu
a = new KateSessionsAction(i18n("&Recent Sessions"), this, nullptr, false);
actionCollection()->addAction(QStringLiteral("session_open_recent"), a);
// session menu
a = new KateSessionsAction(i18n("&All Sessions"), this, nullptr, true);
actionCollection()->addAction(QStringLiteral("session_open_session"), a);
} else {
// actionCollection()->action(QStringLiteral("sessions"))->setVisible(false);
}
// location history actions
a = actionCollection()->addAction(QStringLiteral("view_history_back"));
......
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