mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 13:07:44 +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
|
@ -42,4 +42,5 @@ add_subdirectory(mdlviewer)
|
|||
add_subdirectory(argcracker)
|
||||
add_subdirectory(explorer)
|
||||
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
|
||||
PUBLIC
|
||||
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
|
||||
DESTINATION "${INSTALL_BIN_PATH}")
|
||||
|
|
|
@ -5,12 +5,39 @@
|
|||
#include <fmt/core.h>
|
||||
#include <QListWidget>
|
||||
#include <physis.hpp>
|
||||
#include <QDesktopServices>
|
||||
#include <QAction>
|
||||
#include <QMenuBar>
|
||||
#include <QUrl>
|
||||
#include <QApplication>
|
||||
|
||||
#include "exdpart.h"
|
||||
#include "aboutwindow.h"
|
||||
|
||||
MainWindow::MainWindow(GameData* data) : data(data) {
|
||||
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();
|
||||
setCentralWidget(dummyWidget);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ add_executable(explorer
|
|||
target_include_directories(explorer
|
||||
PUBLIC
|
||||
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
|
||||
DESTINATION "${INSTALL_BIN_PATH}")
|
||||
|
|
|
@ -1,15 +1,43 @@
|
|||
#include "mainwindow.h"
|
||||
#include "filetreewindow.h"
|
||||
#include "filepropertieswindow.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QAction>
|
||||
#include <QMenuBar>
|
||||
#include <QUrl>
|
||||
#include <QApplication>
|
||||
#include <QHBoxLayout>
|
||||
#include <QTableWidget>
|
||||
#include <QTreeWidget>
|
||||
#include <QDebug>
|
||||
|
||||
#include "filetreewindow.h"
|
||||
#include "filepropertieswindow.h"
|
||||
#include "aboutwindow.h"
|
||||
|
||||
MainWindow::MainWindow(GameData* data) : data(data) {
|
||||
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();
|
||||
setCentralWidget(mdiArea);
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@ add_executable(mdlviewer
|
|||
src/boneeditor.cpp
|
||||
src/cmpeditor.cpp
|
||||
src/gearlistwidget.cpp
|
||||
src/gearlistmodel.cpp
|
||||
src/aboutwindow.cpp)
|
||||
src/gearlistmodel.cpp)
|
||||
target_include_directories(mdlviewer
|
||||
PUBLIC
|
||||
include
|
||||
|
@ -28,7 +27,8 @@ target_link_libraries(mdlviewer PUBLIC
|
|||
assimp::assimp
|
||||
magic_enum
|
||||
physis z
|
||||
mdlpart)
|
||||
mdlpart
|
||||
NovusCommon)
|
||||
|
||||
install(TARGETS mdlviewer
|
||||
DESTINATION "${INSTALL_BIN_PATH}")
|
||||
|
@ -45,12 +45,4 @@ if(WIN32)
|
|||
POST_BUILD
|
||||
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:mdlviewer>\"
|
||||
)
|
||||
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)
|
||||
endif()
|
Loading…
Add table
Reference in a new issue