| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/settings/settingslocalization.cpp`/ |
| 2 | |
| 3 | #include "gui/settings/settingslocalization.h"cxx . . $ `<file>/src/librssguard/gui/settings/settingslocalization.h`/ |
| 4 | |
| 5 | #include "gui/messagebox.h"cxx . . $ `<file>/src/librssguard/gui/messagebox.h`/ |
| 6 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 7 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 8 | #include "miscellaneous/localization.h"cxx . . $ `<file>/src/librssguard/miscellaneous/localization.h`/ |
| 9 | #include "miscellaneous/settings.h"cxx . . $ `<file>/src/librssguard/miscellaneous/settings.h`/ |
| 10 | #include "network-web/networkfactory.h"cxx . . $ `<file>/src/librssguard/network-web/networkfactory.h`/ |
| 11 | #include "network-web/webfactory.h"cxx . . $ `<file>/src/librssguard/network-web/webfactory.h`/ |
| 12 | |
| 13 | #include <QJsonArray> |
| 14 | #include <QJsonDocument> |
| 15 | #include <QJsonObject> |
| 16 | |
| 17 | SettingsLocalizationcxx . . $ SettingsLocalization#::SettingsLocalizationcxx . . $ SettingsLocalization#SettingsLocalization(e2806c23cebd2a3f).(Settingscxx . . $ Settings#* settings, QWidgetcxx . . $ QWidget#* parent) |
| 18 | : SettingsPanelcxx . . $ SettingsPanel#(settings, parent), m_uicxx . . $ SettingsLocalization#m_ui.(new Uicxx . . $ Ui/::SettingsLocalizationcxx . . $ Ui/SettingsLocalization#), |
| 19 | m_urlPercentagescxx . . $ SettingsLocalization#m_urlPercentages.(QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("https://api.crowdin.com/api/v2/projects/608575/languages/progress?limit=100"))), |
| 20 | m_urlPeoplecxx . . $ SettingsLocalization#m_urlPeople.(QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("https://api.crowdin.com/api/v2/projects/608575/members?limit=500"))) { |
| 21 | m_uicxx . . $ SettingsLocalization#m_ui.->setupUicxx . . $ Ui_SettingsLocalization#setupUi(108f35f7aa7f3cf9).(this); |
| 22 | m_uicxx . . $ SettingsLocalization#m_ui.->m_lblAuthorscxx . . $ Ui_SettingsLocalization#m_lblAuthors.->labelcxx . . $ LabelWithStatus#label(a31910c5384f8d7e).()->setWordWrapcxx . . $ QLabel#setWordWrap(b45ddcbc8423892c).(true); |
| 23 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->setColumnCountcxx . . $ QTreeWidget#setColumnCount(d4f767463ce0a6b3).(3); |
| 24 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->setHeaderHiddencxx . . $ QTreeView#setHeaderHidden(b45ddcbc8423892c).(false); |
| 25 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->setHeaderLabelscxx . . $ QTreeWidget#setHeaderLabels(4c9f0945b8b27034).(QStringListcxx . . $ QList#QList(ced63f7c635d850d).() <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Language") <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Code") <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Translation progress")); |
| 26 | |
| 27 | m_uicxx . . $ SettingsLocalization#m_ui.->m_lblHelpcxx . . $ Ui_SettingsLocalization#m_lblHelp.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).(R"(Help us to improve %1 <a href="%2">translations</a>.)") |
| 28 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_NAMEcxx . . $ `<built-in>:487:9`!), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("https://crowdin.com/project/rssguard"))); |
| 29 | |
| 30 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SettingsLocalization#m_ui.->m_lblHelpcxx . . $ Ui_SettingsLocalization#m_lblHelp., &QLabelcxx . . $ QLabel#::linkActivatedcxx . . $ QLabel#linkActivated(3520e46b33348bf6)., qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->webcxx . . $ Application#web(ad68e16c93841931).(), &WebFactorycxx . . $ WebFactory#::openUrlInExternalBrowsercxx . . $ WebFactory#openUrlInExternalBrowser(dd54f9efb9153ea5).); |
| 31 | |
| 32 | // Setup languages. |
| 33 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(0, QHeaderViewcxx . . $ QHeaderView#::ResizeModecxx . . $ QHeaderView#ResizeMode#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.); |
| 34 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(1, QHeaderViewcxx . . $ QHeaderView#::ResizeModecxx . . $ QHeaderView#ResizeMode#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.); |
| 35 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(2, QHeaderViewcxx . . $ QHeaderView#::ResizeModecxx . . $ QHeaderView#ResizeMode#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.); |
| 36 | |
| 37 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages., &QTreeWidgetcxx . . $ QTreeWidget#::currentItemChangedcxx . . $ QTreeWidget#currentItemChanged(5ef89140c59dd28e)., this, &SettingsLocalizationcxx . . $ SettingsLocalization#::requireRestartcxx . . $ SettingsPanel#requireRestart(49f6e7a06ebc5aa8).); |
| 38 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages., &QTreeWidgetcxx . . $ QTreeWidget#::currentItemChangedcxx . . $ QTreeWidget#currentItemChanged(5ef89140c59dd28e)., this, &SettingsLocalizationcxx . . $ SettingsLocalization#::dirtifySettingscxx . . $ SettingsPanel#dirtifySettings(49f6e7a06ebc5aa8).); |
| 39 | } |
| 40 | |
| 41 | SettingsLocalizationcxx . . $ SettingsLocalization#::~cxx . . $ SettingsLocalization#`~SettingsLocalization`(ced63f7c635d850d).SettingsLocalizationcxx . . $ SettingsLocalization#() { |
| 42 | delete m_uicxx . . $ SettingsLocalization#m_ui.; |
| 43 | } |
| 44 | |
| 45 | QIconcxx . . $ QIcon# SettingsLocalizationcxx . . $ SettingsLocalization#::iconcxx . . $ SettingsLocalization#icon(952ef71f8967d9eb).() const { |
| 46 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("text-x-gettext-translation")); |
| 47 | } |
| 48 | |
| 49 | void SettingsLocalizationcxx . . $ SettingsLocalization#::langMetadataDownloadedcxx . . $ SettingsLocalization#langMetadataDownloaded(2e59411b5306353b).(const QUrlcxx . . $ QUrl#& url, |
| 50 | QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError# status, |
| 51 | int http_code, |
| 52 | QByteArraycxx . . $ QByteArray# contents) { |
| 53 | auto* down = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<Downloadercxx . . $ Downloader#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 54 | |
| 55 | if (url ==cxx . . $ `operator==`(1ea223449d9187a9). m_urlPercentagescxx . . $ SettingsLocalization#m_urlPercentages.) { |
| 56 | if (status == QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError#::NoErrorcxx . . $ QNetworkReply#NoError.) { |
| 57 | m_dataPercentagescxx . . $ SettingsLocalization#m_dataPercentages. =cxx . . $ QByteArray#`operator=`(acee8257ca81216f). contents; |
| 58 | down->downloadFilecxx . . $ Downloader#downloadFile(59dca4567f557537).(m_urlPeoplecxx . . $ SettingsLocalization#m_urlPeople..toStringcxx . . $ QUrl#toString(632475ebea3355f1).(), |
| 59 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(Feeds), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(Feeds::UpdateTimeout)).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 60 | } |
| 61 | else { |
| 62 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_NETWORKcxx . . $ `src/librssguard/definitions/definitions.h:168:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to download languages metadata."; |
| 63 | |
| 64 | if (down != nullptr) { |
| 65 | down->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | else { |
| 70 | if (status == QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError#::NoErrorcxx . . $ QNetworkReply#NoError.) { |
| 71 | m_dataPeoplecxx . . $ SettingsLocalization#m_dataPeople. =cxx . . $ QByteArray#`operator=`(acee8257ca81216f). contents; |
| 72 | |
| 73 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, int> percentages_langscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 74 | QStringcxx . . $ QString# all_translatorscxx . . $ QString#QString(ced63f7c635d850d).; |
| 75 | |
| 76 | QJsonDocumentcxx . . $ QJsonDocument# stats_doc = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(m_dataPercentagescxx . . $ SettingsLocalization#m_dataPercentages.); |
| 77 | QJsonDocumentcxx . . $ QJsonDocument# people_doc = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(m_dataPeoplecxx . . $ SettingsLocalization#m_dataPeople.); |
| 78 | QJsonArraycxx . . $ QJsonArray# people_arr = people_doc.objectcxx . . $ QJsonDocument#object(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."data"cxx . . $ QString#QString(85c52e162fed56f9).].toArraycxx . . $ QJsonValueRef#toArray(98974f179f8308bf).(); |
| 79 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<QStringcxx . . $ QString#> people_desccxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 80 | |
| 81 | stdcxx . . $ std/::transformcxx . . $ std/transform(da30451c4a040264).(people_arr.begincxx . . $ QJsonArray#begin(f2014c3a9d27d336).(), people_arr.endcxx . . $ QJsonArray#end(f2014c3a9d27d336).(), stdcxx . . $ std/::back_insertercxx . . $ std/back_inserter(7b559d6bdd90ff74).(people_desc), [](const QJsonValuecxx . . $ QJsonValue#& b) { |
| 82 | return b.toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."data"cxx . . $ QString#QString(85c52e162fed56f9).].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."username"cxx . . $ QString#QString(85c52e162fed56f9).].toStringcxx . . $ QJsonValueRef#toString(5555d9024dcf93fb).(); |
| 83 | }); |
| 84 | |
| 85 | all_translators =cxx . . $ QString#`operator=`(4f35bf974e7f8568). stdcxx . . $ std/::accumulatecxx . . $ std/accumulate(da30451c4a040264).(stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(people_desc.begincxx . . $ std/vector#begin(55a6de06420d4903).()), |
| 86 | people_desc.endcxx . . $ std/vector#end(55a6de06420d4903).(), |
| 87 | people_desccxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ std/vector#at(428bb168810b9e52).(0), |
| 88 | [](const QStringcxx . . $ QString#& lhs, const QStringcxx . . $ QString#& rhs) { |
| 89 | return QStringcxx . . $ QString#(lhs +cxx . . $ operator+(adfbdceb504720ce). ", " +cxx . . $ operator+(adfbdceb504720ce). rhs); |
| 90 | }); |
| 91 | |
| 92 | for (const QJsonValuecxx . . $ QJsonValue#& val_lang : stats_doc.objectcxx . . $ QJsonDocument#object(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."data"cxx . . $ QString#QString(85c52e162fed56f9).].toArraycxx . . $ QJsonValueRef#toArray(98974f179f8308bf).()) { |
| 93 | QStringcxx . . $ QString# lang_id = val_langcxx . . $ QString#QString(132dd6869045752b)..toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."data"cxx . . $ QString#QString(85c52e162fed56f9).].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."languageId"cxx . . $ QString#QString(85c52e162fed56f9).].toStringcxx . . $ QJsonValueRef#toString(5555d9024dcf93fb).().replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("-"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("_")); |
| 94 | int lang_completion = val_lang.toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."data"cxx . . $ QString#QString(85c52e162fed56f9).].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4)."translationProgress"cxx . . $ QString#QString(85c52e162fed56f9).].toIntcxx . . $ QJsonValueRef#toInt(7ccb52b1bfe01045).(); |
| 95 | |
| 96 | if (lang_id ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("es_ES")) { |
| 97 | lang_id =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("es"); |
| 98 | } |
| 99 | |
| 100 | if (lang_id ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("en_US")) { |
| 101 | lang_completion = 100; |
| 102 | } |
| 103 | |
| 104 | percentages_langs.insertcxx . . $ QMap#insert(929a1ed410fe8423).(lang_id, lang_completion); |
| 105 | } |
| 106 | |
| 107 | if (all_translators.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 108 | m_uicxx . . $ SettingsLocalization#m_ui.->m_lblAuthorscxx . . $ Ui_SettingsLocalization#m_lblAuthors.->setStatuscxx . . $ LabelWithStatus#setStatus(810dc34ace2b0f32).(WidgetWithStatuscxx . . $ WidgetWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Informationcxx . . $ WidgetWithStatus#StatusType#Information., |
| 109 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Big thanks to all translators!"), |
| 110 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Big thanks to all translators!")); |
| 111 | } |
| 112 | else { |
| 113 | m_uicxx . . $ SettingsLocalization#m_ui.->m_lblAuthorscxx . . $ Ui_SettingsLocalization#m_lblAuthors.->setStatuscxx . . $ LabelWithStatus#setStatus(810dc34ace2b0f32).(WidgetWithStatuscxx . . $ WidgetWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Informationcxx . . $ WidgetWithStatus#StatusType#Information., |
| 114 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Translations provided by: %1").argcxx . . $ QString#arg(ad0bca07273edcc2).(all_translators), |
| 115 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Big thanks to all translators!")); |
| 116 | } |
| 117 | |
| 118 | for (int i = 0; i < m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->topLevelItemCountcxx . . $ QTreeWidget#topLevelItemCount(455f465bc33b4cdf).(); i++) { |
| 119 | auto* it = m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->topLevelItemcxx . . $ QTreeWidget#topLevelItem(bdbf10533f234380).(i); |
| 120 | int perc_translated = percentages_langs.valuecxx . . $ QMap#value(6f0b2e7f225a8193).(it->textcxx . . $ QTreeWidgetItem#text(3f3c3d0e9c0eb37f).(1)); |
| 121 | QColorcxx . . $ QColor# col_translated = QColorcxx . . $ QColor#::fromHsvcxx . . $ QColor#fromHsv(785b6f35cae7fe1c).(perc_translated, 200, 230); |
| 122 | |
| 123 | it->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(2, QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%1 %").argcxx . . $ QString#arg(ad0bca07273edcc2).(perc_translated > 0 ? QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(perc_translated) : QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("?"))); |
| 124 | it->setIconcxx . . $ QTreeWidgetItem#setIcon(40a39523e9ce8b1e).(2, IconFactorycxx . . $ IconFactory#::generateIconcxx . . $ IconFactory#generateIcon(e60330f79968ef46).(col_translated)); |
| 125 | } |
| 126 | } |
| 127 | else { |
| 128 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_NETWORKcxx . . $ `src/librssguard/definitions/definitions.h:168:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to download languages people metadata."; |
| 129 | } |
| 130 | |
| 131 | if (down != nullptr) { |
| 132 | down->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void SettingsLocalizationcxx . . $ SettingsLocalization#::loadSettingscxx . . $ SettingsLocalization#loadSettings(49f6e7a06ebc5aa8).() { |
| 138 | onBeginLoadSettingscxx . . $ SettingsPanel#onBeginLoadSettings(49f6e7a06ebc5aa8).(); |
| 139 | |
| 140 | auto langs = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->localizationcxx . . $ Application#localization(c0674a442c333122).()->installedLanguagescxx . . $ Localization#installedLanguages(14064648a6b45cef).(); |
| 141 | auto* downl = new Downloadercxx . . $ Downloader#(this); |
| 142 | |
| 143 | // Also, load statistics with restricted access token. |
| 144 | QListcxx . . $ QList#<QPaircxx . . $ QPair#<QByteArraycxx . . $ QByteArray#, QByteArraycxx . . $ QByteArray#>> hdrs = {cxx . . $ QList#QList(b6da5b9a9f304025). |
| 145 | {"Authorization", |
| 146 | "Bearer " |
| 147 | "0fbcad4c39d21a55f63f8a1b6d07cc56bb1e2eb2047bfaf1ee22425e3edf1c2b217f4d13b3cebba9"}}; |
| 148 | |
| 149 | downl->appendRawHeaderscxx . . $ Downloader#appendRawHeaders(7b5e3954c99f4a55).(hdrs); |
| 150 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(downl, |
| 151 | &Downloadercxx . . $ Downloader#::completedcxx . . $ Downloader#completed(2e59411b5306353b)., |
| 152 | this, |
| 153 | &SettingsLocalizationcxx . . $ SettingsLocalization#::langMetadataDownloadedcxx . . $ SettingsLocalization#langMetadataDownloaded(2e59411b5306353b)., |
| 154 | Qtcxx . . $ Qt/::ConnectionTypecxx . . $ Qt/ConnectionType#::QueuedConnectioncxx . . $ Qt/QueuedConnection.); |
| 155 | downl->downloadFilecxx . . $ Downloader#downloadFile(59dca4567f557537).(m_urlPercentagescxx . . $ SettingsLocalization#m_urlPercentages..toStringcxx . . $ QUrl#toString(632475ebea3355f1).(), |
| 156 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(Feeds), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(Feeds::UpdateTimeout)).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 157 | |
| 158 | for (const Languagecxx . . $ Language#& language : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(langs)) { |
| 159 | auto* item = new QTreeWidgetItemcxx . . $ QTreeWidgetItem#QTreeWidgetItem(a0da2fa5542f28a7).(m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.); |
| 160 | |
| 161 | item->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(0, language.m_namecxx . . $ Language#m_name.); |
| 162 | item->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(1, language.m_codecxx . . $ Language#m_code.); |
| 163 | item->setTextcxx . . $ QTreeWidgetItem#setText(4b11a7293b4ed91c).(2, QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("? %")); |
| 164 | |
| 165 | item->setIconcxx . . $ QTreeWidgetItem#setIcon(40a39523e9ce8b1e).(0, qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->miscIconcxx . . $ IconFactory#miscIcon(ef5a0418eb2d5e9b).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(FLAG_ICON_SUBFOLDERcxx . . $ `src/librssguard/definitions/definitions.h:86:9`!) +cxx . . $ operator+(adfbdceb504720ce). QDircxx . . $ QDir#::separatorcxx . . $ QDir#separator(44eb9225326fcbf5).() +cxx . . $ operator+(adfbdceb504720ce). language.m_codecxx . . $ Language#m_code.)); |
| 166 | item->setIconcxx . . $ QTreeWidgetItem#setIcon(40a39523e9ce8b1e).(2, IconFactorycxx . . $ IconFactory#::generateIconcxx . . $ IconFactory#generateIcon(e60330f79968ef46).(Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::GlobalColorcxx . . $ Qt/GlobalColor#::bluecxx . . $ Qt/blue.)); |
| 167 | } |
| 168 | |
| 169 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->sortByColumncxx . . $ QTreeView#sortByColumn(11168df8d4e8286d).(0, Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::AscendingOrdercxx . . $ Qt/AscendingOrder.); |
| 170 | |
| 171 | QListcxx . . $ QList#<QTreeWidgetItemcxx . . $ QTreeWidgetItem#*> matching_items = |
| 172 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->findItemscxx . . $ QTreeWidget#findItems(2d686ae6adb41a18).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->localizationcxx . . $ Application#localization(c0674a442c333122).()->loadedLanguagecxx . . $ Localization#loadedLanguage(6ef7b6c27b00b43d).(), Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::MatchFlagcxx . . $ Qt/MatchFlag#::MatchContainscxx . . $ Qt/MatchContains., 1); |
| 173 | |
| 174 | if (!matching_items.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) { |
| 175 | m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->setCurrentItemcxx . . $ QTreeWidget#setCurrentItem(7332f4628c1d1841).(matching_items[cxx . . $ QList#`operator[]`(f5945173c490e616).0]); |
| 176 | } |
| 177 | |
| 178 | onEndLoadSettingscxx . . $ SettingsPanel#onEndLoadSettings(49f6e7a06ebc5aa8).(); |
| 179 | } |
| 180 | |
| 181 | void SettingsLocalizationcxx . . $ SettingsLocalization#::saveSettingscxx . . $ SettingsLocalization#saveSettings(49f6e7a06ebc5aa8).() { |
| 182 | onBeginSaveSettingscxx . . $ SettingsPanel#onBeginSaveSettings(49f6e7a06ebc5aa8).(); |
| 183 | |
| 184 | if (m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->currentItemcxx . . $ QTreeWidget#currentItem(faf259b556e61ea0).() == nullptr) { |
| 185 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_GUIcxx . . $ `src/librssguard/definitions/definitions.h:174:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "No localizations loaded in settings dialog, so no saving for them."; |
| 186 | return; |
| 187 | } |
| 188 | |
| 189 | const QStringcxx . . $ QString# actual_lang = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->localizationcxx . . $ Application#localization(c0674a442c333122).()->loadedLanguagecxx . . $ Localization#loadedLanguage(6ef7b6c27b00b43d).(); |
| 190 | const QStringcxx . . $ QString# new_lang = m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->currentItemcxx . . $ QTreeWidget#currentItem(faf259b556e61ea0).()->textcxx . . $ QTreeWidgetItem#text(3f3c3d0e9c0eb37f).(1); |
| 191 | |
| 192 | // Save prompt for restart if language has changed. |
| 193 | if (new_lang !=cxx . . $ `operator!=`(5bc2975d2d751687). actual_lang) { |
| 194 | int perc = m_uicxx . . $ SettingsLocalization#m_ui.->m_treeLanguagescxx . . $ Ui_SettingsLocalization#m_treeLanguages.->currentItemcxx . . $ QTreeWidget#currentItem(faf259b556e61ea0).()->toolTipcxx . . $ QTreeWidgetItem#toolTip(3f3c3d0e9c0eb37f).(2).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 195 | |
| 196 | if (perc > 0 && perc < 75) { |
| 197 | const QMessageBoxcxx . . $ QMessageBox#::StandardButtoncxx . . $ QMessageBox#StandardButton# clicked_button = MsgBoxcxx . . $ MsgBox#:: |
| 198 | showcxx . . $ MsgBox#show(699e792c6fa2d501).(this, |
| 199 | QMessageBoxcxx . . $ QMessageBox#::Iconcxx . . $ QMessageBox#Icon#::Questioncxx . . $ QMessageBox#Question., |
| 200 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Translators needed!"), |
| 201 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("The translation '%1' is incomplete and anyone able to help with translating %2 is greatly welcomed.") |
| 202 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(new_lang, QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_NAMEcxx . . $ `<built-in>:487:9`!)), |
| 203 | trcxx . . $ SettingsLocalization#tr(75d9f1c324b4579d).("Do you want to help with the translation now?"), |
| 204 | {cxx . . $ QString#QString(ced63f7c635d850d).}, |
| 205 | QMessageBoxcxx . . $ QMessageBox#::StandardButtoncxx . . $ QMessageBox#StandardButton#::Yescxx . . $ QMessageBox#Yes. |cxx . . $ `operator|`(67530149e923fc12). QMessageBoxcxx . . $ QMessageBox#::StandardButtoncxx . . $ QMessageBox#StandardButton#::Nocxx . . $ QMessageBox#No., |
| 206 | QMessageBoxcxx . . $ QMessageBox#::StandardButtoncxx . . $ QMessageBox#StandardButton#::Yescxx . . $ QMessageBox#Yes.); |
| 207 | |
| 208 | if (clicked_button == QMessageBoxcxx . . $ QMessageBox#::StandardButtoncxx . . $ QMessageBox#StandardButton#::Yescxx . . $ QMessageBox#Yes.) { |
| 209 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->webcxx . . $ Application#web(ad68e16c93841931).()->openUrlInExternalBrowsercxx . . $ WebFactory#openUrlInExternalBrowser(dd54f9efb9153ea5).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("https://crowdin.com/project/rssguard")); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | requireRestartcxx . . $ SettingsPanel#requireRestart(49f6e7a06ebc5aa8).(); |
| 214 | settingscxx . . $ SettingsPanel#settings(951936487a2d9252).()->setValuecxx . . $ Settings#setValue(365356ede4ebaabb).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(General), Generalcxx . . $ General/::Languagecxx . . $ General/Language., new_langcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 215 | } |
| 216 | |
| 217 | onEndSaveSettingscxx . . $ SettingsPanel#onEndSaveSettings(49f6e7a06ebc5aa8).(); |
| 218 | } |