| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/dialogs/formaddaccount.cpp`/ |
| 2 | |
| 3 | #include "gui/dialogs/formaddaccount.h"cxx . . $ `<file>/src/librssguard/gui/dialogs/formaddaccount.h`/ |
| 4 | |
| 5 | #include "core/feedsmodel.h"cxx . . $ `<file>/src/librssguard/core/feedsmodel.h`/ |
| 6 | #include "gui/guiutilities.h"cxx . . $ `<file>/src/librssguard/gui/guiutilities.h`/ |
| 7 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 8 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 9 | #include "services/abstract/serviceentrypoint.h"cxx . . $ `<file>/src/librssguard/services/abstract/serviceentrypoint.h`/ |
| 10 | |
| 11 | #include <QDialogButtonBox> |
| 12 | #include <QListWidget> |
| 13 | #include <QSize> |
| 14 | |
| 15 | FormAddAccountcxx . . $ FormAddAccount#::FormAddAccountcxx . . $ FormAddAccount#FormAddAccount(13bcf11cfab29c98).(const QListcxx . . $ QList#<ServiceEntryPointcxx . . $ ServiceEntryPoint#*>& entry_points, FeedsModelcxx . . $ FeedsModel#* model, QWidgetcxx . . $ QWidget#* parent) |
| 16 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent), m_uicxx . . $ FormAddAccount#m_ui.(new Uicxx . . $ Ui/::FormAddAccountcxx . . $ Ui/FormAddAccount#), m_modelcxx . . $ FormAddAccount#m_model.(model), m_entryPointscxx . . $ FormAddAccount#m_entryPoints.(entry_points) { |
| 17 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).setupUicxx . . $ Ui_FormAddAccount#setupUi(d194de0c0f68c28b).(this); |
| 18 | |
| 19 | // Set flags and attributes. |
| 20 | GuiUtilitiescxx . . $ GuiUtilities#::applyDialogPropertiescxx . . $ GuiUtilities#applyDialogProperties(6e9150cdaac92159).(*this, qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("list-add"))); |
| 21 | |
| 22 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints., &QListWidgetcxx . . $ QListWidget#::itemDoubleClickedcxx . . $ QListWidget#itemDoubleClicked(13c1c8ad030616f4)., this, &FormAddAccountcxx . . $ FormAddAccount#::addSelectedAccountcxx . . $ FormAddAccount#addSelectedAccount(49f6e7a06ebc5aa8).); |
| 23 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormAddAccount#m_buttonBox., &QDialogButtonBoxcxx . . $ QDialogButtonBox#::acceptedcxx . . $ QDialogButtonBox#accepted(49f6e7a06ebc5aa8)., this, &FormAddAccountcxx . . $ FormAddAccount#::addSelectedAccountcxx . . $ FormAddAccount#addSelectedAccount(49f6e7a06ebc5aa8).); |
| 24 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints., &QListWidgetcxx . . $ QListWidget#::currentRowChangedcxx . . $ QListWidget#currentRowChanged(d4f767463ce0a6b3)., this, &FormAddAccountcxx . . $ FormAddAccount#::showAccountDetailscxx . . $ FormAddAccount#showAccountDetails(49f6e7a06ebc5aa8).); |
| 25 | |
| 26 | loadEntryPointscxx . . $ FormAddAccount#loadEntryPoints(49f6e7a06ebc5aa8).(); |
| 27 | } |
| 28 | |
| 29 | FormAddAccountcxx . . $ FormAddAccount#::~cxx . . $ FormAddAccount#`~FormAddAccount`(ced63f7c635d850d).FormAddAccountcxx . . $ FormAddAccount#() { |
| 30 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_GUIcxx . . $ `src/librssguard/definitions/definitions.h:174:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Destroying FormAddAccount instance."; |
| 31 | } |
| 32 | |
| 33 | void FormAddAccountcxx . . $ FormAddAccount#::addSelectedAccountcxx . . $ FormAddAccount#addSelectedAccount(49f6e7a06ebc5aa8).() { |
| 34 | acceptcxx . . $ QDialog#accept(49f6e7a06ebc5aa8).(); |
| 35 | ServiceEntryPointcxx . . $ ServiceEntryPoint#* point = selectedEntryPointcxx . . $ FormAddAccount#selectedEntryPoint(8ff52ce668522518).(); |
| 36 | ServiceRootcxx . . $ ServiceRoot#* new_root = point->createNewRootcxx . . $ ServiceEntryPoint#createNewRoot(56209a8cf0725652).(); |
| 37 | |
| 38 | if (new_root != nullptr) { |
| 39 | m_modelcxx . . $ FormAddAccount#m_model.->addServiceAccountcxx . . $ FeedsModel#addServiceAccount(4ebf307b9720c1e).(new_root, true); |
| 40 | } |
| 41 | else { |
| 42 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_COREcxx . . $ `src/librssguard/definitions/definitions.h:178:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cannot create new account."; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | void FormAddAccountcxx . . $ FormAddAccount#::showAccountDetailscxx . . $ FormAddAccount#showAccountDetails(49f6e7a06ebc5aa8).() { |
| 47 | ServiceEntryPointcxx . . $ ServiceEntryPoint#* point = selectedEntryPointcxx . . $ FormAddAccount#selectedEntryPoint(8ff52ce668522518).(); |
| 48 | |
| 49 | if (point != nullptr) { |
| 50 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_lblDetailscxx . . $ Ui_FormAddAccount#m_lblDetails.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(point->descriptioncxx . . $ ServiceEntryPoint#description(6ef7b6c27b00b43d).()); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | ServiceEntryPointcxx . . $ ServiceEntryPoint#* FormAddAccountcxx . . $ FormAddAccount#::selectedEntryPointcxx . . $ FormAddAccount#selectedEntryPoint(8ff52ce668522518).() const { |
| 55 | return reinterpret_cast<ServiceEntryPointcxx . . $ ServiceEntryPoint#*>(m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->currentItemcxx . . $ QListWidget#currentItem(a843e491ce3ee2b1).() |
| 56 | ->datacxx . . $ QListWidgetItem#data(fb36142a814bbf95).(Qtcxx . . $ Qt/::ItemDataRolecxx . . $ Qt/ItemDataRole#::UserRolecxx . . $ Qt/UserRole.) |
| 57 | .valuecxx . . $ QVariant#value(1e6269539e51e84a).<intptr_tcxx . . $ intptr_t#>()); |
| 58 | } |
| 59 | |
| 60 | void FormAddAccountcxx . . $ FormAddAccount#::loadEntryPointscxx . . $ FormAddAccount#loadEntryPoints(49f6e7a06ebc5aa8).() { |
| 61 | for (const ServiceEntryPointcxx . . $ ServiceEntryPoint#* entry_point : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(m_entryPointscxx . . $ FormAddAccount#m_entryPoints.)) { |
| 62 | QListWidgetItemcxx . . $ QListWidgetItem#* item = new QListWidgetItemcxx . . $ QListWidgetItem#(entry_point->iconcxx . . $ ServiceEntryPoint#icon(952ef71f8967d9eb).(), entry_point->namecxx . . $ ServiceEntryPoint#name(6ef7b6c27b00b43d).()); |
| 63 | |
| 64 | item->setToolTipcxx . . $ QListWidgetItem#setToolTip(3520e46b33348bf6).(entry_point->descriptioncxx . . $ ServiceEntryPoint#description(6ef7b6c27b00b43d).()); |
| 65 | item->setDatacxx . . $ QListWidgetItem#setData(e71f85060bf8a055).(Qtcxx . . $ Qt/::ItemDataRolecxx . . $ Qt/ItemDataRole#::UserRolecxx . . $ Qt/UserRole., QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(a298f533828df527).<intptr_tcxx . . $ intptr_t#>(reinterpret_cast<intptr_tcxx . . $ intptr_t#>(entry_point))); |
| 66 | |
| 67 | if (entry_point->codecxx . . $ ServiceEntryPoint#code(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(SERVICE_CODE_STD_RSScxx . . $ `src/librssguard/definitions/definitions.h:9:9`!)) { |
| 68 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->insertItemcxx . . $ QListWidget#insertItem(a4bbc2a5333b312d).(0, item); |
| 69 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->insertItemcxx . . $ QListWidget#insertItem(4b11a7293b4ed91c).(1, QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("--------")); |
| 70 | |
| 71 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(1)->setFlagscxx . . $ QListWidgetItem#setFlags(dc1db7281029bd82).(Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::ItemFlagcxx . . $ Qt/ItemFlag#::NoItemFlagscxx . . $ Qt/NoItemFlags.); |
| 72 | } |
| 73 | else { |
| 74 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->addItemcxx . . $ QListWidget#addItem(13c1c8ad030616f4).(item); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | m_uicxx . . $ FormAddAccount#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_listEntryPointscxx . . $ Ui_FormAddAccount#m_listEntryPoints.->setCurrentRowcxx . . $ QListWidget#setCurrentRow(d4f767463ce0a6b3).(0); |
| 79 | } |