mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-02 06:35:29 +02:00
manual Revert "Revert "app Store: disable donations""
Appstore is refusing the donations-enabled build for now. Change-Id: I16d9cc33ed577298565a5d92e0ee247ee54865a8
This commit is contained in:
parent
721ea4b017
commit
c1df66f28d
6 changed files with 34 additions and 11 deletions
|
@ -798,6 +798,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()
|
||||
|
|
|
@ -20,20 +20,21 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <QMetaEnum>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStandardPaths>
|
||||
#include <QWindow> // for QWindow::AutomaticVisibility
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
|
||||
#include <QTranslator>
|
||||
|
||||
extern const QString defaultDownloadPath;
|
||||
|
||||
// clang-format off
|
||||
#define KEYS \
|
||||
// Common key-value pairs for both APPSTORE and non-APPSTORE builds
|
||||
#define COMMON_KEYS \
|
||||
X(MinimizeOnClose, false) \
|
||||
X(DownloadPath, defaultDownloadPath) \
|
||||
X(ScreenshotPath, {}) \
|
||||
|
@ -64,11 +65,19 @@ extern const QString defaultDownloadPath;
|
|||
X(ShowMardownOption, false) \
|
||||
X(ChatViewEnterIsNewLine, 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(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.
|
||||
* Note: this is using a non-constructable class instead of a
|
||||
|
@ -106,8 +115,9 @@ public:
|
|||
default: return {};
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Settings() = delete;
|
||||
Settings() = delete;
|
||||
};
|
||||
Q_DECLARE_METATYPE(Settings::Key)
|
||||
// clang-format on
|
||||
|
|
|
@ -200,12 +200,19 @@ MainApplication::init()
|
|||
auto startMinimizedSetting = settingsManager_->getValue(Settings::Key::StartMinimized).toBool();
|
||||
// The presence of start URI should override the startMinimized setting for this instance.
|
||||
set_startMinimized(startMinimizedSetting && runOptions_[Option::StartUri].isNull());
|
||||
|
||||
#ifdef WITH_WEBENGINE
|
||||
engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(true));
|
||||
#else
|
||||
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
|
||||
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)
|
||||
labelText: JamiStrings.enableDonation
|
||||
|
|
|
@ -75,10 +75,13 @@ TipsModel::reset()
|
|||
beginResetModel();
|
||||
tips_.clear();
|
||||
|
||||
#ifndef APPSTORE
|
||||
QDate date = QDate::currentDate();
|
||||
if (date >= QDate::fromString("2023-11-27", "yyyy-MM-dd")) {
|
||||
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"},
|
||||
|
|
|
@ -22,13 +22,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
|
||||
#include "qmladapterbase.h"
|
||||
#include "appsettingsmanager.h"
|
||||
#include "qtutils.h"
|
||||
|
||||
#include <api/member.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
|
||||
#if __has_include(<gio/gio.h>)
|
||||
#include <gio/gio.h>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue