diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e70d9226a84a456f6c4719ad5df296aa82baae9..02b372fb60b60d76f124bcc768e3ea22c6620232 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/src/app/appsettingsmanager.h b/src/app/appsettingsmanager.h index 099db20ced8142f7bdbca984591466695d89361b..7a9230908dcad04c75af25e450cf2c4bdaabb9cf 100644 --- a/src/app/appsettingsmanager.h +++ b/src/app/appsettingsmanager.h @@ -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 diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 5f5c485be6c936ab1275bad8daf6f54ed578a7e2..1aef171821d9455b33c221bcf5d3337b1e905e6e 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -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, diff --git a/src/app/settingsview/components/SystemSettingsPage.qml b/src/app/settingsview/components/SystemSettingsPage.qml index abc4721362a144979bee2ff9b0ad2c277ee1a4d1..5d0c9873359c002f946b42f42e4e118f0954f22e 100644 --- a/src/app/settingsview/components/SystemSettingsPage.qml +++ b/src/app/settingsview/components/SystemSettingsPage.qml @@ -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 diff --git a/src/app/tipsmodel.cpp b/src/app/tipsmodel.cpp index 0759ec8e72bd5045fdc72832e2fc9ab07b8f722c..a3a85fad5d2547738866593f7a4e29b936954f86 100644 --- a/src/app/tipsmodel.cpp +++ b/src/app/tipsmodel.cpp @@ -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 +}