- QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
- this, SLOT(showAboutDlg()));
- aboutQuasselAct->setMenuRole(QAction::AboutRole);
- coll->addAction("AboutQuassel", aboutQuasselAct);
-
- QAction *aboutQtAct = new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt"), coll,
- qApp, SLOT(aboutQt()));
- aboutQtAct->setMenuRole(QAction::AboutQtRole);
- coll->addAction("AboutQt", aboutQtAct);
- coll->addAction("DebugNetworkModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &NetworkModel"), coll,
- this, SLOT(on_actionDebugNetworkModel_triggered())));
- coll->addAction("DebugBufferViewOverlay", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
- this, SLOT(on_actionDebugBufferViewOverlay_triggered())));
- coll->addAction("DebugMessageModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &MessageModel"), coll,
- this, SLOT(on_actionDebugMessageModel_triggered())));
- coll->addAction("DebugHotList", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &HotList"), coll,
- this, SLOT(on_actionDebugHotList_triggered())));
- coll->addAction("DebugLog", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &Log"), coll,
- this, SLOT(on_actionDebugLog_triggered())));
- coll->addAction("ReloadStyle", new Action(QIcon::fromTheme("view-refresh"), tr("Reload Stylesheet"), coll,
- QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
-
- coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
- this, SLOT(hideCurrentBuffer()), QKeySequence::Close));
+ coll->addAction("AboutQuassel", new Action(icon::get("quassel"), tr("&About Quassel"), coll, this, &MainWin::showAboutDlg))->setMenuRole(QAction::AboutRole);
+ coll->addAction("AboutQt", new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt"), coll, qApp, &QApplication::aboutQt))->setMenuRole(QAction::AboutQtRole);
+ coll->addActions({
+ {"DebugNetworkModel", new Action(icon::get("tools-report-bug"), tr("Debug &NetworkModel"), coll, this, &MainWin::onDebugNetworkModelTriggered)},
+ {"DebugBufferViewOverlay", new Action(icon::get("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll, this, &MainWin::onDebugBufferViewOverlayTriggered)},
+ {"DebugMessageModel", new Action(icon::get("tools-report-bug"), tr("Debug &MessageModel"), coll, this, &MainWin::onDebugMessageModelTriggered)},
+ {"DebugHotList", new Action(icon::get("tools-report-bug"), tr("Debug &HotList"), coll, this, &MainWin::onDebugHotListTriggered)},
+ {"DebugLog", new Action(icon::get("tools-report-bug"), tr("Debug &Log"), coll, this, &MainWin::onDebugLogTriggered)},
+ {"ShowResourceTree", new Action(icon::get("tools-report-bug"), tr("Show &Resource Tree"), coll, this, &MainWin::onShowResourceTreeTriggered)},
+ {"ReloadStyle", new Action(icon::get("view-refresh"), tr("Reload Stylesheet"), coll, QtUi::style(), &UiStyle::reload, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R))}
+ });
+
+ // Other
+ coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll, this, &MainWin::hideCurrentBuffer, QKeySequence::Close));
+
+ // Text formatting
+ coll = QtUi::actionCollection("TextFormat", tr("Text formatting"));
+
+ coll->addActions({
+ {"FormatApplyColor", new Action(
+ icon::get("format-text-color"), tr("Apply foreground color"), coll,
+ this, &MainWin::onFormatApplyColorTriggered,
+ QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G))
+ },
+ {"FormatApplyColorFill", new Action(
+ icon::get("format-fill-color"), tr("Apply background color"), coll,
+ this, &MainWin::onFormatApplyColorFillTriggered,
+ QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B))
+ },
+ {"FormatClear", new Action(
+ icon::get("edit-clear"), tr("Clear formatting"), coll,
+ this, &MainWin::onFormatClearTriggered,
+ QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C))
+ },
+ {"FormatBold", new Action(
+ icon::get("format-text-bold"), tr("Toggle bold"), coll,
+ this, &MainWin::onFormatBoldTriggered,
+ QKeySequence::Bold)
+ },
+ {"FormatItalic", new Action(
+ icon::get("format-text-italic"), tr("Toggle italics"), coll,
+ this, &MainWin::onFormatItalicTriggered,
+ QKeySequence::Italic)
+ },
+ {"FormatUnderline", new Action(
+ icon::get("format-text-underline"), tr("Toggle underline"), coll,
+ this, &MainWin::onFormatUnderlineTriggered,
+ QKeySequence::Underline)
+ }
+ });