Skip to content
Snippets Groups Projects
Commit a4339743 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

app Store: disable donations

Change-Id: I359cf1cd538a87f12f0e931b8b2948cf1c721cce
parent 7a759dab
No related branches found
Tags nightly/20231030.1 stable/20231030.0
No related merge requests found
......@@ -788,6 +788,7 @@ else()
MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}")
if(APPSTORE)
message(STATUS "app store version")
add_definitions(-DAPPSTORE)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/resources/entitlements/appstore/Jami.entitlements")
else()
......
......@@ -33,6 +33,41 @@
extern const QString defaultDownloadPath;
// clang-format off
#ifdef APPSTORE
#define KEYS \
X(MinimizeOnClose, false) \
X(DownloadPath, defaultDownloadPath) \
X(ScreenshotPath, {}) \
X(EnableNotifications, true) \
X(EnableTypingIndicator, true) \
X(EnableReadReceipt, true) \
X(AcceptTransferBelow, 20) \
X(AutoAcceptFiles, true) \
X(DisplayHyperlinkPreviews, true) \
X(AppTheme, "System") \
X(BaseZoom, 1.0) \
X(ParticipantsSide, false) \
X(HideSelf, true) \
X(HideSpectators, false) \
X(AutoUpdate, true) \
X(PluginAutoUpdate, false) \
X(StartMinimized, false) \
X(ShowChatviewHorizontally, true) \
X(NeverShowMeAgain, false) \
X(WindowGeometry, QRectF(qQNaN(), qQNaN(), 0., 0.)) \
X(WindowState, QWindow::AutomaticVisibility) \
X(EnableExperimentalSwarm, false) \
X(LANG, "SYSTEM") \
X(PluginStoreEndpoint, "https://plugins.jami.net") \
X(PositionShareDuration, 15) \
X(PositionShareLimit, true) \
X(FlipSelf, true) \
X(ShowMardownOption, false) \
X(ChatViewEnterIsNewLine, false) \
X(ShowSendOption, false) \
X(EnablePtt, false) \
X(pttKey, 36)
#else
#define KEYS \
X(MinimizeOnClose, false) \
X(DownloadPath, defaultDownloadPath) \
......@@ -69,6 +104,8 @@ extern const QString defaultDownloadPath;
X(DonationEndDate, "2024-01-01 00:00") \
X(EnablePtt, false) \
X(pttKey, 36)
#endif
/*
* A class to expose settings keys in both c++ and QML.
* Note: this is using a non-constructable class instead of a
......
......@@ -106,7 +106,8 @@ ScreenInfo::onPhysicalDotsPerInchChanged()
}
MainApplication::MainApplication(int& argc, char** argv)
: QApplication(argc, argv), isCleanupped(false)
: QApplication(argc, argv)
, isCleanupped(false)
{
const char* qtVersion = qVersion();
qInfo() << "Using Qt runtime version:" << qtVersion;
......@@ -197,6 +198,12 @@ MainApplication::init()
engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(false));
#endif
#ifdef APPSTORE
engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(true));
#else
engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(false));
#endif
initQmlLayer();
settingsManager_->setValue(Settings::Key::StartMinimized,
......
......@@ -84,7 +84,7 @@ SettingsPageBase {
ToggleSwitch {
id: enableDonation
width: parent.width
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)
labelText: JamiStrings.enableDonation
......
......@@ -75,10 +75,13 @@ TipsModel::reset()
beginResetModel();
tips_.clear();
#ifndef APPSTORE
QDate date = QDate::currentDate();
if (date >= QDate::fromString("2023-11-01", "yyyy-MM-dd")) {
if (date >= QDate::fromString("2023-11-01", "yyyy-MM-dd") && false) {
tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}});
}
#endif
tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}});
tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}});
tips_.append({{"id", "1"},
......@@ -157,4 +160,4 @@ TipsModel::reset()
std::mt19937 g(rd());
std::shuffle(tips_.begin() + 2, tips_.end(), g);
endResetModel();
}
\ No newline at end of file
}
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