aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt10
-rw-r--r--include/GpgFrontend.h.in12
-rw-r--r--src/MainWindow.cpp2
-rw-r--r--src/main.cpp2
-rwxr-xr-xsrc/ui/KeyMgmt.cpp2
-rw-r--r--src/ui/KeyServerImportDialog.cpp4
-rw-r--r--src/ui/KeyUploadDialog.cpp2
-rwxr-xr-xsrc/ui/SettingsDialog.cpp12
-rw-r--r--src/ui/Wizard.cpp6
-rw-r--r--src/ui/widgets/KeyList.cpp2
10 files changed, 34 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63155ed2..e4d8c954 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)
-project(GpgFrontend VERSION 1.1.0 LANGUAGES CXX)
+project(GpgFrontend VERSION 1.0.6 LANGUAGES CXX)
message(STATUS "GPGFrontend Build Configuration Started CMAKE Version ${CMAKE_VERSION}")
@@ -81,7 +81,7 @@ IF (MINGW)
message(STATUS "Configuration For OS Platform Microsoft Windows")
message(STATUS "Build Environment MINGW")
- set(OS_PLATFORM "WINDOWS")
+ set(OS_PLATFORM 0)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
@@ -99,7 +99,7 @@ if(APPLE)
message(STATUS "Configuration For OS Platform MacOS")
- set(OS_PLATFORM "MACOS")
+ set(OS_PLATFORM 1)
set(ENV{Qt5_DIR} /usr/local/opt/qt5/lib/cmake)
@@ -119,7 +119,7 @@ endif()
if(LINUX)
message(STATUS "Configuration For OS Platform LINUX")
- set(OS_PLATFORM "LINUX")
+ set(OS_PLATFORM 2)
include_directories(
include
@@ -135,6 +135,8 @@ if(LINUX)
endif()
+message(STATUS "OS_PLATFORM ${OS_PLATFORM}")
+
find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network LinguistTools REQUIRED)
add_subdirectory(src)
diff --git a/include/GpgFrontend.h.in b/include/GpgFrontend.h.in
index cec3be69..14aa3ec3 100644
--- a/include/GpgFrontend.h.in
+++ b/include/GpgFrontend.h.in
@@ -16,9 +16,14 @@
#include <gpgme.h>
+#define WINDOWS 0
+#define MACOS 1
+#define LINUX 2
+
#define PROJECT_NAME "@PROJECT_NAME@"
#define BUILD_VERSION "@BUILD_VERSION@"
#define GIT_VERSION "@GIT_VERSION@"
+#define OS_PLATFORM @OS_PLATFORM@
#define VERSION_MAJOR @CMAKE_PROJECT_VERSION_MAJOR@
#define VERSION_MINOR @CMAKE_PROJECT_VERSION_MINOR@
@@ -29,4 +34,11 @@
#define GIT_BRANCH_NAME "@GIT_BRANCH_NAME@"
#define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@"
+#if OS_PLATFORM == MACOS
+# define RESOURCE_DIR(appDir) (appDir + "../Resources/")
+#else
+# define RESOURCE_DIR(appDir) (appDir)
+#endif
+
+
#endif //GPGFRONTEND_H_IN \ No newline at end of file
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 6fa77e5a..67274a65 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -26,7 +26,7 @@
MainWindow::MainWindow()
: appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = new GpgME::GpgContext();
diff --git a/src/main.cpp b/src/main.cpp
index db11ee6f..04d109b7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -57,7 +57,7 @@ int main(int argc, char *argv[]) {
QDir().mkdir(appPath + "/conf");
}
QSettings::setDefaultFormat(QSettings::IniFormat);
- QSettings settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat);
+ QSettings settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat);
QTranslator translator, translator2;
int return_from_event_loop_code;
diff --git a/src/ui/KeyMgmt.cpp b/src/ui/KeyMgmt.cpp
index 6f9c64a2..0e2d9c9a 100755
--- a/src/ui/KeyMgmt.cpp
+++ b/src/ui/KeyMgmt.cpp
@@ -27,7 +27,7 @@
#include <utility>
KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QWidget *parent ) :
- QMainWindow(parent), appPath(qApp->applicationDirPath()), settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat)
+ QMainWindow(parent), appPath(qApp->applicationDirPath()), settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat)
{
mCtx = ctx;
diff --git a/src/ui/KeyServerImportDialog.cpp b/src/ui/KeyServerImportDialog.cpp
index bfa53cce..1999b443 100644
--- a/src/ui/KeyServerImportDialog.cpp
+++ b/src/ui/KeyServerImportDialog.cpp
@@ -29,7 +29,7 @@
KeyServerImportDialog::KeyServerImportDialog(GpgME::GpgContext *ctx, KeyList *keyList, bool automatic,
QWidget *parent)
: QDialog(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat),
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat),
mCtx(ctx), mKeyList(keyList), mAutomatic(automatic) {
if(automatic) {
@@ -442,7 +442,7 @@ void KeyServerImportDialog::setLoading(bool status) {
KeyServerImportDialog::KeyServerImportDialog(GpgME::GpgContext *ctx, QWidget *parent)
: QDialog(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat),
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat),
mCtx(ctx), mAutomatic(true) {
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
diff --git a/src/ui/KeyUploadDialog.cpp b/src/ui/KeyUploadDialog.cpp
index a81ed7a4..6ee6aa78 100644
--- a/src/ui/KeyUploadDialog.cpp
+++ b/src/ui/KeyUploadDialog.cpp
@@ -28,7 +28,7 @@
KeyUploadDialog::KeyUploadDialog(GpgME::GpgContext *ctx, const QVector<GpgKey> &keys, QWidget *parent)
: appPath(qApp->applicationDirPath()),
-settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat),
+settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat),
QDialog(parent) {
ctx->exportKeys(keys, mKeyData);
uploadKeyToServer(mKeyData);
diff --git a/src/ui/SettingsDialog.cpp b/src/ui/SettingsDialog.cpp
index 2c130497..8c85a208 100755
--- a/src/ui/SettingsDialog.cpp
+++ b/src/ui/SettingsDialog.cpp
@@ -122,7 +122,7 @@ QHash<QString, QString> SettingsDialog::listLanguages() {
GeneralTab::GeneralTab(GpgME::GpgContext *ctx, QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx;
/*****************************************
@@ -333,7 +333,7 @@ void GeneralTab::slotOwnKeyIdChanged() {
MimeTab::MimeTab(QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/*****************************************
* MIME-Parsing-Box
*****************************************/
@@ -404,7 +404,7 @@ void MimeTab::applySettings() {
AppearanceTab::AppearanceTab(QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/*****************************************
* Icon-Size-Box
*****************************************/
@@ -539,7 +539,7 @@ void AppearanceTab::applySettings() {
KeyserverTab::KeyserverTab(QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
auto keyServerList = settings.value("keyserver/keyServerList").toStringList();
@@ -611,7 +611,7 @@ void KeyserverTab::applySettings() {
AdvancedTab::AdvancedTab(QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/*****************************************
* Steganography Box
*****************************************/
@@ -641,7 +641,7 @@ void AdvancedTab::applySettings() {
GpgPathsTab::GpgPathsTab(QWidget *parent)
: QWidget(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
setSettings();
/*****************************************
diff --git a/src/ui/Wizard.cpp b/src/ui/Wizard.cpp
index c685cc92..b3236cfc 100644
--- a/src/ui/Wizard.cpp
+++ b/src/ui/Wizard.cpp
@@ -30,7 +30,7 @@
Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
: QWizard(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx;
mKeyMgmt = keyMgmt;
@@ -107,7 +107,7 @@ bool Wizard::importPubAndSecKeysFromDir(const QString &dir, KeyMgmt *keyMgmt) {
IntroPage::IntroPage(QWidget *parent)
: QWizardPage(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
setTitle(tr("Getting started..."));
setSubTitle(tr("... with GPGFrontend"));
@@ -202,7 +202,7 @@ void ChoosePage::slotJumpPage(const QString &page) {
ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
: QWizardPage(parent), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx;
mKeyMgmt = keyMgmt;
setTitle(tr("Import from..."));
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index 6982c3a2..581cc91c 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -31,7 +31,7 @@ KeyList::KeyList(GpgME::GpgContext *ctx,
KeyListColumn::InfoType infoType,
QWidget *parent)
: QWidget(parent), mSelectType(selectType), mInfoType(infoType), appPath(qApp->applicationDirPath()),
- settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat)
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat)
{
mCtx = ctx;