1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-05-03 16:37:46 +00:00

Add Quit actions to the apps that don't have it

This commit is contained in:
Joshua Goins 2025-05-01 17:59:20 -04:00
parent d93d730274
commit b8693effc0
18 changed files with 93 additions and 12 deletions

View file

@ -21,6 +21,7 @@ target_link_libraries(novus-gamelauncher
Qt6::Widgets) Qt6::Widgets)
install(TARGETS novus-gamelauncher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS novus-gamelauncher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES gamelauncher.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/novus)
if (WIN32) if (WIN32)
set_target_properties(novus-gamelauncher PROPERTIES set_target_properties(novus-gamelauncher PROPERTIES

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<gui name="gamelauncher"
version="1"
xmlns="https://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0
https://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
<MenuBar>
<Menu name="file" >
<text>File</text>
<Action name="quit"/>
</Menu>
</MenuBar>
</gui>

View file

@ -17,5 +17,7 @@ public:
explicit MainWindow(); explicit MainWindow();
private: private:
void setupActions();
QProcess *process = nullptr; QProcess *process = nullptr;
}; };

View file

@ -40,6 +40,7 @@ MainWindow::MainWindow()
}); });
layout->addWidget(launchGameButton); layout->addWidget(launchGameButton);
setupActions();
setupGUI(Keys | Save | Create); setupGUI(Keys | Save | Create);
// We don't provide help (yet) // We don't provide help (yet)
@ -48,4 +49,9 @@ MainWindow::MainWindow()
actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE))); actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE)));
} }
void MainWindow::setupActions()
{
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
}
#include "moc_mainwindow.cpp" #include "moc_mainwindow.cpp"

View file

@ -10,6 +10,8 @@
<text>File</text> <text>File</text>
<Action name="import_list" /> <Action name="import_list" />
<Action name="download_list" /> <Action name="download_list" />
<Separator/>
<Action name="quit"/>
</Menu> </Menu>
</MenuBar> </MenuBar>
</gui> </gui>

View file

@ -172,6 +172,8 @@ void MainWindow::setupActions()
}); });
}); });
actionCollection()->addAction(QStringLiteral("download_list"), downloadList); actionCollection()->addAction(QStringLiteral("download_list"), downloadList);
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
} }
#include "moc_mainwindow.cpp" #include "moc_mainwindow.cpp"

View file

@ -25,6 +25,7 @@ target_link_libraries(novus-mapeditor
Qt6::Widgets) Qt6::Widgets)
install(TARGETS novus-mapeditor ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS novus-mapeditor ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES mapeditor.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/novus)
ecm_add_app_icon(novus-mapeditor ecm_add_app_icon(novus-mapeditor
ICONS ICONS

View file

@ -17,6 +17,8 @@ public:
explicit MainWindow(GameData *data); explicit MainWindow(GameData *data);
private: private:
void setupActions();
GameData *data = nullptr; GameData *data = nullptr;
FileCache cache; FileCache cache;
}; };

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<gui name="mapeditor"
version="1"
xmlns="https://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0
https://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
<MenuBar>
<Menu name="file" >
<text>File</text>
<Action name="quit"/>
</Menu>
</MenuBar>
</gui>

View file

@ -46,6 +46,7 @@ MainWindow::MainWindow(GameData *data)
mapView->addTerrain(bgPath, tera); mapView->addTerrain(bgPath, tera);
}); });
setupActions();
setupGUI(Keys | Save | Create); setupGUI(Keys | Save | Create);
// We don't provide help (yet) // We don't provide help (yet)
@ -54,4 +55,9 @@ MainWindow::MainWindow(GameData *data)
actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE))); actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE)));
} }
void MainWindow::setupActions()
{
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
}
#include "moc_mainwindow.cpp" #include "moc_mainwindow.cpp"

View file

@ -25,6 +25,7 @@ target_link_libraries(novus-mateditor
Qt6::Widgets) Qt6::Widgets)
install(TARGETS novus-mateditor ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS novus-mateditor ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES mateditor.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/novus)
if (WIN32) if (WIN32)
set_target_properties(novus-mateditor PROPERTIES set_target_properties(novus-mateditor PROPERTIES

View file

@ -17,6 +17,8 @@ public:
explicit MainWindow(GameData *data); explicit MainWindow(GameData *data);
private: private:
void setupActions();
GameData *data = nullptr; GameData *data = nullptr;
FileCache cache; FileCache cache;
physis_Material m_material; physis_Material m_material;

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<gui name="mateditor"
version="1"
xmlns="https://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0
https://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
<MenuBar>
<Menu name="file" >
<text>File</text>
<Action name="quit"/>
</Menu>
</MenuBar>
</gui>

View file

@ -36,6 +36,7 @@ MainWindow::MainWindow(GameData *data)
matView->addSphere(m_material); matView->addSphere(m_material);
dummyWidget->addWidget(matView); dummyWidget->addWidget(matView);
setupActions();
setupGUI(Keys | Save | Create); setupGUI(Keys | Save | Create);
// We don't provide help (yet) // We don't provide help (yet)
@ -44,4 +45,9 @@ MainWindow::MainWindow(GameData *data)
actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE))); actionCollection()->removeAction(actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE)));
} }
void MainWindow::setupActions()
{
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
}
#include "moc_mainwindow.cpp" #include "moc_mainwindow.cpp"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gui name="mdlviewer" <gui name="mdlviewer"
version="1" version="3"
xmlns="https://www.kde.org/standards/kxmlgui/1.0" xmlns="https://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0 xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0
@ -9,6 +9,8 @@
<Menu name="file" > <Menu name="file" >
<text>File</text> <text>File</text>
<Action name="open_mdl" /> <Action name="open_mdl" />
<Separator/>
<Action name="quit"/>
</Menu> </Menu>
</MenuBar> </MenuBar>
</gui> </gui>

View file

@ -119,6 +119,8 @@ void MainWindow::setupActions()
} }
}); });
actionCollection()->addAction(QStringLiteral("open_mdl"), openMDLFile); actionCollection()->addAction(QStringLiteral("open_mdl"), openMDLFile);
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
} }
#include "moc_mainwindow.cpp" #include "moc_mainwindow.cpp"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gui name="exceleditor" <gui name="exceleditor"
version="1" version="2"
xmlns="https://www.kde.org/standards/kxmlgui/1.0" xmlns="https://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0 xsi:schemaLocation="https://www.kde.org/standards/kxmlgui/1.0
@ -10,6 +10,8 @@
<text>File</text> <text>File</text>
<Action name="import_list" /> <Action name="import_list" />
<Action name="download_list" /> <Action name="download_list" />
<Separator/>
<Action name="file_quit"/>
</Menu> </Menu>
</MenuBar> </MenuBar>
</gui> </gui>

View file

@ -271,4 +271,6 @@ void MainWindow::setupActions()
}); });
}); });
actionCollection()->addAction(QStringLiteral("download_list"), downloadList); actionCollection()->addAction(QStringLiteral("download_list"), downloadList);
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
} }