diff options
author | Saturn&Eric <[email protected]> | 2021-12-05 11:31:51 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-05 11:31:51 +0000 |
commit | 033362e312c586ad3eaf0d6b3631241f908496ff (patch) | |
tree | 9bab1796b919db2c0fa88e83b183a5a5c7583fcc | |
parent | Merge pull request #25 from saturneric/develop (diff) | |
parent | Merge branch 'main' into develop (diff) | |
download | GpgFrontend-033362e312c586ad3eaf0d6b3631241f908496ff.tar.gz GpgFrontend-033362e312c586ad3eaf0d6b3631241f908496ff.zip |
Merge pull request #26 from saturneric/develop
Develop Fixed For Version 2.0.1.
-rw-r--r-- | .github/workflows/debug.yml | 19 | ||||
-rw-r--r-- | .github/workflows/release-ci.yml | 2 | ||||
-rw-r--r-- | .github/workflows/release.yml | 6 | ||||
-rw-r--r-- | .gitmodules | 12 | ||||
-rw-r--r-- | CMakeLists.txt | 22 | ||||
-rw-r--r-- | include/GpgFrontend.h | 79 | ||||
-rw-r--r-- | include/GpgFrontendBuildInfo.h | 54 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/gpg/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/ui/MainWindow.cpp | 9 | ||||
-rw-r--r-- | src/ui/MainWindow.h | 2 | ||||
-rw-r--r-- | src/ui/help/AboutDialog.cpp | 2 | ||||
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 15 | ||||
m--------- | third_party/AppImageUpdate | 0 | ||||
-rw-r--r-- | third_party/CMakeLists.txt | 15 | ||||
m--------- | third_party/gpgme | 0 | ||||
m--------- | third_party/libassuan | 0 | ||||
m--------- | third_party/libgpg-error | 0 |
18 files changed, 76 insertions, 170 deletions
diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index f00a3dad..5c541fbd 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -39,6 +39,11 @@ jobs: sudo apt-get -y install gpgsm if: matrix.os == 'ubuntu-latest' + - name: Git Sumbodule Update + run: | + git pull --recurse-submodules + git submodule update --init --recursive + - name: Codesign Configuration (macOS) run: | echo ${{secrets.MACOS_CERTIFICATE}} | base64 --decode > certificate.p12 @@ -90,9 +95,7 @@ jobs: - name: Build gpg-error (Linux) run: | - cd ${{github.workspace}}/.. - git clone https://github.com/saturneric/libgpg-error - cd libgpg-error + cd ${{github.workspace}}/third_party/libgpg-error ./autogen.sh ./configure --enable-maintainer-mode --enable-static=yes && make -j2 sudo make install @@ -101,9 +104,7 @@ jobs: - name: Build assuan (Linux) run: | - cd ${{github.workspace}}/.. - git clone https://github.com/saturneric/libassuan - cd libassuan + cd ${{github.workspace}}/third_party/libassuan ./autogen.sh ./configure --enable-maintainer-mode --enable-static=yes && make -j2 sudo make install @@ -112,9 +113,7 @@ jobs: - name: Build GpgME (Linux) run: | - cd ${{github.workspace}}/.. - git clone https://github.com/saturneric/gpgme - cd gpgme + cd ${{github.workspace}}/third_party/gpgme ./autogen.sh ./configure --enable-maintainer-mode --enable-static=yes --enable-languages=cpp && make -j2 sudo make install @@ -134,7 +133,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} -DBUILD_CONFIG="test_ui" if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - name: Build GpgFrontend diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 3eabc44e..4abf5c0d 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -35,7 +35,7 @@ jobs: run: | sudo apt-get update sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo - sudo apt-get -y install gcc g++ libconfig++-dev libboost-all-dev + sudo apt-get -y install gcc-8 g++-8 libconfig++-dev libboost-all-dev sudo apt-get -y install gpgsm libxcb-xinerama0 libxcb-icccm4-dev libcups2-dev libdrm-dev libegl1-mesa-dev sudo apt-get -y install libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-image0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24f323d8..496e5e79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,11 +35,15 @@ jobs: run: | sudo apt-get update sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo - sudo apt-get -y install gcc g++ libconfig++-dev libboost-all-dev + sudo apt-get -y install gcc-8 g++-8 libconfig++-dev libboost-all-dev sudo apt-get -y install gpgsm libxcb-xinerama0 libxcb-icccm4-dev libcups2-dev libdrm-dev libegl1-mesa-dev sudo apt-get -y install libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-image0 sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-* + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 + sudo update-alternatives --set gcc "/usr/bin/gcc-8" + sudo update-alternatives --set g++ "/usr/bin/g++-8" if: matrix.os == 'ubuntu-18.04' - name: Codesign Configuration (macOS) diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..f559522f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "third_party/AppImageUpdate"] + path = third_party/AppImageUpdate + url = https://github.com/AppImage/AppImageUpdate +[submodule "third_party/gpgme"] + path = third_party/gpgme + url = https://github.com/saturneric/gpgme +[submodule "third_party/libassuan"] + path = third_party/libassuan + url = https://github.com/saturneric/libassuan +[submodule "third_party/libgpg-error"] + path = third_party/libgpg-error + url = https://github.com/saturneric/libgpg-error diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cad474a..a3063d66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,9 +92,9 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Release") ADD_DEFINITIONS(-DRELEASE) message(STATUS "Build Type RELEASE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") - # Release Version Build MINIMUM_APPLICATION_BUILD + # Release Version force to build using option STABLE_APPLICATION_BUILD set(FULL_APPLICATION_BUILD 0) - set(MINIMUM_APPLICATION_BUILD 1) + set(STABLE_APPLICATION_BUILD 1) else () set(BUILD_FLAG 1) ADD_DEFINITIONS(-DDEBUG) @@ -196,6 +196,12 @@ if (LINUX) set(OS_PLATFORM 2) ADD_DEFINITIONS(-DLINUX) + message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION}") + if (CMAKE_CXX_COMPILER_VERSION LESS 9) + message(STATUS "GCC CXX_FLAGS add filesystem support manually") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17 -lstdc++fs") + endif () + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/third_party @@ -213,8 +219,6 @@ endif () message(STATUS "OS_PLATFORM ${OS_PLATFORM}") -find_package(Boost COMPONENTS date_time filesystem REQUIRED) - # Basic Envirnoment Configure set(BASIC_ENV_CONFIG 1) set(QT_MOC_CONFIG 1) @@ -231,8 +235,7 @@ if (FULL_APPLICATION_BUILD) set(ADVANCE_SUPPORT 1) set(APPLICATION_BUILD 1) set(BASIC_ENV_CONFIG 1) - # Disable Qt MULTI_LANG_SUPPORT - # set(MULTI_LANG_SUPPORT 1) + set(MULTI_LANG_SUPPORT 1) elseif (MINIMUM_APPLICATION_BUILD) set(QT5_ENV_SUPPORT 1) set(QT_MOC_CONFIG 1) @@ -241,6 +244,10 @@ elseif (MINIMUM_APPLICATION_BUILD) set(APPLICATION_BUILD 1) set(BASIC_ENV_CONFIG 1) set(MULTI_LANG_SUPPORT 1) + # Disable APP_IMAGE_UPDATE because of too many issues + # if (LINUX) + # set(APP_IMAGE_UPDATE 1) + # endif () elseif (STABLE_APPLICATION_BUILD) set(QT5_ENV_SUPPORT 1) set(QT_MOC_CONFIG 1) @@ -259,6 +266,9 @@ elseif (TEST_BUILD) endif () +# Introduce boost +find_package(Boost COMPONENTS date_time filesystem REQUIRED) + if (QT5_ENV_SUPPORT) # Support Qt version Both 5.12.x and 5.15.x find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED) diff --git a/include/GpgFrontend.h b/include/GpgFrontend.h deleted file mode 100644 index e7250d27..00000000 --- a/include/GpgFrontend.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This file is part of GPGFrontend. - * - * GPGFrontend is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Foobar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <https://www.gnu.org/licenses/>. - * - * The initial version of the source code is inherited from gpg4usb-team. - * Their source code version also complies with GNU General Public License. - * - * The source code version of this software was modified and released - * by Saturneric<[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_H_IN -#define GPGFRONTEND_H_IN - -/** - * STD Headers - */ -#include <iostream> -#include <string> -#include <cmath> -#include <clocale> -#include <cerrno> -#include <utility> -#include <list> - -/** - * QT Headers - */ -#include <QtCore> -#include <QtWidgets> -#include <QtNetwork/QtNetwork> -#include <QtPrintSupport/QtPrintSupport> - -/** - * GpgME Headers - */ -#include <gpgme.h> - -/** - * Platform Vars - */ -#define WINDOWS 0 -#define MACOS 1 -#define LINUX 2 - -#define OS_PLATFORM 1 - -/** - * Build Options Vars - */ -#define RELEASE 0 -#define DEBUG 1 - -/** - * Resources File(s) Path Vars - */ -#if OS_PLATFORM == MACOS && BUILD_FLAG == RELEASE -# define RESOURCE_DIR(appDir) (appDir + "/../Resources/") -#elif OS_PLATFORM == LINUX && BUILD_FLAG == RELEASE -# define RESOURCE_DIR(appDir) (appDir + "/../share/") -#else -# define RESOURCE_DIR(appDir) (appDir) -#endif - - -#endif //GPGFRONTEND_H_IN diff --git a/include/GpgFrontendBuildInfo.h b/include/GpgFrontendBuildInfo.h deleted file mode 100644 index 3f75ebd6..00000000 --- a/include/GpgFrontendBuildInfo.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This file is part of GPGFrontend. - * - * GPGFrontend is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Foobar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <https://www.gnu.org/licenses/>. - * - * The initial version of the source code is inherited from gpg4usb-team. - * Their source code version also complies with GNU General Public License. - * - * The source code version of this software was modified and released - * by Saturneric<[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_BUILD_INFO_H_IN -#define GPGFRONTEND_BUILD_INFO_H_IN - -/** - * Logic Version (*.*.*) - */ -#define VERSION_MAJOR 1 -#define VERSION_MINOR 3 -#define VERSION_PATCH 1 - -/** - * Code Version (According to Git) - */ -#define GIT_BRANCH_NAME "main" -#define GIT_COMMIT_HASH "d0146c8c640b2a7ec9a62c3c87a8f5e7c84f1fe7" - -/** - * Generated Information (According to CMake) - */ -#define PROJECT_NAME "GpgFrontend" -#define BUILD_VERSION "1.3.1_Darwin-20.5.0_x86_64_Debug" -#define GIT_VERSION "main_d0146c8c640b2a7ec9a62c3c87a8f5e7c84f1fe7" - -/** - * Build Information - */ -#define BUILD_FLAG 1 -#define BUILD_TIMESTAMP "2021-08-28 12:37:33" - -#endif // GPGFRONTEND_BUILD_INFO_H_IN diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d5a713b1..bf9a89c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -225,6 +225,10 @@ if (APPLICATION_BUILD) crypto ssl intl) else () message(STATUS "Link Application Static Library For UNIX ") + if (APP_IMAGE_UPDATE) + target_link_libraries(${AppName} + libappimageupdate) + endif () target_link_libraries(${AppName} ${GPGFRONTEND_LIBS} ${QT_DEPENDENCY_LIBS} diff --git a/src/gpg/CMakeLists.txt b/src/gpg/CMakeLists.txt index 886f8fdc..19b9f00f 100644 --- a/src/gpg/CMakeLists.txt +++ b/src/gpg/CMakeLists.txt @@ -34,9 +34,12 @@ elseif (APPLE) ${libgpgme} ${libgpg-error} ${libassuan} dl) else () + find_library(libgpgme NAMES libgpgme.a) + find_library(libgpg-error NAMES libgpg-error.a) + find_library(libassuan NAMES libassuan.a) message(STATUS "Link GPG Static Library For Unix") target_link_libraries(gpg_core ${THIRD_PARTY_LIBS} - libgpgme.a libgpg-error.a libassuan.a + ${libgpgme} ${libgpg-error} ${libassuan} ${BOOST_LIBS} pthread dl) endif () diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp index 6b0977fd..e29278e9 100644 --- a/src/ui/MainWindow.cpp +++ b/src/ui/MainWindow.cpp @@ -51,7 +51,7 @@ void MainWindow::init() noexcept { networkAccessManager = new QNetworkAccessManager(this); - /* get path were app was started */ + /* get path where app was started */ setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); @@ -140,12 +140,13 @@ void MainWindow::init() noexcept { connect(version_thread, SIGNAL(finished()), version_thread, SLOT(deleteLater())); - connect(version_thread, - SIGNAL(upgradeVersion(const QString&, const QString&)), this, - SLOT(slotVersionUpgrade(const QString&, const QString&))); + connect(version_thread, &VersionCheckThread::upgradeVersion, this, + &MainWindow::slotVersionUpgrade); version_thread->start(); + #endif + } catch (...) { LOG(FATAL) << _("Critical error occur while loading GpgFrontend."); QMessageBox::critical(nullptr, _("Loading Failed"), diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index e0bf9f5a..f4eb70a8 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -421,7 +421,7 @@ class MainWindow : public QMainWindow { QAction* importKeyFromClipboardAct{}; QAction* importKeyFromKeyServerAct{}; - QLabel* statusBarIcon{}; /**< TODO */ + QLabel* statusBarIcon{}; KeyList* mKeyList{}; InfoBoardWidget* infoBoard{}; diff --git a/src/ui/help/AboutDialog.cpp b/src/ui/help/AboutDialog.cpp index 836c165e..72100713 100644 --- a/src/ui/help/AboutDialog.cpp +++ b/src/ui/help/AboutDialog.cpp @@ -42,7 +42,7 @@ AboutDialog::AboutDialog(int defaultIndex, QWidget* parent) : QDialog(parent) { tabWidget->addTab(updateTab, _("Update")); connect(tabWidget, &QTabWidget::currentChanged, this, - [&](int index) { qDebug() << "Current Index" << index; }); + [&](int index) { LOG(INFO) << "Current Index" << index; }); if (defaultIndex < tabWidget->count() && defaultIndex >= 0) { tabWidget->setCurrentIndex(defaultIndex); diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 205b9440..f1432196 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -91,7 +91,7 @@ void MainWindow::slotEncrypt() { auto resultAnalyse = EncryptResultAnalyse(error, std::move(result)); resultAnalyse.analyse(); process_result_analyse(edit, infoBoard, resultAnalyse); - + if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); #ifdef SMTP_SUPPORT @@ -538,15 +538,12 @@ void MainWindow::slotOpenFile(QString& path) { edit->slotOpenFile(path); } void MainWindow::slotVersionUpgrade(const QString& currentVersion, const QString& latestVersion) { + LOG(INFO) << _("called"); if (currentVersion < latestVersion) { - QMessageBox::warning( - this, _("Outdated Version"), - QString(_("This version(%1) is out of date, please update " - "the latest version in time. ")) - .arg(currentVersion) + - QString(_("You can download the latest version(%1) on " - "Github Releases Page.<br/>")) - .arg(latestVersion)); + statusBar()->showMessage( + QString(_("GpgFrontend Upgradeable (New Version: %1).")) + .arg(latestVersion), + 30000); } else if (currentVersion > latestVersion) { QMessageBox::warning( this, _("Unreleased Version"), diff --git a/third_party/AppImageUpdate b/third_party/AppImageUpdate new file mode 160000 +Subproject 1b97acc55c89f742d51c3849eb62eb58464d866 diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 0a43857b..f7c031b7 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,4 +1,13 @@ -if(ESAY_LOGGING_PP) - message(STATUS "Build EsayLoggingPP") +if (ESAY_LOGGING_PP) + message(STATUS "Build easyloggingpp") add_subdirectory(easyloggingpp) -endif()
\ No newline at end of file +endif () + +if (APP_IMAGE_UPDATE) + message(STATUS "Build AppImageUpdate") + set(USE_SYSTEM_BOOST 1) + set(USE_SYSTEM_XZ 1) + set(USE_SYSTEM_SQUASHFUSE 1) + set(USE_SYSTEM_LIBARCHIVE 1) + add_subdirectory(AppImageUpdate) +endif ()
\ No newline at end of file diff --git a/third_party/gpgme b/third_party/gpgme new file mode 160000 +Subproject ab1d4ef580794a86da754d516db35091f6997e2 diff --git a/third_party/libassuan b/third_party/libassuan new file mode 160000 +Subproject 335030e3d204afe33873df83c29302ff1caa021 diff --git a/third_party/libgpg-error b/third_party/libgpg-error new file mode 160000 +Subproject 220a427b4f997ef6af1b2d4e82ef1dc96e0cd6f |