Verified Commit aad9089c authored by Phobos D'thorga's avatar Phobos D'thorga 🐲
Browse files

Merge branch 'develop'

parents c44dc626 dbb4deb1
Pipeline #985 passed with stages
in 27 minutes and 29 seconds
...@@ -93,6 +93,10 @@ option(GFYRE_ENBL_CLANG_ADDRESS_SANITIZER "LLVM's AddressSanitizer is a fast mem ...@@ -93,6 +93,10 @@ option(GFYRE_ENBL_CLANG_ADDRESS_SANITIZER "LLVM's AddressSanitizer is a fast mem
option(BUILD_CODEC2_SUPPORT "Enable support for the 'Codec2' open source speech codec library." OFF) option(BUILD_CODEC2_SUPPORT "Enable support for the 'Codec2' open source speech codec library." OFF)
#
# Install / copy directory for CMake modules...
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/modules")
# #
# Detect if we are dealing with the Linux operating system and not Apple OS/X # Detect if we are dealing with the Linux operating system and not Apple OS/X
# #
...@@ -320,6 +324,19 @@ else() ...@@ -320,6 +324,19 @@ else()
message(FATAL_ERROR "The 'ICU' set of internationalization libraries culd not be found!") message(FATAL_ERROR "The 'ICU' set of internationalization libraries culd not be found!")
endif(ICU_FOUND) endif(ICU_FOUND)
#
# Curl by Daniel Stenberg
# https://github.com/curl/curl
#
find_package(CURL REQUIRED)
if (CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
set(LIBS ${LIBS} ${CURL_LIBRARIES})
message(STATUS "The 'libcurl' command-line tool and library for transferring network data has been configured!")
else()
message(FATAL_ERROR "The 'libcurl' command-line tool and library for transferring network data could not be found!")
endif(CURL_FOUND)
# #
# Nuspell # Nuspell
# https://nuspell.github.io/ # https://nuspell.github.io/
...@@ -424,13 +441,17 @@ endif(Vorbis_FOUND) ...@@ -424,13 +441,17 @@ endif(Vorbis_FOUND)
# QtSpell # QtSpell
# https://github.com/manisandro/qtspell # https://github.com/manisandro/qtspell
# #
find_package(QtSpell REQUIRED) if (LINUX)
if (QTSPELL_FOUND) find_package(QtSpell REQUIRED)
include_directories(${QTSPELL_INCLUDE_DIRS}) if (QTSPELL_FOUND)
set(LIBS ${LIBS} ${QTSPELL_LIBRARIES}) include_directories(${QTSPELL_INCLUDE_DIRS})
else() set(LIBS ${LIBS} ${QTSPELL_LIBRARIES})
message(STATUS "The 'QtSpell' spelling libraries have been configured!") add_definitions(-DGFYRE_ENBL_QTSPELL_LIBS)
endif(QTSPELL_FOUND) message(STATUS "The 'QtSpell' spelling libraries have been configured!")
else()
message(FATAL_ERROR "The 'QtSpell' spelling libraries could not be found!")
endif(QTSPELL_FOUND)
endif()
# #
# https://xiph.org/vorbis/ # https://xiph.org/vorbis/
...@@ -457,28 +478,21 @@ set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-c ...@@ -457,28 +478,21 @@ set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-c
# Sentry (Native SDK for C/C++) # Sentry (Native SDK for C/C++)
# https://github.com/getsentry/sentry-native # https://github.com/getsentry/sentry-native
# #
set(SENTRY_INTEGRATION_QT ON CACHE BOOL "Build Qt integration." FORCE)
set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" FORCE)
set(SENTRY_PIC ON CACHE BOOL "Build Sentry as a position independent library" FORCE) set(SENTRY_PIC ON CACHE BOOL "Build Sentry as a position independent library" FORCE)
set(SENTRY_EXPORT_SYMBOLS OFF CACHE BOOL "By default, sentry exposes all symbols in the dynamic symbol table. You might want to disable it in case the program intends to dlopen third-party shared libraries and avoid symbol collisions." FORCE)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(SENTRY_BUILD_RUNTIMESTATIC OFF CACHE BOOL "Disables linking with the static MSVC runtime. Has no effect if the compiler is not MSVC.") set(SENTRY_BUILD_RUNTIMESTATIC OFF CACHE BOOL "Disables linking with the static MSVC runtime. Has no effect if the compiler is not MSVC.")
endif() endif()
if (LINUX) #
# # Use Crashpad (and therefore the more modern crash reporting system) for all major operating systems based around the personal computer (Android, iOS, etc. and the like are therefore unsupported but we currently have no plans for the mobile market right now)...
# Currently Crashpad support on Linux via Sentry is very much unsupported as of the moment; see the link(s) down below... # A feature matrix can be seen here towards the bottom of the page: https://github.com/getsentry/sentry-native
# https://github.com/getsentry/sentry-native #
# https://github.com/getsentry/sentry-native/issues/46 set(SENTRY_BACKEND "crashpad" CACHE STRING "The type of crash manager to use." FORCE)
# set(SENTRY_CRASHPAD_SYSTEM OFF CACHE BOOL "This instructs the build system to use system-installed breakpad or crashpad libraries instead of using the in-tree version. This is generally not recommended for crashpad, as sentry uses a patched version that has attachment support.")
set(SENTRY_BACKEND "breakpad" CACHE STRING "The type of crash manager to use." FORCE) set(SENTRY_BREAKPAD_SYSTEM OFF CACHE BOOL "This instructs the build system to use system-installed breakpad or crashpad libraries instead of using the in-tree version. This is generally not recommended for crashpad, as sentry uses a patched version that has attachment support.")
set(SENTRY_BREAKPAD_SYSTEM OFF CACHE BOOL "This instructs the build system to use system-installed breakpad or crashpad libraries instead of using the in-tree version. This is generally not recommended for crashpad, as sentry uses a patched version that has attachment support.")
else()
#
# Use Crashpad for all other operating systems, since support for everything but Linux is okay as of the moment (with the exception of Android but we have no plans for that right now)...
#
set(SENTRY_BACKEND "crashpad" CACHE STRING "The type of crash manager to use." FORCE)
set(SENTRY_CRASHPAD_SYSTEM OFF CACHE BOOL "This instructs the build system to use system-installed breakpad or crashpad libraries instead of using the in-tree version. This is generally not recommended for crashpad, as sentry uses a patched version that has attachment support.")
endif()
set(SENTRY_BUILD_TESTS OFF CACHE BOOL "Build sentry-native tests. This is not required for the compilation of Small World Deluxe." FORCE) set(SENTRY_BUILD_TESTS OFF CACHE BOOL "Build sentry-native tests. This is not required for the compilation of Small World Deluxe." FORCE)
set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "Build sentry-native example(s). This is not required for the compilation of Small World Deluxe." FORCE) set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "Build sentry-native example(s). This is not required for the compilation of Small World Deluxe." FORCE)
...@@ -491,25 +505,6 @@ else() ...@@ -491,25 +505,6 @@ else()
set(SENTRY_TRANSPORT "curl" CACHE STRING "Please do not modify this." FORCE) set(SENTRY_TRANSPORT "curl" CACHE STRING "Please do not modify this." FORCE)
endif() endif()
#
# Curl by Daniel Stenberg
# https://github.com/curl/curl
#
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
set(CURL_LTO ON CACHE BOOL "Turn on compiler Link Time Optimizations for libcurl.")
set(HTTP_ONLY ON CACHE BOOL "Disables all protocols except HTTP (This overrides all CURL_DISABLE_* options).")
if (CMAKE_BUILD_TYPE MATCHES DEBUG)
set(ENABLE_DEBUG ON CACHE BOOL "Enable debug mode for libcurl.")
set(ENABLE_CURLDEBUG ON CACHE BOOL "Another flag for enabling debug mode with regards to libcurl.")
else()
set(ENABLE_DEBUG OFF CACHE BOOL "Enable debug mode for libcurl.")
set(ENABLE_CURLDEBUG OFF CACHE BOOL "Another flag for enabling debug mode with regards to libcurl.")
endif()
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/curl")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/curl/include")
message(STATUS "The 'libcurl' command-line tool and library for transferring network data has been configured!")
# #
# Google LevelDB [ https://github.com/google/leveldb ] # Google LevelDB [ https://github.com/google/leveldb ]
# #
...@@ -543,7 +538,6 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/kissfft") ...@@ -543,7 +538,6 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/kissfft")
message(STATUS "The 'KissFFT' fourier transform libraries have been configured!") message(STATUS "The 'KissFFT' fourier transform libraries have been configured!")
# #
# End of dictionaries
# #
# AudioFile by Adam Stark # AudioFile by Adam Stark
...@@ -959,23 +953,26 @@ target_link_libraries(smallworld PRIVATE galaxy) ...@@ -959,23 +953,26 @@ target_link_libraries(smallworld PRIVATE galaxy)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(GNUInstallDirs) include(GNUInstallDirs)
if (NOT LINUX) #
# # Copy the crashpad handler to the root of the binary build directory, for easy access!
# Copy the crashpad handler to the root of the binary build directory, for easy access! # https://cmake.org/cmake/help/latest/module/FetchContent.html
# https://cmake.org/cmake/help/latest/module/FetchContent.html # https://www.thetopsites.net/article/52110824.shtml
# https://www.thetopsites.net/article/52110824.shtml #
# if(WIN32 OR MSYS OR MINGW)
if(WIN32 OR MSYS OR MINGW) add_custom_command(TARGET smallworld
add_custom_command(TARGET smallworld POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/src/contrib/sentry-native/crashpad_build/handler/crashpad_handler.exe
${CMAKE_CURRENT_BINARY_DIR}/src/contrib/sentry-native/crashpad_build/handler/crashpad_handler.exe ${CMAKE_CURRENT_BINARY_DIR}/crashpad_handler.exe)
${CMAKE_CURRENT_BINARY_DIR}/crashpad_handler.exe) else()
else() add_custom_command(TARGET smallworld
add_custom_command(TARGET smallworld POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/src/contrib/sentry-native/crashpad_build/handler/crashpad_handler
${CMAKE_CURRENT_BINARY_DIR}/src/contrib/sentry-native/crashpad_build/handler/crashpad_handler ${CMAKE_CURRENT_BINARY_DIR}/crashpad_handler)
${CMAKE_CURRENT_BINARY_DIR}/crashpad_handler)
endif() add_custom_command(TARGET smallworld
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/src/contrib/sentry-native/crashpad_build/handler/libcrashpad_handler_lib.a
${CMAKE_CURRENT_BINARY_DIR}/libcrashpad_handler_lib.a)
endif() endif()
INSTALL(TARGETS smallworld) INSTALL(TARGETS smallworld)
......
Subproject commit 1f91bdb7a680d67e4e9387f7916cf51e8f35c474 Subproject commit 645717241f4a952d05eab50e1bfb990a3d3d8b53
Subproject commit 61693dbaf80d3e9f41dffd3b87cf7245095600a6 Subproject commit 1c046603d9c61e1790a80ac2f8fb80c255152225
...@@ -324,16 +324,17 @@ namespace General { ...@@ -324,16 +324,17 @@ namespace General {
constexpr char companyNameMin[] = "GekkoFyre"; constexpr char companyNameMin[] = "GekkoFyre";
constexpr char productName[] = "Small World Deluxe"; constexpr char productName[] = "Small World Deluxe";
constexpr char executableName[] = "smallworld"; constexpr char executableName[] = "smallworld";
constexpr char appVersion[] = "0.0.1"; constexpr char appVersion[] = "0.0.1"; // TODO: Make sure to update this upon every release/revision change!
constexpr char appRelease[] = "Pre-alpha"; constexpr char appRelease[] = "Pre-alpha"; // TODO: The same as the immediate above also applies to this line!
constexpr char xmppVersion[] = "Alpha"; constexpr char xmppVersion[] = "Alpha"; // TODO: And to this as well!
constexpr char xmppResourceGFyre[] = "GekkoFyre"; constexpr char xmppResourceGFyre[] = "GekkoFyre";
constexpr char codeRepository[] = "https://code.gekkofyre.io/amateur-radio/small-world-deluxe"; constexpr char codeRepository[] = "https://code.gekkofyre.io/amateur-radio/small-world-deluxe";
constexpr char officialWebsite[] = "https://swdeluxe.io/"; constexpr char officialWebsite[] = "https://swdeluxe.io/";
constexpr char gk_sentry_uri[] = "https://2c7b92c7437b4728a2856a6ca71ddbe6@sentry.gekkofyre.io/2"; constexpr char gk_sentry_dsn_uri[] = "https://2c7b92c7437b4728a2856a6ca71ddbe6@sentry.gekkofyre.io/2";
constexpr char gk_sentry_user_side_uri[] = "https://sentry.gekkofyre.io/"; constexpr char gk_sentry_user_side_uri[] = "https://sentry.gekkofyre.io/";
constexpr char gk_sentry_env[] = "development"; constexpr char gk_sentry_env[] = "development"; // TODO: Make sure to change this upon releasing a proper version of Small World Deluxe!
constexpr char gk_sentry_project_name[] = "small-world-deluxe"; // The actual name of the project as it is both registered and appears within Sentry itself; it is critical that this is set correctly!
namespace Xmpp { namespace Xmpp {
constexpr char captchaNamespace[] = "urn:xmpp:captcha"; constexpr char captchaNamespace[] = "urn:xmpp:captcha";
...@@ -359,15 +360,16 @@ namespace Filesystem { ...@@ -359,15 +360,16 @@ namespace Filesystem {
// //
// Nuspell & Spelling dictionaries // Nuspell & Spelling dictionaries
constexpr char nuspellLibraryDir[] = "Library"; // The 'Library' dir which is used by the Nuspell libs constexpr char nuspellLibraryDir[] = "Library"; // The 'Library' dir which is used by the Nuspell libs
constexpr char nuspellSpellDir[] = "Spelling"; // The 'Spelling' dir, present underneath 'Library', which is used by the Nuspell libs constexpr char nuspellSpellDir[] = "Spelling"; // The 'Spelling' dir, present underneath 'Library', which is used by the Nuspell libs
constexpr char nuspellSpellDic[] = "index"; // The *.dic and *.aff file for Nuspell dictionaries constexpr char nuspellSpellDic[] = "index"; // The *.dic and *.aff file for Nuspell dictionaries
constexpr char enchantSpellDefLang[] = "en_US"; // The default dictionary language to use for Nuspell constexpr char enchantSpellDefLang[] = "en_US"; // The default dictionary language to use for Nuspell
// //
// User interface language // User interface language
constexpr char userInterfaceDefLang[] = "English (Generic)"; // The default language choice for the User Interface itself constexpr char userInterfaceDefLang[] = "English (Generic)"; // The default language choice for the User Interface itself
constexpr char gk_sentry_dump_endpoint[] = "https://sentry.gekkofyre.io/api/2/minidump/?sentry_key=2c7b92c7437b4728a2856a6ca71ddbe6"; // [ Minidump Endpoint ] Use this endpoint to upload minidump crash reports, for example with Electron, Crashpad or Breakpad
constexpr char gk_sentry_dump_dir[] = "crash-db"; // The directory for where any possible memory dumps and crash analyses will have to live!S constexpr char gk_sentry_dump_dir[] = "crash-db"; // The directory for where any possible memory dumps and crash analyses will have to live!S
constexpr char gk_sentry_dump_file_ext[] = ".log"; // The file extension for memory-dumps (i.e. 'minidumps') as generated by Crashpad for Sentry. constexpr char gk_sentry_dump_file_ext[] = ".log"; // The file extension for memory-dumps (i.e. 'minidumps') as generated by Crashpad for Sentry.
constexpr char gk_crashpad_handler_win[] = "crashpad_handler.exe"; // The name of the Crashpad handler executable under Microsoft Windows operating systems. constexpr char gk_crashpad_handler_win[] = "crashpad_handler.exe"; // The name of the Crashpad handler executable under Microsoft Windows operating systems.
......
...@@ -137,10 +137,6 @@ GkEventLogger::GkEventLogger(const QPointer<QSystemTrayIcon> &sysTrayIcon, const ...@@ -137,10 +137,6 @@ GkEventLogger::GkEventLogger(const QPointer<QSystemTrayIcon> &sysTrayIcon, const
GkEventLogger::~GkEventLogger() GkEventLogger::~GkEventLogger()
{ {
// Clear any memory used by Sentry & Crashpad before making sure the process itself terminates!
sentry_shutdown();
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
return; return;
} }
......
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
#include <QMessageBox> #include <QMessageBox>
#include <QtGlobal> #include <QtGlobal>
#if defined(_WIN32) || defined(__MINGW64__) || defined(__CYGWIN__)
#include <initguid.h>
#include <netlistmgr.h>
#endif
using namespace GekkoFyre; using namespace GekkoFyre;
using namespace Database; using namespace Database;
using namespace Settings; using namespace Settings;
...@@ -69,6 +74,55 @@ GkSystem::~GkSystem() ...@@ -69,6 +74,55 @@ GkSystem::~GkSystem()
return; return;
} }
/**
* @brief GkSystem::isInternetAvailable checks the connectivity of the user's own, local computer/machine and determines
* if an Internet connection is readily available. If so, returns true but otherwise, it will return false. This works
* for both Microsoft Windows and Linux operating systems.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @return A true boolean value will be returned if a readily available Internet connection is usable on the user's own,
* local machine but otherwise, a false boolean value will be returned.
*/
bool GkSystem::isInternetAvailable() {
#if defined(_WIN32) || defined(__MINGW64__) || defined(__CYGWIN__)
std::unique_ptr<INetworkListManager> inlm;
HRESULT hr = CoCreateInstance(CLSID_NetworkListManager, nullptr, CLSCTX_ALL, IID_INetworkListManager, (LPVOID *)&inlm);
if (SUCCEEDED(hr)) {
NLM_CONNECTIVITY con;
hr = inlm->GetConnectivity(&con);
if (hr == S_OK) {
if (con & NLM_CONNECTIVITY_IPV4_INTERNET || con & NLM_CONNECTIVITY_IPV6_INTERNET) {
return true;
} else {
return false;
}
}
return true;
}
#elif __linux__
//
// TODO: Insert a check to see that `/sbin/route` is at all installed on the end-user's computer/machine, instead of blindly
// running the command and hoping for the best!
//
FILE *output;
if (!(output = popen("/sbin/route -n | grep -c '^0\\.0\\.0\\.0'", "r"))) {
return true;
}
unsigned int i;
fscanf(output, "%u", &i);
pclose(output);
if (i == 0) {
return false;
} else {
return true;
}
#endif
return false;
}
/** /**
* @brief GkSystem::getNumCpuCores will get the number of CPU cores on the host machine and return it as an integer, in a semi-multiplatform * @brief GkSystem::getNumCpuCores will get the number of CPU cores on the host machine and return it as an integer, in a semi-multiplatform
* manner. * manner.
......
...@@ -67,6 +67,7 @@ public: ...@@ -67,6 +67,7 @@ public:
explicit GkSystem(QPointer<GekkoFyre::StringFuncs> stringFuncs, QObject *parent = nullptr); explicit GkSystem(QPointer<GekkoFyre::StringFuncs> stringFuncs, QObject *parent = nullptr);
~GkSystem() override; ~GkSystem() override;
bool isInternetAvailable();
qint32 getNumCpuCores(); qint32 getNumCpuCores();
QString renameCommsDevice(const qint32 &port, const GekkoFyre::AmateurRadio::GkConnType &conn_type); QString renameCommsDevice(const qint32 &port, const GekkoFyre::AmateurRadio::GkConnType &conn_type);
......
...@@ -133,6 +133,8 @@ GkEventLoggerTableViewModel::~GkEventLoggerTableViewModel() ...@@ -133,6 +133,8 @@ GkEventLoggerTableViewModel::~GkEventLoggerTableViewModel()
sentry_event_value_add_stacktrace(capture_logger_exit, nullptr, 0); sentry_event_value_add_stacktrace(capture_logger_exit, nullptr, 0);
sentry_capture_event(capture_logger_exit); sentry_capture_event(capture_logger_exit);
// Clear any memory used by Sentry & Crashpad before making sure the process itself terminates...
sentry_shutdown(); // TODO: Replace with, `sentry_close()`, upon updating Sentry in the future!
return; return;
} }
......
...@@ -304,7 +304,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -304,7 +304,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
enableSentry = gkDb->read_sentry_settings(GkSentry::GivenConsent); enableSentry = gkDb->read_sentry_settings(GkSentry::GivenConsent);
} }
if (enableSentry) { if (enableSentry && gkSystem->isInternetAvailable()) { // Check that both Sentry is explicitly enabled and that the end-user is connected towards the Internet to begin with!
// //
// Initialize Sentry! // Initialize Sentry!
// https://blog.sentry.io/2019/09/26/fixing-native-apps-with-sentry // https://blog.sentry.io/2019/09/26/fixing-native-apps-with-sentry
...@@ -312,7 +312,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -312,7 +312,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// //
sen_opt = sentry_options_new(); sen_opt = sentry_options_new();
#ifndef __linux__ //
// File and directory paths relating to usage of Crashpad...
const QString curr_path = QDir::currentPath(); const QString curr_path = QDir::currentPath();
const fs::path crashpad_handler_windows = fs::path(curr_path.toStdString() + native_slash.string() + Filesystem::gk_crashpad_handler_win); const fs::path crashpad_handler_windows = fs::path(curr_path.toStdString() + native_slash.string() + Filesystem::gk_crashpad_handler_win);
const fs::path crashpad_handler_linux = fs::path(curr_path.toStdString() + native_slash.string() + Filesystem::gk_crashpad_handler_linux); const fs::path crashpad_handler_linux = fs::path(curr_path.toStdString() + native_slash.string() + Filesystem::gk_crashpad_handler_linux);
...@@ -330,7 +331,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -330,7 +331,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// The handler is a Crashpad-specific background process // The handler is a Crashpad-specific background process
sentry_options_set_handler_path(sen_opt, handler_to_use.string().c_str()); sentry_options_set_handler_path(sen_opt, handler_to_use.string().c_str());
#endif
const fs::path sentry_crash_dir = fs::path(Filesystem::defaultDirAppend + native_slash.string() + Filesystem::gk_sentry_dump_dir); const fs::path sentry_crash_dir = fs::path(Filesystem::defaultDirAppend + native_slash.string() + Filesystem::gk_sentry_dump_dir);
const fs::path gk_minidump = gkFileIo->defaultDirectory(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation), const fs::path gk_minidump = gkFileIo->defaultDirectory(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation),
...@@ -355,10 +355,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -355,10 +355,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// Release information // Release information
sentry_options_set_environment(sen_opt, General::gk_sentry_env); sentry_options_set_environment(sen_opt, General::gk_sentry_env);
sentry_options_set_release(sen_opt, General::appVersion); sentry_options_set_release(sen_opt, QString("%1@%2")
.arg(QString::fromStdString(General::gk_sentry_project_name))
.arg(QString::fromStdString(General::appVersion))
.toStdString().c_str());
// Server and URI details! // Server and URI details!
sentry_options_set_dsn(sen_opt, General::gk_sentry_uri); sentry_options_set_dsn(sen_opt, General::gk_sentry_dsn_uri);
// Initialize the SDK and start the Crashpad/Breakpad handler // Initialize the SDK and start the Crashpad/Breakpad handler
sentry_init(sen_opt); sentry_init(sen_opt);
...@@ -401,7 +404,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -401,7 +404,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
QObject::connect(gkEventLogger, SIGNAL(removeEvent(const GekkoFyre::System::Events::Logging::GkEventLogging &)), QObject::connect(gkEventLogger, SIGNAL(removeEvent(const GekkoFyre::System::Events::Logging::GkEventLogging &)),
gkEventLoggerModel, SLOT(removeData(const GekkoFyre::System::Events::Logging::GkEventLogging &))); gkEventLoggerModel, SLOT(removeData(const GekkoFyre::System::Events::Logging::GkEventLogging &)));
gkEventLogger->publishEvent(tr("Events log initiated."), GkSeverity::Info); gkEventLogger->publishEvent(tr("Events log initiated."), GkSeverity::Info, false, true, true, false);
if (enableSentry) {
sentry_start_session();
sentry_reinstall_backend();
gkEventLogger->publishEvent(tr("Exception and crash monitoring as enabled by Sentry is now active."), GkSeverity::Info, false, true, false, false);
}
// Initialize the Radio Database pointer! // Initialize the Radio Database pointer!
if (gkRadioPtr == nullptr) { if (gkRadioPtr == nullptr) {
...@@ -863,7 +871,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ...@@ -863,7 +871,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// //
QPointer<GkPlainTextSubmit> widget_mesg_outgoing = new GkPlainTextSubmit(ui->frame_mesg_log); QPointer<GkPlainTextSubmit> widget_mesg_outgoing = new GkPlainTextSubmit(ui->frame_mesg_log);
ui->verticalLayout_3->addWidget(widget_mesg_outgoing); ui->verticalLayout_3->addWidget(widget_mesg_outgoing);
#ifdef GFYRE_ENBL_QTSPELL_LIBS
m_spellChecker->setTextEdit(widget_mesg_outgoing); m_spellChecker->setTextEdit(widget_mesg_outgoing);
#endif
widget_mesg_outgoing->setTabChangesFocus(true); widget_mesg_outgoing->setTabChangesFocus(true);
widget_mesg_outgoing->setPlaceholderText(tr("Enter your outgoing messages here...")); widget_mesg_outgoing->setPlaceholderText(tr("Enter your outgoing messages here..."));
QObject::connect(widget_mesg_outgoing, SIGNAL(execFuncAfterEvent(const QString &)), QObject::connect(widget_mesg_outgoing, SIGNAL(execFuncAfterEvent(const QString &)),
...@@ -2193,13 +2203,17 @@ void MainWindow::readEnchantSettings() ...@@ -2193,13 +2203,17 @@ void MainWindow::readEnchantSettings()
curr_chosen_dict = Filesystem::enchantSpellDefLang; // Default language dictionary to use if none has been specified! curr_chosen_dict = Filesystem::enchantSpellDefLang; // Default language dictionary to use if none has been specified!
} }
#ifdef GFYRE_ENBL_QTSPELL_LIBS
m_spellChecker = new QtSpell::TextEditChecker(this); m_spellChecker = new QtSpell::TextEditChecker(this);
m_spellChecker->setDecodeLanguageCodes(true); m_spellChecker->setDecodeLanguageCodes(true);
m_spellChecker->setShowCheckSpellingCheckbox(true); m_spellChecker->setShowCheckSpellingCheckbox(true);
m_spellChecker->setUndoRedoEnabled(true); m_spellChecker->setUndoRedoEnabled(true);
#endif
if (!curr_chosen_dict.isEmpty()) { if (!curr_chosen_dict.isEmpty()) {
#ifdef GFYRE_ENBL_QTSPELL_LIBS
m_spellChecker->setLanguage(curr_chosen_dict); m_spellChecker->setLanguage(curr_chosen_dict);
#endif
} }
} catch (const std::exception &e) { } catch (const std::exception &e) {
std::throw_with_nested(std::runtime_error(e.what())); std::throw_with_nested(std::runtime_error(e.what()));
......
...@@ -474,7 +474,11 @@ private: ...@@ -474,7 +474,11 @@ private:
// //
// Spell-checking, dictionaries, etc. // Spell-checking, dictionaries, etc.
// //
#ifdef GFYRE_ENBL_QTSPELL_LIBS
QPointer<QtSpell::TextEditChecker> m_spellChecker; QPointer<QtSpell::TextEditChecker> m_spellChecker;
#else
void *m_spellChecker;
#endif
// //
// QFileDialog related // QFileDialog related
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment