Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 989 Lines • ▼ Show 20 Line(s) | 967 | { | |||
---|---|---|---|---|---|
990 | 990 | | |||
991 | const QUrl url = viewContainer->url(); | 991 | const QUrl url = viewContainer->url(); | ||
992 | emit urlChanged(url); | 992 | emit urlChanged(url); | ||
993 | } | 993 | } | ||
994 | 994 | | |||
995 | void DolphinMainWindow::tabCountChanged(int count) | 995 | void DolphinMainWindow::tabCountChanged(int count) | ||
996 | { | 996 | { | ||
997 | const bool enableTabActions = (count > 1); | 997 | const bool enableTabActions = (count > 1); | ||
998 | actionCollection()->action(KStandardAction::name(KStandardAction::Close))->setEnabled(enableTabActions); | | |||
999 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | 998 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | ||
1000 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | 999 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | ||
1001 | } | 1000 | } | ||
1002 | 1001 | | |||
1003 | void DolphinMainWindow::updateWindowTitle() | 1002 | void DolphinMainWindow::updateWindowTitle() | ||
1004 | { | 1003 | { | ||
1005 | setWindowTitle(m_activeViewContainer->caption()); | 1004 | setWindowTitle(m_activeViewContainer->caption()); | ||
1006 | } | 1005 | } | ||
Show All 34 Lines | 1027 | { | |||
1041 | 1040 | | |||
1042 | QAction* newTab = actionCollection()->addAction(QStringLiteral("new_tab")); | 1041 | QAction* newTab = actionCollection()->addAction(QStringLiteral("new_tab")); | ||
1043 | newTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-new"))); | 1042 | newTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-new"))); | ||
1044 | newTab->setText(i18nc("@action:inmenu File", "New Tab")); | 1043 | newTab->setText(i18nc("@action:inmenu File", "New Tab")); | ||
1045 | actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::SHIFT + Qt::Key_N}); | 1044 | actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::SHIFT + Qt::Key_N}); | ||
1046 | connect(newTab, &QAction::triggered, this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::openNewActivatedTab)); | 1045 | connect(newTab, &QAction::triggered, this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::openNewActivatedTab)); | ||
1047 | 1046 | | |||
1048 | QAction* closeTab = KStandardAction::close( | 1047 | QAction* closeTab = KStandardAction::close( | ||
1049 | m_tabWidget, static_cast<void(DolphinTabWidget::*)()>(&DolphinTabWidget::closeTab), actionCollection()); | 1048 | m_tabWidget, static_cast<void(DolphinTabWidget::*)()>(&DolphinTabWidget::closeTab), actionCollection()); | ||
ngraham: Since `true` is the default state, we don't need to explicitly set it to true, so this line can… | |||||
1050 | closeTab->setText(i18nc("@action:inmenu File", "Close Tab")); | 1049 | closeTab->setText(i18nc("@action:inmenu File", "Close Tab")); | ||
1051 | closeTab->setEnabled(false); | | |||
1052 | 1050 | | |||
1053 | KStandardAction::quit(this, &DolphinMainWindow::quit, actionCollection()); | 1051 | KStandardAction::quit(this, &DolphinMainWindow::quit, actionCollection()); | ||
1054 | 1052 | | |||
1055 | // setup 'Edit' menu | 1053 | // setup 'Edit' menu | ||
1056 | KStandardAction::undo(this, | 1054 | KStandardAction::undo(this, | ||
1057 | &DolphinMainWindow::undo, | 1055 | &DolphinMainWindow::undo, | ||
1058 | actionCollection()); | 1056 | actionCollection()); | ||
1059 | 1057 | | |||
▲ Show 20 Lines • Show All 533 Lines • Show Last 20 Lines |
Since true is the default state, we don't need to explicitly set it to true, so this line can just be deleted now.