mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 13:07:44 +00:00
Armoury: Add Penumbra actions menu
It's now possible to "redraw" manually, and also open the main window.
This commit is contained in:
parent
d9438ad88a
commit
a4347e6f8b
3 changed files with 18 additions and 0 deletions
|
@ -12,6 +12,7 @@ public:
|
|||
|
||||
public Q_SLOTS:
|
||||
void redrawAll();
|
||||
void openWindow();
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *m_mgr = nullptr;
|
||||
|
|
|
@ -107,6 +107,18 @@ void MainWindow::setupAdditionalMenus(QMenuBar *menuBar)
|
|||
fmvMenu->setChecked(fullModelViewer->isVisible());
|
||||
});
|
||||
|
||||
auto penumbraMenu = menuBar->addMenu(i18nc("@title:menu", "Penumbra"));
|
||||
|
||||
auto redrawAction = penumbraMenu->addAction(i18nc("@action:inmenu", "Redraw All"));
|
||||
connect(redrawAction, &QAction::triggered, [this] {
|
||||
m_api->redrawAll();
|
||||
});
|
||||
|
||||
auto openWindowAction = penumbraMenu->addAction(i18nc("@action:inmenu", "Open Window"));
|
||||
connect(openWindowAction, &QAction::triggered, [this] {
|
||||
m_api->openWindow();
|
||||
});
|
||||
|
||||
auto settingsMenu = menuBar->addMenu(i18nc("@title:menu", "Settings"));
|
||||
|
||||
auto settingsAction = settingsMenu->addAction(i18nc("@action:inmenu", "Configure Armoury…"));
|
||||
|
|
|
@ -13,3 +13,8 @@ void PenumbraApi::redrawAll()
|
|||
{
|
||||
m_mgr->post(QNetworkRequest(QUrl(QStringLiteral("http://localhost:42069/api/redrawAll"))), QByteArray{});
|
||||
}
|
||||
|
||||
void PenumbraApi::openWindow()
|
||||
{
|
||||
m_mgr->post(QNetworkRequest(QUrl(QStringLiteral("http://localhost:42069/api/openwindow"))), QByteArray{});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue