mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 21:07:46 +00:00
Add about window to exdviewer and explorer as well
This commit is contained in:
parent
8de878791e
commit
31f7e5733e
9 changed files with 82 additions and 17 deletions
|
@ -43,3 +43,4 @@ add_subdirectory(argcracker)
|
||||||
add_subdirectory(explorer)
|
add_subdirectory(explorer)
|
||||||
add_subdirectory(bonedecomp)
|
add_subdirectory(bonedecomp)
|
||||||
add_subdirectory(parts)
|
add_subdirectory(parts)
|
||||||
|
add_subdirectory(common)
|
17
common/CMakeLists.txt
Normal file
17
common/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
add_library(NovusCommon STATIC)
|
||||||
|
target_sources(NovusCommon PRIVATE
|
||||||
|
include/aboutwindow.h
|
||||||
|
src/aboutwindow.cpp)
|
||||||
|
target_include_directories(NovusCommon PUBLIC
|
||||||
|
include
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_BINARY_DIR})
|
||||||
|
target_link_libraries(NovusCommon PUBLIC Qt5::Core Qt5::Widgets)
|
||||||
|
|
||||||
|
# meant for including the license text
|
||||||
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE LICENSE_TXT)
|
||||||
|
STRING(REPLACE "\n" " \\n" LICENSE_TXT ${LICENSE_TXT})
|
||||||
|
STRING(REPLACE "\"" "\"\"" LICENSE_TXT ${LICENSE_TXT})
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/license.h.in
|
||||||
|
${CMAKE_BINARY_DIR}/license.h)
|
|
@ -4,7 +4,7 @@ add_executable(exdviewer
|
||||||
target_include_directories(exdviewer
|
target_include_directories(exdviewer
|
||||||
PUBLIC
|
PUBLIC
|
||||||
include)
|
include)
|
||||||
target_link_libraries(exdviewer PUBLIC physis z ${LIBRARIES} Qt5::Core Qt5::Widgets exdpart)
|
target_link_libraries(exdviewer PUBLIC physis z ${LIBRARIES} Qt5::Core Qt5::Widgets exdpart NovusCommon)
|
||||||
|
|
||||||
install(TARGETS exdviewer
|
install(TARGETS exdviewer
|
||||||
DESTINATION "${INSTALL_BIN_PATH}")
|
DESTINATION "${INSTALL_BIN_PATH}")
|
||||||
|
|
|
@ -5,12 +5,39 @@
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "exdpart.h"
|
#include "exdpart.h"
|
||||||
|
#include "aboutwindow.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(GameData* data) : data(data) {
|
MainWindow::MainWindow(GameData* data) : data(data) {
|
||||||
setWindowTitle("exdviewer");
|
setWindowTitle("exdviewer");
|
||||||
|
|
||||||
|
auto helpMenu = menuBar()->addMenu("Help");
|
||||||
|
|
||||||
|
auto donateAction = helpMenu->addAction("Donate");
|
||||||
|
connect(donateAction, &QAction::triggered, this, [] {
|
||||||
|
QDesktopServices::openUrl(QUrl("https://redstrate.com/fund"));
|
||||||
|
});
|
||||||
|
donateAction->setIcon(QIcon::fromTheme("help-donate"));
|
||||||
|
|
||||||
|
helpMenu->addSeparator();
|
||||||
|
|
||||||
|
auto aboutNovusAction = helpMenu->addAction("About exdviewer");
|
||||||
|
aboutNovusAction->setIcon(QIcon::fromTheme("help-about"));
|
||||||
|
connect(aboutNovusAction, &QAction::triggered, this, [this] {
|
||||||
|
auto window = new AboutWindow(this);
|
||||||
|
window->show();
|
||||||
|
});
|
||||||
|
|
||||||
|
auto aboutQtAction = helpMenu->addAction("About Qt");
|
||||||
|
aboutQtAction->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
|
||||||
|
connect(aboutQtAction, &QAction::triggered, QApplication::instance(), &QApplication::aboutQt);
|
||||||
|
|
||||||
auto dummyWidget = new QWidget();
|
auto dummyWidget = new QWidget();
|
||||||
setCentralWidget(dummyWidget);
|
setCentralWidget(dummyWidget);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ add_executable(explorer
|
||||||
target_include_directories(explorer
|
target_include_directories(explorer
|
||||||
PUBLIC
|
PUBLIC
|
||||||
include)
|
include)
|
||||||
target_link_libraries(explorer PUBLIC physis z ${LIBRARIES} Qt5::Core Qt5::Widgets)
|
target_link_libraries(explorer PUBLIC physis z ${LIBRARIES} Qt5::Core Qt5::Widgets NovusCommon)
|
||||||
|
|
||||||
install(TARGETS explorer
|
install(TARGETS explorer
|
||||||
DESTINATION "${INSTALL_BIN_PATH}")
|
DESTINATION "${INSTALL_BIN_PATH}")
|
||||||
|
|
|
@ -1,15 +1,43 @@
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "filetreewindow.h"
|
|
||||||
#include "filepropertieswindow.h"
|
|
||||||
|
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QApplication>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "filetreewindow.h"
|
||||||
|
#include "filepropertieswindow.h"
|
||||||
|
#include "aboutwindow.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(GameData* data) : data(data) {
|
MainWindow::MainWindow(GameData* data) : data(data) {
|
||||||
setWindowTitle("explorer");
|
setWindowTitle("explorer");
|
||||||
|
|
||||||
|
auto helpMenu = menuBar()->addMenu("Help");
|
||||||
|
|
||||||
|
auto donateAction = helpMenu->addAction("Donate");
|
||||||
|
connect(donateAction, &QAction::triggered, this, [] {
|
||||||
|
QDesktopServices::openUrl(QUrl("https://redstrate.com/fund"));
|
||||||
|
});
|
||||||
|
donateAction->setIcon(QIcon::fromTheme("help-donate"));
|
||||||
|
|
||||||
|
helpMenu->addSeparator();
|
||||||
|
|
||||||
|
auto aboutNovusAction = helpMenu->addAction("About explorer");
|
||||||
|
aboutNovusAction->setIcon(QIcon::fromTheme("help-about"));
|
||||||
|
connect(aboutNovusAction, &QAction::triggered, this, [this] {
|
||||||
|
auto window = new AboutWindow(this);
|
||||||
|
window->show();
|
||||||
|
});
|
||||||
|
|
||||||
|
auto aboutQtAction = helpMenu->addAction("About Qt");
|
||||||
|
aboutQtAction->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
|
||||||
|
connect(aboutQtAction, &QAction::triggered, QApplication::instance(), &QApplication::aboutQt);
|
||||||
|
|
||||||
mdiArea = new QMdiArea();
|
mdiArea = new QMdiArea();
|
||||||
setCentralWidget(mdiArea);
|
setCentralWidget(mdiArea);
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,7 @@ add_executable(mdlviewer
|
||||||
src/boneeditor.cpp
|
src/boneeditor.cpp
|
||||||
src/cmpeditor.cpp
|
src/cmpeditor.cpp
|
||||||
src/gearlistwidget.cpp
|
src/gearlistwidget.cpp
|
||||||
src/gearlistmodel.cpp
|
src/gearlistmodel.cpp)
|
||||||
src/aboutwindow.cpp)
|
|
||||||
target_include_directories(mdlviewer
|
target_include_directories(mdlviewer
|
||||||
PUBLIC
|
PUBLIC
|
||||||
include
|
include
|
||||||
|
@ -28,7 +27,8 @@ target_link_libraries(mdlviewer PUBLIC
|
||||||
assimp::assimp
|
assimp::assimp
|
||||||
magic_enum
|
magic_enum
|
||||||
physis z
|
physis z
|
||||||
mdlpart)
|
mdlpart
|
||||||
|
NovusCommon)
|
||||||
|
|
||||||
install(TARGETS mdlviewer
|
install(TARGETS mdlviewer
|
||||||
DESTINATION "${INSTALL_BIN_PATH}")
|
DESTINATION "${INSTALL_BIN_PATH}")
|
||||||
|
@ -46,11 +46,3 @@ if(WIN32)
|
||||||
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:mdlviewer>\"
|
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:mdlviewer>\"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# meant for including the license text
|
|
||||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE LICENSE_TXT)
|
|
||||||
STRING(REPLACE "\n" " \\n" LICENSE_TXT ${LICENSE_TXT})
|
|
||||||
STRING(REPLACE "\"" "\"\"" LICENSE_TXT ${LICENSE_TXT})
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/license.h.in
|
|
||||||
${CMAKE_BINARY_DIR}/license.h)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue