| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/services/abstract/gui/formcategorydetails.cpp`/ |
| 2 | |
| 3 | #include "services/abstract/gui/formcategorydetails.h"cxx . . $ `<file>/src/librssguard/services/abstract/gui/formcategorydetails.h`/ |
| 4 | |
| 5 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 6 | #include "database/databasequeries.h"cxx . . $ `<file>/src/librssguard/database/databasequeries.h`/ |
| 7 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 8 | #include "exceptions/applicationexception.h"cxx . . $ `<file>/src/librssguard/exceptions/applicationexception.h`/ |
| 9 | #include "gui/dialogs/filedialog.h"cxx . . $ `<file>/src/librssguard/gui/dialogs/filedialog.h`/ |
| 10 | #include "gui/guiutilities.h"cxx . . $ `<file>/src/librssguard/gui/guiutilities.h`/ |
| 11 | #include "gui/reusable/baselineedit.h"cxx . . $ `<file>/src/librssguard/gui/reusable/baselineedit.h`/ |
| 12 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 13 | #include "services/abstract/category.h"cxx . . $ `<file>/src/librssguard/services/abstract/category.h`/ |
| 14 | #include "services/abstract/gui/multifeededitcheckbox.h"cxx . . $ `<file>/src/librssguard/services/abstract/gui/multifeededitcheckbox.h`/ |
| 15 | #include "services/abstract/rootitem.h"cxx . . $ `<file>/src/librssguard/services/abstract/rootitem.h`/ |
| 16 | |
| 17 | #include "ui_formcategorydetails.h"cxx . . $ `<file>/build/src/librssguard/ui_formcategorydetails.h`/ |
| 18 | |
| 19 | #include <QAction> |
| 20 | #include <QDialogButtonBox> |
| 21 | #include <QImageReader> |
| 22 | #include <QLineEdit> |
| 23 | #include <QMenu> |
| 24 | #include <QPushButton> |
| 25 | #include <QTextEdit> |
| 26 | #include <QToolButton> |
| 27 | |
| 28 | FormCategoryDetailscxx . . $ FormCategoryDetails#::FormCategoryDetailscxx . . $ FormCategoryDetails#FormCategoryDetails(a58ef70f26615382).(ServiceRootcxx . . $ ServiceRoot#* service_root, RootItemcxx . . $ RootItem#* parent_to_select, QWidgetcxx . . $ QWidget#* parent) |
| 29 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent), m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.(service_root), m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.(parent_to_select) { |
| 30 | initializecxx . . $ FormCategoryDetails#initialize(49f6e7a06ebc5aa8).(); |
| 31 | createConnectionscxx . . $ FormCategoryDetails#createConnections(49f6e7a06ebc5aa8).(); |
| 32 | |
| 33 | // Initialize text boxes. |
| 34 | onTitleChangedcxx . . $ FormCategoryDetails#onTitleChanged(3520e46b33348bf6).(QStringcxx . . $ QString#QString(ced63f7c635d850d).()); |
| 35 | onDescriptionChangedcxx . . $ FormCategoryDetails#onDescriptionChanged(3520e46b33348bf6).(QStringcxx . . $ QString#QString(ced63f7c635d850d).()); |
| 36 | } |
| 37 | |
| 38 | FormCategoryDetailscxx . . $ FormCategoryDetails#::~cxx . . $ FormCategoryDetails#`~FormCategoryDetails`(ced63f7c635d850d).FormCategoryDetailscxx . . $ FormCategoryDetails#() { |
| 39 | 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 FormCategoryDetails instance."; |
| 40 | } |
| 41 | |
| 42 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::createConnectionscxx . . $ FormCategoryDetails#createConnections(49f6e7a06ebc5aa8).() { |
| 43 | // General connections. |
| 44 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormCategoryDetails#m_buttonBox., &QDialogButtonBoxcxx . . $ QDialogButtonBox#::acceptedcxx . . $ QDialogButtonBox#accepted(49f6e7a06ebc5aa8)., this, &FormCategoryDetailscxx . . $ FormCategoryDetails#::applycxx . . $ FormCategoryDetails#apply(49f6e7a06ebc5aa8).); |
| 45 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).(), &BaseLineEditcxx . . $ BaseLineEdit#::textChangedcxx . . $ QLineEdit#textChanged(3520e46b33348bf6)., this, &FormCategoryDetailscxx . . $ FormCategoryDetails#::onTitleChangedcxx . . $ FormCategoryDetails#onTitleChanged(3520e46b33348bf6).); |
| 46 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).(), |
| 47 | &BaseLineEditcxx . . $ BaseLineEdit#::textChangedcxx . . $ QLineEdit#textChanged(3520e46b33348bf6)., |
| 48 | this, |
| 49 | &FormCategoryDetailscxx . . $ FormCategoryDetails#::onDescriptionChangedcxx . . $ FormCategoryDetails#onDescriptionChanged(3520e46b33348bf6).); |
| 50 | |
| 51 | // Icon connections. |
| 52 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_actionLoadIconFromFilecxx . . $ FormCategoryDetails#m_actionLoadIconFromFile., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., this, &FormCategoryDetailscxx . . $ FormCategoryDetails#::onLoadIconFromFilecxx . . $ FormCategoryDetails#onLoadIconFromFile(49f6e7a06ebc5aa8).); |
| 53 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_actionUseDefaultIconcxx . . $ FormCategoryDetails#m_actionUseDefaultIcon., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., this, &FormCategoryDetailscxx . . $ FormCategoryDetails#::onUseDefaultIconcxx . . $ FormCategoryDetails#onUseDefaultIcon(49f6e7a06ebc5aa8).); |
| 54 | } |
| 55 | |
| 56 | bool FormCategoryDetailscxx . . $ FormCategoryDetails#::isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(MultiFeedEditCheckBoxcxx . . $ MultiFeedEditCheckBox#* mcb) const { |
| 57 | return !m_isBatchEditcxx . . $ FormCategoryDetails#m_isBatchEdit. || mcb->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(); |
| 58 | } |
| 59 | |
| 60 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::loadCategoryDatacxx . . $ FormCategoryDetails#loadCategoryData(49f6e7a06ebc5aa8).() { |
| 61 | Categorycxx . . $ Category#* cat = categorycxx . . $ FormCategoryDetails#category(5a2a78a048fb49a8).<Categorycxx . . $ Category#>(); |
| 62 | |
| 63 | if (m_isBatchEditcxx . . $ FormCategoryDetails#m_isBatchEdit.) { |
| 64 | // We hook batch selectors. |
| 65 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbParentcxx . . $ Ui_FormCategoryDetails#m_mcbParent.->addActionWidgetcxx . . $ MultiFeedEditCheckBox#addActionWidget(108f35f7aa7f3cf9).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.); |
| 66 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbTitlecxx . . $ Ui_FormCategoryDetails#m_mcbTitle.->addActionWidgetcxx . . $ MultiFeedEditCheckBox#addActionWidget(108f35f7aa7f3cf9).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.); |
| 67 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbDescriptioncxx . . $ Ui_FormCategoryDetails#m_mcbDescription.->addActionWidgetcxx . . $ MultiFeedEditCheckBox#addActionWidget(108f35f7aa7f3cf9).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.); |
| 68 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbIconcxx . . $ Ui_FormCategoryDetails#m_mcbIcon.->addActionWidgetcxx . . $ MultiFeedEditCheckBox#addActionWidget(108f35f7aa7f3cf9).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.); |
| 69 | } |
| 70 | else { |
| 71 | // We hide batch selectors. |
| 72 | for (auto* cb : findChildrencxx . . $ QObject#findChildren(7208eee5b53db771).<MultiFeedEditCheckBoxcxx . . $ MultiFeedEditCheckBox#*>()) { |
| 73 | cb->hidecxx . . $ QWidget#hide(49f6e7a06ebc5aa8).(); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | loadCategoriescxx . . $ FormCategoryDetails#loadCategories(7ff72cd165d54968).(m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.->getSubTreeCategoriescxx . . $ RootItem#getSubTreeCategories(d8651057aa4a83be).(), m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot., cat); |
| 78 | |
| 79 | if (m_creatingNewcxx . . $ FormCategoryDetails#m_creatingNew.) { |
| 80 | 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`!("folder")), trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Add new category")); |
| 81 | |
| 82 | // Make sure that "default" icon is used as the default option for new |
| 83 | // categories. |
| 84 | m_actionUseDefaultIconcxx . . $ FormCategoryDetails#m_actionUseDefaultIcon.->triggercxx . . $ QAction#trigger(49f6e7a06ebc5aa8).(); |
| 85 | |
| 86 | // Load parent from suggested item. |
| 87 | if (m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect. != nullptr) { |
| 88 | if (m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category.) { |
| 89 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory. |
| 90 | ->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->findDatacxx . . $ QComboBox#findData(c0958019ae3ea991).(QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(8eccd985207c29dd).(m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.))); |
| 91 | } |
| 92 | else if (m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed.) { |
| 93 | int target_item = m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->findDatacxx . . $ QComboBox#findData(c0958019ae3ea991).(QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(a298f533828df527).(m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).())); |
| 94 | |
| 95 | if (target_item >= 0) { |
| 96 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(target_item); |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | else { |
| 102 | if (!m_isBatchEditcxx . . $ FormCategoryDetails#m_isBatchEdit.) { |
| 103 | GuiUtilitiescxx . . $ GuiUtilities#::applyDialogPropertiescxx . . $ GuiUtilities#applyDialogProperties(6e9150cdaac92159).(*this, cat->fullIconcxx . . $ RootItem#fullIcon(952ef71f8967d9eb).(), trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Edit \"%1\"").argcxx . . $ QString#arg(ad0bca07273edcc2).(cat->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).())); |
| 104 | } |
| 105 | else { |
| 106 | GuiUtilitiescxx . . $ GuiUtilities#::applyDialogPropertiescxx . . $ GuiUtilities#applyDialogProperties(6e9150cdaac92159).(*this, |
| 107 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("folder")), |
| 108 | trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Edit %n categories", nullptr, m_categoriescxx . . $ FormCategoryDetails#m_categories..sizecxx . . $ QList#size(6b0412d51016192f).())); |
| 109 | } |
| 110 | |
| 111 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->findDatacxx . . $ QComboBox#findData(c0958019ae3ea991).(QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(a298f533828df527).(cat->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()))); |
| 112 | } |
| 113 | |
| 114 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(cat->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 115 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(cat->descriptioncxx . . $ RootItem#description(6ef7b6c27b00b43d).()); |
| 116 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(cat->iconcxx . . $ RootItem#icon(952ef71f8967d9eb).()); |
| 117 | |
| 118 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setFocuscxx . . $ QWidget#setFocus(49f6e7a06ebc5aa8).(); |
| 119 | } |
| 120 | |
| 121 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::applycxx . . $ FormCategoryDetails#apply(49f6e7a06ebc5aa8).() { |
| 122 | QListcxx . . $ QList#<Categorycxx . . $ Category#*> cats = categoriescxx . . $ FormCategoryDetails#categories(1e5d3d3cd083a237).<Categorycxx . . $ Category#>(); |
| 123 | RootItemcxx . . $ RootItem#* parent = m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->currentDatacxx . . $ QComboBox#currentData(fb36142a814bbf95).().valuecxx . . $ QVariant#value(1e6269539e51e84a).<RootItemcxx . . $ RootItem#*>(); |
| 124 | QSqlDatabasecxx . . $ QSqlDatabase# database = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->databasecxx . . $ Application#database(4a253a6ca99872d8).()->drivercxx . . $ DatabaseFactory#driver(5299be7c9afd522d).()->connectioncxx . . $ DatabaseDriver#connection(32d6d64cc6e35a97).(metaObjectcxx . . $ QString#QString(85c52e162fed56f9).()->classNamecxx . . $ QMetaObject#className(a9f41ea0e82d88cf).()); |
| 125 | |
| 126 | for (Categorycxx . . $ Category#* cat : cats) { |
| 127 | if (isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbTitlecxx . . $ Ui_FormCategoryDetails#m_mcbTitle.)) { |
| 128 | cat->setTitlecxx . . $ RootItem#setTitle(3520e46b33348bf6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 129 | } |
| 130 | |
| 131 | if (isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbDescriptioncxx . . $ Ui_FormCategoryDetails#m_mcbDescription.)) { |
| 132 | cat->setDescriptioncxx . . $ RootItem#setDescription(3520e46b33348bf6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 133 | } |
| 134 | |
| 135 | if (isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbIconcxx . . $ Ui_FormCategoryDetails#m_mcbIcon.)) { |
| 136 | cat->setIconcxx . . $ RootItem#setIcon(71dcdac178620ed6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.->iconcxx . . $ QAbstractButton#icon(952ef71f8967d9eb).()); |
| 137 | } |
| 138 | |
| 139 | int new_parent_id; |
| 140 | |
| 141 | if (isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbParentcxx . . $ Ui_FormCategoryDetails#m_mcbParent.)) { |
| 142 | new_parent_id = parent->idcxx . . $ RootItem#id(455f465bc33b4cdf).(); |
| 143 | } |
| 144 | else { |
| 145 | new_parent_id = cat->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).(); |
| 146 | } |
| 147 | |
| 148 | try { |
| 149 | DatabaseQueriescxx . . $ DatabaseQueries#::createOverwriteCategorycxx . . $ DatabaseQueries#createOverwriteCategory(1aade24338114213).(database, cat, m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).(), new_parent_id); |
| 150 | } |
| 151 | catch (const ApplicationExceptioncxx . . $ ApplicationException#& ex) { |
| 152 | qFatalcxx . . $ `<external>/7280663963939302026/qlogging.h:172:9`!("Cannot save category: '%s'.", qPrintablecxx . . $ `<external>/13954984326995544643/qstring.h:1647:11`!(ex.message())); |
| 153 | } |
| 154 | |
| 155 | if (isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_mcbParentcxx . . $ Ui_FormCategoryDetails#m_mcbParent.)) { |
| 156 | m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.->requestItemReassignmentcxx . . $ ServiceRoot#requestItemReassignment(a5628b38272995c3).(cat, parent); |
| 157 | } |
| 158 | |
| 159 | if (m_creatingNewcxx . . $ FormCategoryDetails#m_creatingNew.) { |
| 160 | m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.->requestItemExpandcxx . . $ ServiceRoot#requestItemExpand(8e785c59da43649).({cxx . . $ QList#QList(b6da5b9a9f304025).parent}, true); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.->itemChangedcxx . . $ ServiceRoot#itemChanged(47657a4e8825adca).(categoriescxx . . $ FormCategoryDetails#categories(1e5d3d3cd083a237).<RootItemcxx . . $ RootItem#>()); |
| 165 | acceptcxx . . $ QDialog#accept(49f6e7a06ebc5aa8).(); |
| 166 | } |
| 167 | |
| 168 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::onTitleChangedcxx . . $ FormCategoryDetails#onTitleChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& new_title) { |
| 169 | if (!new_title.simplifiedcxx . . $ QString#simplified(dca2c5857e9adf82).().isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 170 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormCategoryDetails#m_buttonBox.->buttoncxx . . $ QDialogButtonBox#button(3b1c1f83a3cc2105).(QDialogButtonBoxcxx . . $ QDialogButtonBox#::StandardButtoncxx . . $ QDialogButtonBox#StandardButton#::Okcxx . . $ QDialogButtonBox#Ok.)->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 171 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(WidgetWithStatuscxx . . $ WidgetWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Okcxx . . $ WidgetWithStatus#StatusType#Ok., trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Category name is ok.")); |
| 172 | } |
| 173 | else { |
| 174 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormCategoryDetails#m_buttonBox.->buttoncxx . . $ QDialogButtonBox#button(3b1c1f83a3cc2105).(QDialogButtonBoxcxx . . $ QDialogButtonBox#::StandardButtoncxx . . $ QDialogButtonBox#StandardButton#::Okcxx . . $ QDialogButtonBox#Ok.)->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 175 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(WidgetWithStatuscxx . . $ WidgetWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Errorcxx . . $ WidgetWithStatus#StatusType#Error., trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Category name is too short.")); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::onDescriptionChangedcxx . . $ FormCategoryDetails#onDescriptionChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& new_description) { |
| 180 | if (new_description.simplifiedcxx . . $ QString#simplified(dca2c5857e9adf82).().isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 181 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(LineEditWithStatuscxx . . $ LineEditWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Warningcxx . . $ WidgetWithStatus#StatusType#Warning., trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Description is empty.")); |
| 182 | } |
| 183 | else { |
| 184 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(LineEditWithStatuscxx . . $ LineEditWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType#::Okcxx . . $ WidgetWithStatus#StatusType#Ok., trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("The description is ok.")); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::onLoadIconFromFilecxx . . $ FormCategoryDetails#onLoadIconFromFile(49f6e7a06ebc5aa8).() { |
| 189 | auto supported_formats = QImageReadercxx . . $ QImageReader#::supportedImageFormatscxx . . $ QImageReader#supportedImageFormats(ed7db3712f812397).(); |
| 190 | auto prefixed_formats = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(supported_formats) |
| 191 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](const QByteArraycxx . . $ QByteArray#& frmt) { |
| 192 | return QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*.%1").argcxx . . $ QString#arg(ad0bca07273edcc2).(QStringcxx . . $ QString#::fromLocal8Bitcxx . . $ QString#fromLocal8Bit(4e15edac36d215be).(frmt)); |
| 193 | }) |
| 194 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 195 | |
| 196 | QStringListcxx . . $ QStringList# list_formats = FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QStringList, prefixed_formats); |
| 197 | QStringcxx . . $ QString# fil = FileDialogcxx . . $ FileDialog#::openFileNamecxx . . $ FileDialog#openFileName(7deab5c64a7710be).(this, |
| 198 | trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Select icon file for the category"), |
| 199 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->homeFoldercxx . . $ Application#homeFolder(6ef7b6c27b00b43d).(), |
| 200 | trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Images (%1)").argcxx . . $ QString#arg(ad0bca07273edcc2).(list_formats.joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).(QL1Ccxx . . $ `src/librssguard/definitions/definitions.h:455:9`!(' '))), |
| 201 | nullptr, |
| 202 | GENERAL_REMEMBERED_PATHcxx . . $ `src/librssguard/gui/dialogs/filedialog.h:9:9`!); |
| 203 | |
| 204 | if (!fil.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 205 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(fil)); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::onUseDefaultIconcxx . . $ FormCategoryDetails#onUseDefaultIcon(49f6e7a06ebc5aa8).() { |
| 210 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(ced63f7c635d850d).()); |
| 211 | } |
| 212 | |
| 213 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::initializecxx . . $ FormCategoryDetails#initialize(49f6e7a06ebc5aa8).() { |
| 214 | m_uicxx . . $ FormCategoryDetails#m_ui..resetcxx . . $ QScopedPointer#reset(b1f27668ced7db9d).(new Uicxx . . $ Ui/::FormCategoryDetailscxx . . $ Ui/FormCategoryDetails#()); |
| 215 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).setupUicxx . . $ Ui_FormCategoryDetails#setupUi(d194de0c0f68c28b).(this); |
| 216 | |
| 217 | // Set text boxes. |
| 218 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setPlaceholderTextcxx . . $ QLineEdit#setPlaceholderText(3520e46b33348bf6).(trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Category title")); |
| 219 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Set title for your category.")); |
| 220 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setPlaceholderTextcxx . . $ QLineEdit#setPlaceholderText(3520e46b33348bf6).(trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Category description")); |
| 221 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Set description for your category.")); |
| 222 | |
| 223 | // Setup button box. |
| 224 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormCategoryDetails#m_buttonBox.->buttoncxx . . $ QDialogButtonBox#button(3b1c1f83a3cc2105).(QDialogButtonBoxcxx . . $ QDialogButtonBox#::StandardButtoncxx . . $ QDialogButtonBox#StandardButton#::Okcxx . . $ QDialogButtonBox#Ok.)->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 225 | |
| 226 | // Setup menu & actions for icon selection. |
| 227 | m_iconMenucxx . . $ FormCategoryDetails#m_iconMenu. = new QMenucxx . . $ QMenu#QMenu(90d5708627041e22).(trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Icon selection"), this); |
| 228 | m_actionLoadIconFromFilecxx . . $ FormCategoryDetails#m_actionLoadIconFromFile. = |
| 229 | new QActioncxx . . $ QAction#(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("image-x-generic")), trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Load icon from file..."), this); |
| 230 | m_actionUseDefaultIconcxx . . $ FormCategoryDetails#m_actionUseDefaultIcon. = |
| 231 | new QActioncxx . . $ QAction#(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("folder")), trcxx . . $ FormCategoryDetails#tr(75d9f1c324b4579d).("Use default icon from icon theme"), this); |
| 232 | m_iconMenucxx . . $ FormCategoryDetails#m_iconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(m_actionLoadIconFromFilecxx . . $ FormCategoryDetails#m_actionLoadIconFromFile.); |
| 233 | m_iconMenucxx . . $ FormCategoryDetails#m_iconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(m_actionUseDefaultIconcxx . . $ FormCategoryDetails#m_actionUseDefaultIcon.); |
| 234 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.->setMenucxx . . $ QToolButton#setMenu(cb52c12b49e9b51b).(m_iconMenucxx . . $ FormCategoryDetails#m_iconMenu.); |
| 235 | |
| 236 | // Setup tab order. |
| 237 | setTabOrdercxx . . $ QWidget#setTabOrder(84f7ac92c52de9f6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory., m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()); |
| 238 | setTabOrdercxx . . $ QWidget#setTabOrder(84f7ac92c52de9f6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).(), m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()); |
| 239 | setTabOrdercxx . . $ QWidget#setTabOrder(84f7ac92c52de9f6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtDescriptioncxx . . $ Ui_FormCategoryDetails#m_txtDescription.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).(), m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon.); |
| 240 | setTabOrdercxx . . $ QWidget#setTabOrder(84f7ac92c52de9f6).(m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_btnIconcxx . . $ Ui_FormCategoryDetails#m_btnIcon., m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_buttonBoxcxx . . $ Ui_FormCategoryDetails#m_buttonBox.); |
| 241 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_txtTitlecxx . . $ Ui_FormCategoryDetails#m_txtTitle.->lineEditcxx . . $ LineEditWithStatus#lineEdit(b5c214bfbaa3003e).()->setFocuscxx . . $ QWidget#setFocus(1af6d7c634d2a8ce).(Qtcxx . . $ Qt/::FocusReasoncxx . . $ Qt/FocusReason#::TabFocusReasoncxx . . $ Qt/TabFocusReason.); |
| 242 | } |
| 243 | |
| 244 | void FormCategoryDetailscxx . . $ FormCategoryDetails#::loadCategoriescxx . . $ FormCategoryDetails#loadCategories(7ff72cd165d54968).(const QListcxx . . $ QList#<Categorycxx . . $ Category#*>& categories, |
| 245 | RootItemcxx . . $ RootItem#* root_item, |
| 246 | Categorycxx . . $ Category#* input_category) { |
| 247 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->addItemcxx . . $ QComboBox#addItem(9ae2da45ae734932).(root_item->iconcxx . . $ RootItem#icon(952ef71f8967d9eb).(), root_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).(), QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(8eccd985207c29dd).(root_item)); |
| 248 | |
| 249 | for (Categorycxx . . $ Category#* category : categories) { |
| 250 | if (input_category != nullptr && (category == input_category || category->isChildOfcxx . . $ RootItem#isChildOf(fac344fa80e9abcf).(input_category))) { |
| 251 | // This category cannot be selected as the new |
| 252 | // parent for currently edited category, so |
| 253 | // don't add it. |
| 254 | continue; |
| 255 | } |
| 256 | |
| 257 | m_uicxx . . $ FormCategoryDetails#m_ui.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).m_cmbParentCategorycxx . . $ Ui_FormCategoryDetails#m_cmbParentCategory.->addItemcxx . . $ QComboBox#addItem(9ae2da45ae734932).(category->datacxx . . $ RootItem#data(db8258505c7ad0b0).(FDS_MODEL_TITLE_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:339:9`!, Qtcxx . . $ Qt/::DecorationRolecxx . . $ Qt/DecorationRole.).valuecxx . . $ QVariant#value(1e6269539e51e84a).<QIconcxx . . $ QIcon#>(), |
| 258 | category->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).(), |
| 259 | QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(8eccd985207c29dd).(category)); |
| 260 | } |
| 261 | } |