Changeset View
Changeset View
Standalone View
Standalone View
gui/ksysguard.cpp
Context not available. | |||||
49 | #include <QDBusConnection> | 49 | #include <QDBusConnection> | ||
---|---|---|---|---|---|
50 | #include <QIcon> | 50 | #include <QIcon> | ||
51 | #include <QLabel> | 51 | #include <QLabel> | ||
52 | #include <QMenuBar> | ||||
52 | #include <QSplitter> | 53 | #include <QSplitter> | ||
53 | #include <QStatusBar> | 54 | #include <QStatusBar> | ||
sitter: That should be sorted alphabetically. | |||||
54 | 55 | | |||
ngraham: Unrelated whitespace change | |||||
Context not available. | |||||
143 | mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") ); | 144 | mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") ); | ||
144 | mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) ); | 145 | mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) ); | ||
145 | connect(mConfigureSheetAction, &QAction::triggered, this, &TopLevel::configureCurrentSheet); | 146 | connect(mConfigureSheetAction, &QAction::triggered, this, &TopLevel::configureCurrentSheet); | ||
147 | // set up 'Settings' menu | ||||
148 | mShowMenuBarAction = KStandardAction::showMenubar(this, &TopLevel::toggleShowMenuBar, actionCollection()); | ||||
ngraham: Extra whitespace | |||||
@broulik just pointed out that KStandardAction has gained support for the more modern slot syntax. So, ideally this line should be changed to mShowMenuBarAction = KStandardAction::showMenubar(this, &TopLevel::toggleShowMenuBar, actionCollection()); Which has the advantage of letting the compiler assert slot compatibility, whereas the old SLOT() syntax turns it into a runtime problem which is easy to miss should it break in the future. Not technically a blocking issue though. sitter: @broulik just pointed out that KStandardAction has gained support for the more modern slot… | |||||
146 | 149 | | |||
Minor nitpick: "setup" is a noun; it should be "set up" so that there's a verb in the sentence. ngraham: Minor nitpick: "setup" is a noun; it should be "set up" so that there's a verb in the sentence. | |||||
147 | retranslateUi(); | 150 | retranslateUi(); | ||
148 | } | 151 | } | ||
149 | 152 | | |||
153 | void TopLevel::toggleShowMenuBar() | ||||
154 | { | ||||
155 | if (mShowMenuBarAction->isChecked()) { | ||||
156 | menuBar()->show(); | ||||
157 | } else { | ||||
158 | const QString accel = mShowMenuBarAction->shortcut().toString(); | ||||
159 | KMessageBox::information(this, i18n("This will hide the menu bar completely." | ||||
160 | " You can show it again by typing %1.", accel), | ||||
161 | i18n("Hide menu bar"), QLatin1String("HideMenuBarWarning")); | ||||
162 | menuBar()->hide(); | ||||
163 | } | ||||
164 | } | ||||
165 | | ||||
150 | void TopLevel::setLocalProcessController(ProcessController * localProcessController) | 166 | void TopLevel::setLocalProcessController(ProcessController * localProcessController) | ||
151 | { | 167 | { | ||
152 | Q_ASSERT(!mLocalProcessController); | 168 | Q_ASSERT(!mLocalProcessController); | ||
Context not available. |
That should be sorted alphabetically.