A image/assets/certification_info/Deutsch/sar.txt => image/assets/certification_info/Deutsch/sar.txt +31 -0
@@ 0,0 1,31 @@
+<text font='gt_pressura' weight='regular' size='27' align='left'>
+<p>THE EQUIPMENT MEETS INTERNATIONAL REQUIREMENTS FOR EXPOSURE TO RADIO WAVES. The mobile phone is a radio frequency receiver/transmitter.</p>
+<br></br>
+<p>Mudita Pure has been designed to minimize exposure to radio waves (radio frequency electromagnetic fields) as defined by international guidelines, while maintaining signal integrity. These guidelines have been developed by an independent scientific institution (ICNIRP) and provide a basic safety margin to ensure the safety of all users regardless of age or health.</p>
+<br></br>
+<p>Exposure to radio waves is expressed in a rate called Specific Absorption Rate (SAR).</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='32' align='left'><p>The maximum SAR value for Mudita Pure:</p></text>
+<text font='gt_pressura' weight='bold' size='27' align='left'>1,6 W/kg </text><text font='gt_pressura' weight='regular' size='27' align='left'>(over 1 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>American Standard ANSI C95.1 (ANSI 1992)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='27' align='left'>2,0 W/kg</text> <text font='gt_pressura' weight='regular' size='27' align='left'>(over 10 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>ICNIRP Guidelines 1998 (ICNIRP 1998)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p>
+<br></br>
+<p>During use, the actual SAR values for this device are significantly lower than those given above, because the power consumption of the mobile phone is automatically reduced if full power is not required to make a call, due to system performance and minimized network interference. The lower the power consumption of this device, the lower the SAR value.</p>
+<br></br>
+<p>Our solution uses 2 antennas with dedicated shielding and specially written software to minimize exposure to radio waves.</p>
+<p>The antennas switch to the one with better parameters to minimize SAR, but also to keep signal integrity. When scanning the network (what the modem does automatically) we get information which band has what signal level, comparing it to the maximum SAR values measured in a certified laboratory, we know which antenna to choose. Due to the characteristics of the antenna, one works better in low bands, the other one in high bands. However, often in bands which operate together with good parameters, we choose the one with lower SAR. In the worst case scenario, we will not exceed 0.2 [W/Kg].</p>
+<br></br>
+<p>The SAR value of the phone was tested with the phone used at a distance of 0 mm. That is, right next to the head, as most people use the phone. Thanks to our patented solutions, you don't have to do anything to meet the requirements for exposure to radio waves when using the phone. However, we support what organizations, such as the WHO (World Health Organization) and the US Food and Drug Administration, have concluded, that the best way to reduce exposure is to use headsets, to keep the phone away from the head and body during conversations, and to reduce the time spent on making phone calls.</p>
+<br></br>
+<p>For more information on how to reduce your exposure to electromagnetic fields, visit Mudita's blog.</p>
+<br></br>
+<p>The phone has an internal antenna. Do not touch it. When using other accessories, make sure that the product you are using is metal-free.</p>
+<br></br>
+<p>The phone must comply with international guidelines (ICNIRP) or European Directive 2014/53/EU (RED) before it can be sold. The essential requirement of the guidelines and directive is the safety of the phone user and others.</p>
+</text>
A image/assets/certification_info/English/sar.txt => image/assets/certification_info/English/sar.txt +31 -0
@@ 0,0 1,31 @@
+<text font='gt_pressura' weight='regular' size='27' align='left'>
+<p>THE EQUIPMENT MEETS INTERNATIONAL REQUIREMENTS FOR EXPOSURE TO RADIO WAVES. The mobile phone is a radio frequency receiver/transmitter.</p>
+<br></br>
+<p>Mudita Pure has been designed to minimize exposure to radio waves (radio frequency electromagnetic fields) as defined by international guidelines, while maintaining signal integrity. These guidelines have been developed by an independent scientific institution (ICNIRP) and provide a basic safety margin to ensure the safety of all users regardless of age or health.</p>
+<br></br>
+<p>Exposure to radio waves is expressed in a rate called Specific Absorption Rate (SAR).</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='32' align='left'><p>The maximum SAR value for Mudita Pure:</p></text>
+<text font='gt_pressura' weight='bold' size='27' align='left'>1,6 W/kg </text><text font='gt_pressura' weight='regular' size='27' align='left'>(over 1 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>American Standard ANSI C95.1 (ANSI 1992)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='27' align='left'>2,0 W/kg</text> <text font='gt_pressura' weight='regular' size='27' align='left'>(over 10 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>ICNIRP Guidelines 1998 (ICNIRP 1998)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p>
+<br></br>
+<p>During use, the actual SAR values for this device are significantly lower than those given above, because the power consumption of the mobile phone is automatically reduced if full power is not required to make a call, due to system performance and minimized network interference. The lower the power consumption of this device, the lower the SAR value.</p>
+<br></br>
+<p>Our solution uses 2 antennas with dedicated shielding and specially written software to minimize exposure to radio waves.</p>
+<p>The antennas switch to the one with better parameters to minimize SAR, but also to keep signal integrity. When scanning the network (what the modem does automatically) we get information which band has what signal level, comparing it to the maximum SAR values measured in a certified laboratory, we know which antenna to choose. Due to the characteristics of the antenna, one works better in low bands, the other one in high bands. However, often in bands which operate together with good parameters, we choose the one with lower SAR. In the worst case scenario, we will not exceed 0.2 [W/Kg].</p>
+<br></br>
+<p>The SAR value of the phone was tested with the phone used at a distance of 0 mm. That is, right next to the head, as most people use the phone. Thanks to our patented solutions, you don't have to do anything to meet the requirements for exposure to radio waves when using the phone. However, we support what organizations, such as the WHO (World Health Organization) and the US Food and Drug Administration, have concluded, that the best way to reduce exposure is to use headsets, to keep the phone away from the head and body during conversations, and to reduce the time spent on making phone calls.</p>
+<br></br>
+<p>For more information on how to reduce your exposure to electromagnetic fields, visit Mudita's blog.</p>
+<br></br>
+<p>The phone has an internal antenna. Do not touch it. When using other accessories, make sure that the product you are using is metal-free.</p>
+<br></br>
+<p>The phone must comply with international guidelines (ICNIRP) or European Directive 2014/53/EU (RED) before it can be sold. The essential requirement of the guidelines and directive is the safety of the phone user and others.</p>
+</text>
A image/assets/certification_info/Espanol/sar.txt => image/assets/certification_info/Espanol/sar.txt +31 -0
@@ 0,0 1,31 @@
+<text font='gt_pressura' weight='regular' size='27' align='left'>
+<p>THE EQUIPMENT MEETS INTERNATIONAL REQUIREMENTS FOR EXPOSURE TO RADIO WAVES. The mobile phone is a radio frequency receiver/transmitter.</p>
+<br></br>
+<p>Mudita Pure has been designed to minimize exposure to radio waves (radio frequency electromagnetic fields) as defined by international guidelines, while maintaining signal integrity. These guidelines have been developed by an independent scientific institution (ICNIRP) and provide a basic safety margin to ensure the safety of all users regardless of age or health.</p>
+<br></br>
+<p>Exposure to radio waves is expressed in a rate called Specific Absorption Rate (SAR).</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='32' align='left'><p>The maximum SAR value for Mudita Pure:</p></text>
+<text font='gt_pressura' weight='bold' size='27' align='left'>1,6 W/kg </text><text font='gt_pressura' weight='regular' size='27' align='left'>(over 1 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>American Standard ANSI C95.1 (ANSI 1992)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='27' align='left'>2,0 W/kg</text> <text font='gt_pressura' weight='regular' size='27' align='left'>(over 10 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>ICNIRP Guidelines 1998 (ICNIRP 1998)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p>
+<br></br>
+<p>During use, the actual SAR values for this device are significantly lower than those given above, because the power consumption of the mobile phone is automatically reduced if full power is not required to make a call, due to system performance and minimized network interference. The lower the power consumption of this device, the lower the SAR value.</p>
+<br></br>
+<p>Our solution uses 2 antennas with dedicated shielding and specially written software to minimize exposure to radio waves.</p>
+<p>The antennas switch to the one with better parameters to minimize SAR, but also to keep signal integrity. When scanning the network (what the modem does automatically) we get information which band has what signal level, comparing it to the maximum SAR values measured in a certified laboratory, we know which antenna to choose. Due to the characteristics of the antenna, one works better in low bands, the other one in high bands. However, often in bands which operate together with good parameters, we choose the one with lower SAR. In the worst case scenario, we will not exceed 0.2 [W/Kg].</p>
+<br></br>
+<p>The SAR value of the phone was tested with the phone used at a distance of 0 mm. That is, right next to the head, as most people use the phone. Thanks to our patented solutions, you don't have to do anything to meet the requirements for exposure to radio waves when using the phone. However, we support what organizations, such as the WHO (World Health Organization) and the US Food and Drug Administration, have concluded, that the best way to reduce exposure is to use headsets, to keep the phone away from the head and body during conversations, and to reduce the time spent on making phone calls.</p>
+<br></br>
+<p>For more information on how to reduce your exposure to electromagnetic fields, visit Mudita's blog.</p>
+<br></br>
+<p>The phone has an internal antenna. Do not touch it. When using other accessories, make sure that the product you are using is metal-free.</p>
+<br></br>
+<p>The phone must comply with international guidelines (ICNIRP) or European Directive 2014/53/EU (RED) before it can be sold. The essential requirement of the guidelines and directive is the safety of the phone user and others.</p>
+</text>
A image/assets/certification_info/Polski/sar.txt => image/assets/certification_info/Polski/sar.txt +31 -0
@@ 0,0 1,31 @@
+<text font='gt_pressura' weight='regular' size='27' align='left'>
+<p>THE EQUIPMENT MEETS INTERNATIONAL REQUIREMENTS FOR EXPOSURE TO RADIO WAVES. The mobile phone is a radio frequency receiver/transmitter.</p>
+<br></br>
+<p>Mudita Pure has been designed to minimize exposure to radio waves (radio frequency electromagnetic fields) as defined by international guidelines, while maintaining signal integrity. These guidelines have been developed by an independent scientific institution (ICNIRP) and provide a basic safety margin to ensure the safety of all users regardless of age or health.</p>
+<br></br>
+<p>Exposure to radio waves is expressed in a rate called Specific Absorption Rate (SAR).</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='32' align='left'><p>The maximum SAR value for Mudita Pure:</p></text>
+<text font='gt_pressura' weight='bold' size='27' align='left'>1,6 W/kg </text><text font='gt_pressura' weight='regular' size='27' align='left'>(over 1 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>American Standard ANSI C95.1 (ANSI 1992)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p></text>
+<br></br>
+<text font='gt_pressura' weight='bold' size='27' align='left'>2,0 W/kg</text> <text font='gt_pressura' weight='regular' size='27' align='left'>(over 10 g) SAR Limit</text><br></br>
+<text font='gt_pressura' weight='regular' size='27' align='left' color='9'><p>ICNIRP Guidelines 1998 (ICNIRP 1998)</p></text>
+<text font='gt_pressura' weight='regular' size='27' align='left'><p>Head: 0,08</p>
+<p>Body: 0,08</p>
+<br></br>
+<p>During use, the actual SAR values for this device are significantly lower than those given above, because the power consumption of the mobile phone is automatically reduced if full power is not required to make a call, due to system performance and minimized network interference. The lower the power consumption of this device, the lower the SAR value.</p>
+<br></br>
+<p>Our solution uses 2 antennas with dedicated shielding and specially written software to minimize exposure to radio waves.</p>
+<p>The antennas switch to the one with better parameters to minimize SAR, but also to keep signal integrity. When scanning the network (what the modem does automatically) we get information which band has what signal level, comparing it to the maximum SAR values measured in a certified laboratory, we know which antenna to choose. Due to the characteristics of the antenna, one works better in low bands, the other one in high bands. However, often in bands which operate together with good parameters, we choose the one with lower SAR. In the worst case scenario, we will not exceed 0.2 [W/Kg].</p>
+<br></br>
+<p>The SAR value of the phone was tested with the phone used at a distance of 0 mm. That is, right next to the head, as most people use the phone. Thanks to our patented solutions, you don't have to do anything to meet the requirements for exposure to radio waves when using the phone. However, we support what organizations, such as the WHO (World Health Organization) and the US Food and Drug Administration, have concluded, that the best way to reduce exposure is to use headsets, to keep the phone away from the head and body during conversations, and to reduce the time spent on making phone calls.</p>
+<br></br>
+<p>For more information on how to reduce your exposure to electromagnetic fields, visit Mudita's blog.</p>
+<br></br>
+<p>The phone has an internal antenna. Do not touch it. When using other accessories, make sure that the product you are using is metal-free.</p>
+<br></br>
+<p>The phone must comply with international guidelines (ICNIRP) or European Directive 2014/53/EU (RED) before it can be sold. The essential requirement of the guidelines and directive is the safety of the phone user and others.</p>
+</text>
M module-apps/application-settings-new/ApplicationSettings.cpp => module-apps/application-settings-new/ApplicationSettings.cpp +6 -0
@@ 29,6 29,7 @@
#include "windows/QuoteCategoriesWindow.hpp"
#include "windows/SecurityMainWindow.hpp"
#include "windows/QuotesOptionsWindow.hpp"
+#include "windows/SARInfoWindow.hpp"
#include "windows/ChangePasscodeWindow.hpp"
#include "windows/SystemMainWindow.hpp"
#include "windows/NewApnWindow.hpp"
@@ 452,6 453,11 @@ namespace app
windowsFactory.attach(gui::window::name::technical_information, [](Application *app, const std::string &name) {
return std::make_unique<gui::TechnicalInformationWindow>(app);
});
+ windowsFactory.attach(gui::window::name::sar, [&](Application *app, const std::string &name) {
+ auto sarInfoRepository = std::make_unique<SARInfoRepository>("assets/certification_info", "sar.txt");
+ auto presenter = std::make_unique<SARInfoWindowPresenter>(std::move(sarInfoRepository));
+ return std::make_unique<gui::SARInfoWindow>(app, std::move(presenter));
+ });
windowsFactory.attach(gui::window::name::change_time_zone, [](Application *app, const std::string &name) {
return std::make_unique<gui::ChangeTimeZone>(app);
});
M module-apps/application-settings-new/ApplicationSettings.hpp => module-apps/application-settings-new/ApplicationSettings.hpp +4 -4
@@ 64,7 64,7 @@ namespace gui::window::name
inline constexpr auto change_date_and_time = "ChangeDateAndTime";
inline constexpr auto change_time_zone = "ChangeTimeZone";
- inline constexpr auto new_apn = "NewApn";
+ inline constexpr auto new_apn = "NewApn";
inline constexpr auto bluetooth_check_passkey = "BluetoothCheckPasskey";
inline constexpr auto do_not_disturb = "DoNotDisturb";
@@ 171,9 171,9 @@ namespace app
public AsyncCallbackReceiver
{
public:
- ApplicationSettingsNew(std::string name = name_settings_new,
- std::string parent = {},
- StartInBackground startInBackground = {false});
+ explicit ApplicationSettingsNew(std::string name = name_settings_new,
+ std::string parent = {},
+ StartInBackground startInBackground = {false});
~ApplicationSettingsNew() override;
auto DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) -> sys::MessagePointer override;
auto InitHandler() -> sys::ReturnCodes override;
M module-apps/application-settings-new/CMakeLists.txt => module-apps/application-settings-new/CMakeLists.txt +3 -0
@@ 22,6 22,8 @@ target_sources( ${PROJECT_NAME}
models/FromTimeToTimeModel.cpp
models/QuotesModel.cpp
models/CategoriesModel.cpp
+ models/SARInfoRepository.cpp
+ presenter/SARInfoWindowPresenter.cpp
widgets/ChangePasscodeLockHandler.cpp
widgets/QuoteWidget.cpp
widgets/CategoryWidget.cpp
@@ 52,6 54,7 @@ target_sources( ${PROJECT_NAME}
windows/QuotesMainWindow.cpp
windows/QuotesAddWindow.cpp
windows/QuotesOptionsWindow.cpp
+ windows/SARInfoWindow.cpp
windows/SecurityMainWindow.cpp
windows/ChangePasscodeWindow.cpp
windows/NewApnWindow.cpp
M module-apps/application-settings-new/models/ApnSettingsModel.cpp => module-apps/application-settings-new/models/ApnSettingsModel.cpp +3 -3
@@ 13,7 13,7 @@ void ApnSettingsModel::requestAPNList()
application->bus.sendUnicast(std::make_shared<CellularGetAPNMessage>(), ServiceCellular::serviceName);
}
-void ApnSettingsModel::saveAPN(std::shared_ptr<packet_data::APN::Config> apn)
+void ApnSettingsModel::saveAPN(const std::shared_ptr<packet_data::APN::Config> &apn)
{
if (apn->contextId != packet_data::EmptyContextId) {
CellularServiceAPI::SetAPN(application, *apn);
@@ 23,12 23,12 @@ void ApnSettingsModel::saveAPN(std::shared_ptr<packet_data::APN::Config> apn)
}
}
-void ApnSettingsModel::removeAPN(std::shared_ptr<packet_data::APN::Config> apn)
+void ApnSettingsModel::removeAPN(const std::shared_ptr<packet_data::APN::Config> &apn)
{
CellularServiceAPI::DeleteAPN(application, apn->contextId);
}
-void ApnSettingsModel::setAsDefaultAPN(std::shared_ptr<packet_data::APN::Config> apn)
+void ApnSettingsModel::setAsDefaultAPN(const std::shared_ptr<packet_data::APN::Config> &apn)
{
apn->apnType = packet_data::APN::APNType::Default;
application->bus.sendUnicast(std::make_shared<CellularSetAPNMessage>(apn), ServiceCellular::serviceName);
M module-apps/application-settings-new/models/ApnSettingsModel.hpp => module-apps/application-settings-new/models/ApnSettingsModel.hpp +4 -4
@@ 10,12 10,12 @@
class ApnSettingsModel
{
public:
- ApnSettingsModel(app::Application *application);
+ explicit ApnSettingsModel(app::Application *application);
void requestAPNList();
- void saveAPN(std::shared_ptr<packet_data::APN::Config> apn);
- void removeAPN(std::shared_ptr<packet_data::APN::Config> apn);
- void setAsDefaultAPN(std::shared_ptr<packet_data::APN::Config> apn);
+ void saveAPN(const std::shared_ptr<packet_data::APN::Config> &apn);
+ void removeAPN(const std::shared_ptr<packet_data::APN::Config> &apn);
+ void setAsDefaultAPN(const std::shared_ptr<packet_data::APN::Config> &apn);
private:
app::Application *application = nullptr;
M module-apps/application-settings-new/models/NewApnModel.cpp => module-apps/application-settings-new/models/NewApnModel.cpp +3 -4
@@ 102,7 102,7 @@ void NewApnModel::clearData()
list->rebuildList();
}
-void NewApnModel::saveData(std::shared_ptr<packet_data::APN::Config> apnRecord)
+void NewApnModel::saveData(const std::shared_ptr<packet_data::APN::Config> &apnRecord)
{
for (auto item : internalData) {
if (item->onSaveCallback) {
@@ 111,7 111,7 @@ void NewApnModel::saveData(std::shared_ptr<packet_data::APN::Config> apnRecord)
}
}
-void NewApnModel::loadData(std::shared_ptr<packet_data::APN::Config> apnRecord)
+void NewApnModel::loadData(const std::shared_ptr<packet_data::APN::Config> &apnRecord)
{
for (auto item : internalData) {
if (item->onLoadCallback) {
@@ 128,6 128,5 @@ void NewApnModel::apnDataChanged()
return;
}
}
- application->getCurrentWindow()->setBottomBarActive(gui::BottomBar::Side::CENTER, false); // SAVE button
- return;
+ application->getCurrentWindow()->setBottomBarActive(gui::BottomBar::Side::CENTER, false);
}
M module-apps/application-settings-new/models/NewApnModel.hpp => module-apps/application-settings-new/models/NewApnModel.hpp +4 -4
@@ 16,11 16,11 @@ class NewApnModel : public app::InternalModel<gui::ApnListItem *>, public gui::L
app::Application *application = nullptr;
public:
- NewApnModel(app::Application *app);
+ explicit NewApnModel(app::Application *app);
void clearData();
- void saveData(std::shared_ptr<packet_data::APN::Config> apnRecord);
- void loadData(std::shared_ptr<packet_data::APN::Config> apnRecord);
+ void saveData(const std::shared_ptr<packet_data::APN::Config> &apnRecord);
+ void loadData(const std::shared_ptr<packet_data::APN::Config> &apnRecord);
void createData();
@@ 30,6 30,6 @@ class NewApnModel : public app::InternalModel<gui::ApnListItem *>, public gui::L
auto getItem(gui::Order order) -> gui::ListItem * override;
- void requestRecords(const uint32_t offset, const uint32_t limit) override;
+ void requestRecords(uint32_t offset, uint32_t limit) override;
void apnDataChanged();
};
A module-apps/application-settings-new/models/SARInfoRepository.cpp => module-apps/application-settings-new/models/SARInfoRepository.cpp +31 -0
@@ 0,0 1,31 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#include "SARInfoRepository.hpp"
+
+#include <gsl_util>
+#include <i18n/i18n.hpp>
+
+#include <fstream>
+
+SARInfoRepository::SARInfoRepository(std::filesystem::path certificationInfoPath, std::filesystem::path fileName)
+ : certificationInfoPath(std::move(certificationInfoPath)), fileName(std::move(fileName))
+{}
+
+std::string SARInfoRepository::getSarInfoText()
+{
+ auto displayLanguageName = utils::localize.getDisplayLanguage();
+ auto sarInfoFile = std::ifstream(certificationInfoPath / displayLanguageName / fileName);
+
+ if (!sarInfoFile.is_open()) {
+ sarInfoFile.open(certificationInfoPath / utils::i18n::DefaultLanguage / fileName);
+
+ if (!sarInfoFile.is_open()) {
+ throw std::runtime_error("SAR info assets are missing in the system!");
+ }
+ }
+ std::ostringstream sarInfoText;
+ sarInfoText << sarInfoFile.rdbuf();
+
+ return sarInfoText.str();
+}
A module-apps/application-settings-new/models/SARInfoRepository.hpp => module-apps/application-settings-new/models/SARInfoRepository.hpp +26 -0
@@ 0,0 1,26 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "filesystem"
+
+class AbstractSARInfoRepository
+{
+ public:
+ virtual ~AbstractSARInfoRepository() noexcept = default;
+
+ virtual std::string getSarInfoText() = 0;
+};
+
+class SARInfoRepository : public AbstractSARInfoRepository
+{
+ public:
+ SARInfoRepository(std::filesystem::path certificationInfoPath, std::filesystem::path fileName);
+
+ std::string getSarInfoText() override;
+
+ private:
+ const std::filesystem::path certificationInfoPath;
+ const std::filesystem::path fileName;
+};
A module-apps/application-settings-new/presenter/SARInfoWindowPresenter.cpp => module-apps/application-settings-new/presenter/SARInfoWindowPresenter.cpp +13 -0
@@ 0,0 1,13 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#include "SARInfoWindowPresenter.hpp"
+
+SARInfoWindowPresenter::SARInfoWindowPresenter(std::unique_ptr<AbstractSARInfoRepository> &&sarInfoRepository)
+ : sarInfoRepository{std::move(sarInfoRepository)}
+{}
+
+std::string SARInfoWindowPresenter::getSarInfo()
+{
+ return sarInfoRepository->getSarInfoText();
+}
A module-apps/application-settings-new/presenter/SARInfoWindowPresenter.hpp => module-apps/application-settings-new/presenter/SARInfoWindowPresenter.hpp +35 -0
@@ 0,0 1,35 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "application-settings-new/models/SARInfoRepository.hpp"
+#include "BasePresenter.hpp"
+
+class SARInfoWindowContract
+{
+ public:
+ class View
+ {
+ public:
+ virtual ~View() noexcept = default;
+ };
+ class Presenter : public app::BasePresenter<SARInfoWindowContract::View>
+ {
+ public:
+ ~Presenter() noexcept override = default;
+
+ virtual std::string getSarInfo() = 0;
+ };
+};
+
+class SARInfoWindowPresenter : public SARInfoWindowContract::Presenter
+{
+ public:
+ explicit SARInfoWindowPresenter(std::unique_ptr<AbstractSARInfoRepository> &&sarInfoRepository);
+
+ std::string getSarInfo() override;
+
+ private:
+ std::unique_ptr<AbstractSARInfoRepository> sarInfoRepository;
+};
M module-apps/application-settings-new/widgets/SettingsStyle.hpp => module-apps/application-settings-new/widgets/SettingsStyle.hpp +20 -2
@@ 128,8 128,26 @@ namespace style
inline constexpr auto description_h = 150;
} // namespace offline
- } // namespace window
- }; // namespace settings
+ namespace sar
+ {
+ inline constexpr auto LeftMargin = ::style::window::default_left_margin;
+ inline constexpr auto TopMargin = ::style::header::height + ::style::margins::very_big - 1;
+ inline constexpr auto Width = ::style::window::default_body_width;
+ inline constexpr auto Height = ::style::window::default_body_height - ::style::margins::very_big;
+
+ namespace date
+ {
+ inline constexpr auto Height = 30;
+ } // namespace date
+ namespace text
+ {
+ inline constexpr auto TopMargin = 7;
+ inline constexpr auto Height = sar::Height - date::Height - TopMargin;
+ } // namespace text
+ } // namespace sar
+
+ } // namespace window
+ }; // namespace settings
namespace quotes::categories
{
namespace list
A module-apps/application-settings-new/windows/SARInfoWindow.cpp => module-apps/application-settings-new/windows/SARInfoWindow.cpp +61 -0
@@ 0,0 1,61 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#include "SARInfoWindow.hpp"
+#include "application-settings-new/ApplicationSettings.hpp"
+#include "application-settings-new/widgets/SettingsStyle.hpp"
+
+namespace gui
+{
+ SARInfoWindow::SARInfoWindow(app::Application *app,
+ std::unique_ptr<SARInfoWindowContract::Presenter> &&windowPresenter)
+ : gui::AppWindow(app, window::name::sar), presenter{std::move(windowPresenter)}
+ {
+ presenter->attach(this);
+ buildInterface();
+ }
+
+ SARInfoWindow::~SARInfoWindow() noexcept
+ {
+ destroyInterface();
+ }
+
+ void SARInfoWindow::rebuild()
+ {
+ destroyInterface();
+ buildInterface();
+ }
+
+ void SARInfoWindow::destroyInterface()
+ {
+ erase();
+ }
+
+ void SARInfoWindow::buildInterface()
+ {
+ AppWindow::buildInterface();
+
+ setTitle(utils::localize.get("app_settings_sar"));
+
+ namespace sarStyle = style::settings::window::sar;
+ sarInfoText =
+ new gui::Text(this, sarStyle::LeftMargin, sarStyle::TopMargin, sarStyle::Width, sarStyle::text::Height);
+ sarInfoText->setEdges(gui::RectangleEdge::None);
+ sarInfoText->setFont(::style::window::font::medium);
+ sarInfoText->setAlignment(gui::Alignment{gui::Alignment::Vertical::Top});
+ sarInfoText->setPenFocusWidth(::style::window::default_border_focus_w);
+ sarInfoText->setPenWidth(::style::window::default_border_rect_no_focus);
+ sarInfoText->setEditMode(gui::EditMode::Scroll);
+ sarInfoText->setCursorStartPosition(gui::CursorStartPosition::DocumentBegin);
+
+ bottomBar->setActive(gui::BottomBar::Side::RIGHT, true);
+ bottomBar->setText(gui::BottomBar::Side::RIGHT, utils::localize.get(::style::strings::common::back));
+
+ setFocusItem(sarInfoText);
+ }
+
+ void SARInfoWindow::onBeforeShow(gui::ShowMode /*mode*/, gui::SwitchData * /*data*/)
+ {
+ sarInfoText->setRichText(presenter->getSarInfo());
+ }
+} // namespace gui
A module-apps/application-settings-new/windows/SARInfoWindow.hpp => module-apps/application-settings-new/windows/SARInfoWindow.hpp +32 -0
@@ 0,0 1,32 @@
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "AppWindow.hpp"
+
+#include "application-settings-new/presenter/SARInfoWindowPresenter.hpp"
+
+#include <module-gui/gui/widgets/Label.hpp>
+#include <module-gui/gui/widgets/Text.hpp>
+#include <module-gui/gui/input/InputEvent.hpp>
+
+namespace gui
+{
+ class SARInfoWindow : public gui::AppWindow, public SARInfoWindowContract::View
+ {
+ public:
+ explicit SARInfoWindow(app::Application *app,
+ std::unique_ptr<SARInfoWindowContract::Presenter> &&windowPresenter);
+ ~SARInfoWindow() noexcept override;
+
+ private:
+ void onBeforeShow(gui::ShowMode mode, gui::SwitchData *data) override;
+ void rebuild() override;
+ void buildInterface() override;
+ void destroyInterface() override;
+
+ std::unique_ptr<SARInfoWindowContract::Presenter> presenter;
+ gui::Text *sarInfoText = nullptr;
+ };
+} // namespace gui