From 057080c9cda3c0b341b260bbedb93ccf8cd14358 Mon Sep 17 00:00:00 2001 From: Chris Rizzitello Date: Tue, 30 Aug 2022 12:24:44 -0400 Subject: [PATCH] use ff7tk 0.83.0 --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 20 +++----------------- src/CMakeLists.txt | 6 +++++- src/blackchocobo.cpp | 33 +++------------------------------ src/dialogs/CMakeLists.txt | 1 + src/dialogs/about.cpp | 4 ++-- src/widgets/CMakeLists.txt | 10 +++++++++- 7 files changed, 24 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9e2fbaf..fbf3a601 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -220,10 +220,10 @@ jobs: install: | apt-get update -y > /dev/null apt-get install -qqq ${{env.debianRequirments}} > /dev/null + run: | curl -s https://api.github.com/repos/sithlord48/ff7tk/releases/latest | awk -F\" '/browser_download_url.*_${{matrix.config.debArch}}*[.deb]/{print $(NF-1)}' | wget -i - apt -y -f install ./libff7tk*.deb rm libff7tk*.deb - run: | git config --global --add safe.directory /home/runner/work/blackchocobo/blackchocobo ${{env.cmakeConfigure}} -DCPACK_PACKAGE_VERSION="${{ needs.precheck.outputs.version }}" -DCPACK_DEBIAN_PACKAGE_RELEASE=${{github.run_attempt}}~${{matrix.config.name}} cmake --build build --config ${{env.BuildType}} --target package diff --git a/CMakeLists.txt b/CMakeLists.txt index 024a5f0f..8f5cab59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) cmake_policy(SET CMP0010 NEW) -project( blackchocobo VERSION 1.12.1 DESCRIPTION "Final Fantasy 7 Save Editor") +project( blackchocobo VERSION 1.13.0.0 DESCRIPTION "Final Fantasy 7 Save Editor") # Get the version from git if it's a git repository IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) FIND_PACKAGE(Git) @@ -50,6 +50,7 @@ add_definitions(-DBC_VERSION="${BC_VERSION}") set(QT_DEFAULT_MAJOR_VERSION 6 CACHE STRING "" FORCE) set(REQUIRED_QT_VERSION 6.2.0) +set(REQUIRED_FF7TK_VERSION 0.83.0) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE) @@ -62,22 +63,7 @@ else() set(BIN_NAME "blackchocobo") endif() -find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS - Core5Compat - Gui - Svg - Quick - Widgets - Xml -) - -set(REQUIRED_FF7TK_VERSION 0.82.1) -find_package(ff7tk ${REQUIRED_FF7TK_VERSION} REQUIRED NO_MODULE COMPONENTS - ff7tk - ff7tkQtWidgets - ff7tkWidgets -) - +find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core) get_target_property(qmake_executable Qt6::qmake IMPORTED_LOCATION) get_filename_component(_qt_bin_dir "${qmake_executable}" DIRECTORY) if(WIN32 OR APPLE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e09aa20..d8fe87a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,8 +7,10 @@ find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Xml ) -find_package(ff7tk 0.82.00 REQUIRED NO_MODULE COMPONENTS +find_package(ff7tk ${REQUIRED_FF7TK_VERSION} REQUIRED NO_MODULE COMPONENTS ff7tk + ff7tkData + ff7tkQtWidgets ff7tkWidgets ) @@ -20,12 +22,14 @@ if(WIN32) if(CMAKE_COMPILER_IS_GNUCC) set (FF7TK_DEPENDS ${ff7tk_DIR}/../../../bin/libff7tk.dll + ${ff7tk_DIR}/../../../bin/libff7tkData.dll ${ff7tk_DIR}/../../../bin/libff7tkQtWidgets.dll ${ff7tk_DIR}/../../../bin/libff7tkWidgets.dll ) else() set (FF7TK_DEPENDS ${ff7tk_DIR}/../../../bin/ff7tk.dll + ${ff7tk_DIR}/../../../bin/ff7tkData.dll ${ff7tk_DIR}/../../../bin/ff7tkQtWidgets.dll ${ff7tk_DIR}/../../../bin/ff7tkWidgets.dll ) diff --git a/src/blackchocobo.cpp b/src/blackchocobo.cpp index 89169147..41736e32 100644 --- a/src/blackchocobo.cpp +++ b/src/blackchocobo.cpp @@ -39,6 +39,7 @@ #include "ui_blackchocobo.h" //ff7tk includes +#include #include #include #include @@ -115,6 +116,7 @@ void BlackChocobo::detectTranslations() { m_translations.clear(); + QMap ff7tk_translations = ff7tkInfo::translations(); QStringList nameFilter ={QStringLiteral("blackchocobo_*.qm")}; QMap app_translations; QDir dir (QStringLiteral("%1").arg(BCSettings::value(SETTINGS::LANGPATH).toString())); @@ -128,39 +130,10 @@ void BlackChocobo::detectTranslations() if (currentLang) { BCSettings::setValue(SETTINGS::LANG, lang); QApplication::installTranslator(translator); + QApplication::installTranslator(ff7tk_translations.value(lang)); } } - QMap ff7tk_translations; - nameFilter = QStringList{QStringLiteral("ff7tk_*.qm")}; - dir.setPath(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), QStringLiteral("translations"))); - langList = dir.entryList(nameFilter, QDir::Files, QDir::Name); - if (langList.isEmpty()) { - dir.setPath(QStringLiteral("%1/../share/ff7tk/translations").arg(QCoreApplication::applicationDirPath())); - langList = dir.entryList(nameFilter, QDir::Files, QDir::Name); - if(langList.isEmpty()) { - dir.setPath(QStringLiteral("%1/%2").arg(QDir::homePath(), QStringLiteral(".local/share/ff7tk/translations"))); - langList = dir.entryList(nameFilter, QDir::Files, QDir::Name); - if(langList.isEmpty()) { - dir.setPath(QStringLiteral("/usr/local/share/ff7tk/translations")); - langList = dir.entryList(nameFilter, QDir::Files, QDir::Name); - if(langList.isEmpty()) { - dir.setPath(QStringLiteral("/usr/share/ff7tk/translations")); - langList = dir.entryList(nameFilter, QDir::Files, QDir::Name); - } - } - } - } - for (const QString &translation : qAsConst(langList)) { - QTranslator *translator = new QTranslator; - std::ignore = translator->load(translation, dir.absolutePath()); - QString lang = translation.mid(6, 2); - ff7tk_translations.insert(lang, translator); - bool currentLang = (BCSettings::value(SETTINGS::LANG, QStringLiteral("en")).toString() == lang); - if (currentLang) - QApplication::installTranslator(translator); - } - QMap qt_translations; nameFilter = QStringList{QStringLiteral("qt_*.qm")}; dir.setPath(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), QStringLiteral("translations"))); diff --git a/src/dialogs/CMakeLists.txt b/src/dialogs/CMakeLists.txt index b7fed7ab..154c5166 100644 --- a/src/dialogs/CMakeLists.txt +++ b/src/dialogs/CMakeLists.txt @@ -12,6 +12,7 @@ target_link_libraries(BCDIALOGS Qt::Gui Qt::Widgets ff7tk::ff7tk + ff7tk::ff7tkData ff7tk::ff7tkWidgets ) diff --git a/src/dialogs/about.cpp b/src/dialogs/about.cpp index e39f7799..9e6e30b9 100644 --- a/src/dialogs/about.cpp +++ b/src/dialogs/about.cpp @@ -17,7 +17,7 @@ #include "about.h" #include "ui_about.h" -#include +#include About::About(QWidget *parent) : QDialog(parent), @@ -30,7 +30,7 @@ About::About(QWidget *parent) : ui->lbl_icon->setPixmap(QPixmap(":/icons/common/blackchocobo")); ui->lbl_name->setText(QCoreApplication::applicationName()); ui->lbl_bc_version->setText(QString(tr("Version: %1")).arg(QCoreApplication::applicationVersion())); - ui->lbl_ff7tk_version->setText(QString(tr("ff7tk: %1")).arg(ff7tk_version())); + ui->lbl_ff7tk_version->setText(QString(tr("ff7tk: %1")).arg(ff7tkInfo::version())); ui->lbl_qt_version->setText(QString(tr("Qt: %1")).arg(qVersion())); move(parent->x() + ((parent->width() - width()) / 2), parent->y() + ((parent->sizeHint().height() - height()) / 2)); } diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index c2d64b04..84118318 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -3,4 +3,12 @@ add_library(BCWIDGETS STATIC partytab.h ) target_include_directories(BCWIDGETS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(BCWIDGETS PUBLIC Qt::Core Qt::Gui Qt::Widgets ff7tk::ff7tk ff7tk::ff7tkWidgets) +target_link_libraries(BCWIDGETS PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets + ff7tk::ff7tk + ff7tk::ff7tkData + ff7tk::ff7tkQtWidgets + ff7tk::ff7tkWidgets +)