Skip to content
Snippets Groups Projects
Commit c1df66f2 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk
Browse files

manual Revert "Revert "app Store: disable donations""

Appstore is refusing the donations-enabled build for now.

Change-Id: I16d9cc33ed577298565a5d92e0ee247ee54865a8
parent 721ea4b0
No related branches found
No related tags found
No related merge requests found
...@@ -798,6 +798,7 @@ else() ...@@ -798,6 +798,7 @@ else()
MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}") MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}")
if(APPSTORE) if(APPSTORE)
message(STATUS "app store version") message(STATUS "app store version")
add_definitions(-DAPPSTORE)
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/resources/entitlements/appstore/Jami.entitlements") XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/resources/entitlements/appstore/Jami.entitlements")
else() else()
......
...@@ -20,20 +20,21 @@ ...@@ -20,20 +20,21 @@
#pragma once #pragma once
#include "utils.h"
#include <QMetaEnum> #include <QMetaEnum>
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QStandardPaths> #include <QStandardPaths>
#include <QWindow> // for QWindow::AutomaticVisibility #include <QWindow> // for QWindow::AutomaticVisibility
#include <QSettings>
#include <QDir>
#include <QTranslator> #include <QTranslator>
extern const QString defaultDownloadPath; extern const QString defaultDownloadPath;
// clang-format off // clang-format off
#define KEYS \ // Common key-value pairs for both APPSTORE and non-APPSTORE builds
#define COMMON_KEYS \
X(MinimizeOnClose, false) \ X(MinimizeOnClose, false) \
X(DownloadPath, defaultDownloadPath) \ X(DownloadPath, defaultDownloadPath) \
X(ScreenshotPath, {}) \ X(ScreenshotPath, {}) \
...@@ -64,11 +65,19 @@ extern const QString defaultDownloadPath; ...@@ -64,11 +65,19 @@ extern const QString defaultDownloadPath;
X(ShowMardownOption, false) \ X(ShowMardownOption, false) \
X(ChatViewEnterIsNewLine, false) \ X(ChatViewEnterIsNewLine, false) \
X(ShowSendOption, false) \ X(ShowSendOption, false) \
X(Donation2023VisibleDate, "2023-11-27 05:00") \
X(IsDonationVisible, true) \
X(Donation2023EndDate, "2024-01-31 00:00") \
X(EnablePtt, false) \ X(EnablePtt, false) \
X(PttKeys, 32) X(PttKeys, 32)
#ifdef APPSTORE
#define KEYS COMMON_KEYS
#else
// Additional key-value pairs for non-APPSTORE builds including donation
// related settings.
#define KEYS COMMON_KEYS \
X(Donation2023VisibleDate, "2023-11-27 05:00") \
X(IsDonationVisible, true) \
X(Donation2023EndDate, "2024-01-31 00:00")
#endif
/* /*
* A class to expose settings keys in both c++ and QML. * A class to expose settings keys in both c++ and QML.
* Note: this is using a non-constructable class instead of a * Note: this is using a non-constructable class instead of a
...@@ -106,8 +115,9 @@ public: ...@@ -106,8 +115,9 @@ public:
default: return {}; default: return {};
} }
} }
private: private:
Settings() = delete; Settings() = delete;
}; };
Q_DECLARE_METATYPE(Settings::Key) Q_DECLARE_METATYPE(Settings::Key)
// clang-format on // clang-format on
......
...@@ -200,12 +200,19 @@ MainApplication::init() ...@@ -200,12 +200,19 @@ MainApplication::init()
auto startMinimizedSetting = settingsManager_->getValue(Settings::Key::StartMinimized).toBool(); auto startMinimizedSetting = settingsManager_->getValue(Settings::Key::StartMinimized).toBool();
// The presence of start URI should override the startMinimized setting for this instance. // The presence of start URI should override the startMinimized setting for this instance.
set_startMinimized(startMinimizedSetting && runOptions_[Option::StartUri].isNull()); set_startMinimized(startMinimizedSetting && runOptions_[Option::StartUri].isNull());
#ifdef WITH_WEBENGINE #ifdef WITH_WEBENGINE
engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(true)); engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(true));
#else #else
engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(false)); engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(false));
#endif #endif
#ifdef APPSTORE
engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(true));
#else
engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(false));
#endif
initQmlLayer(); initQmlLayer();
settingsManager_->setValue(Settings::Key::StartMinimized, settingsManager_->setValue(Settings::Key::StartMinimized,
......
...@@ -84,7 +84,7 @@ SettingsPageBase { ...@@ -84,7 +84,7 @@ SettingsPageBase {
ToggleSwitch { ToggleSwitch {
id: enableDonation id: enableDonation
Layout.fillWidth: true Layout.fillWidth: true
visible: new Date() >= new Date(Date.parse("2023-11-01")) visible: (new Date() >= new Date(Date.parse("2023-11-01")) && !APPSTORE)
checked: UtilsAdapter.getAppValue(Settings.Key.IsDonationVisible) checked: UtilsAdapter.getAppValue(Settings.Key.IsDonationVisible)
labelText: JamiStrings.enableDonation labelText: JamiStrings.enableDonation
......
...@@ -75,10 +75,13 @@ TipsModel::reset() ...@@ -75,10 +75,13 @@ TipsModel::reset()
beginResetModel(); beginResetModel();
tips_.clear(); tips_.clear();
#ifndef APPSTORE
QDate date = QDate::currentDate(); QDate date = QDate::currentDate();
if (date >= QDate::fromString("2023-11-27", "yyyy-MM-dd")) { if (date >= QDate::fromString("2023-11-27", "yyyy-MM-dd")) {
tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}}); tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}});
} }
#endif
tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}}); tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}});
tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}}); tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}});
tips_.append({{"id", "1"}, tips_.append({{"id", "1"},
......
...@@ -22,13 +22,15 @@ ...@@ -22,13 +22,15 @@
#pragma once #pragma once
#include <QApplication>
#include <QObject>
#include "qmladapterbase.h" #include "qmladapterbase.h"
#include "appsettingsmanager.h" #include "appsettingsmanager.h"
#include "qtutils.h" #include "qtutils.h"
#include <api/member.h>
#include <QApplication>
#include <QObject>
#if __has_include(<gio/gio.h>) #if __has_include(<gio/gio.h>)
#include <gio/gio.h> #include <gio/gio.h>
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment