| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/reusable/widgetwithstatus.cpp`/ |
| 2 | |
| 3 | #include "gui/reusable/widgetwithstatus.h"cxx . . $ `<file>/src/librssguard/gui/reusable/widgetwithstatus.h`/ |
| 4 | |
| 5 | #include "gui/reusable/plaintoolbutton.h"cxx . . $ `<file>/src/librssguard/gui/reusable/plaintoolbutton.h`/ |
| 6 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 7 | |
| 8 | #include <QHBoxLayout> |
| 9 | |
| 10 | WidgetWithStatuscxx . . $ WidgetWithStatus#::WidgetWithStatuscxx . . $ WidgetWithStatus#WidgetWithStatus(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent) : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent), m_wdgInputcxx . . $ WidgetWithStatus#m_wdgInput.(nullptr) { |
| 11 | m_layoutcxx . . $ WidgetWithStatus#m_layout. = new QHBoxLayoutcxx . . $ QHBoxLayout#QHBoxLayout(108f35f7aa7f3cf9).(this); |
| 12 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus. = new PlainToolButtoncxx . . $ PlainToolButton#PlainToolButton(108f35f7aa7f3cf9).(this); |
| 13 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setFocusPolicycxx . . $ QWidget#setFocusPolicy(84f385f4ea7c1696).(Qtcxx . . $ Qt/::FocusPolicycxx . . $ Qt/FocusPolicy#::NoFocuscxx . . $ Qt/NoFocus.); |
| 14 | m_iconProgresscxx . . $ WidgetWithStatus#m_iconProgress. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("view-refresh")); |
| 15 | m_iconInformationcxx . . $ WidgetWithStatus#m_iconInformation. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-information")); |
| 16 | m_iconWarningcxx . . $ WidgetWithStatus#m_iconWarning. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-warning")); |
| 17 | m_iconErrorcxx . . $ WidgetWithStatus#m_iconError. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-error")); |
| 18 | m_iconOkcxx . . $ WidgetWithStatus#m_iconOk. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-yes"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-ok")); |
| 19 | m_iconQuestioncxx . . $ WidgetWithStatus#m_iconQuestion. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dialog-question")); |
| 20 | |
| 21 | // Set layout properties. |
| 22 | m_layoutcxx . . $ WidgetWithStatus#m_layout.->setContentsMarginscxx . . $ QLayout#setContentsMargins(79c4c8645766fc71).({cxx . . $ QMargins#QMargins(ced63f7c635d850d).}); |
| 23 | |
| 24 | setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(m_layoutcxx . . $ WidgetWithStatus#m_layout.); |
| 25 | setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(StatusTypecxx . . $ WidgetWithStatus#StatusType#::Informationcxx . . $ WidgetWithStatus#StatusType#Information., {cxx . . $ QString#QString(ced63f7c635d850d).}); |
| 26 | } |
| 27 | |
| 28 | void WidgetWithStatuscxx . . $ WidgetWithStatus#::setStatuscxx . . $ WidgetWithStatus#setStatus(e987dce66bda7b0a).(WidgetWithStatuscxx . . $ WidgetWithStatus#::StatusTypecxx . . $ WidgetWithStatus#StatusType# status, const QStringcxx . . $ QString#& tooltip_text) { |
| 29 | m_statuscxx . . $ WidgetWithStatus#m_status. = status; |
| 30 | |
| 31 | switch (status) { |
| 32 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Informationcxx . . $ WidgetWithStatus#StatusType#Information.: |
| 33 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconInformationcxx . . $ WidgetWithStatus#m_iconInformation.); |
| 34 | break; |
| 35 | |
| 36 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Progresscxx . . $ WidgetWithStatus#StatusType#Progress.: |
| 37 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconProgresscxx . . $ WidgetWithStatus#m_iconProgress.); |
| 38 | break; |
| 39 | |
| 40 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Warningcxx . . $ WidgetWithStatus#StatusType#Warning.: |
| 41 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconWarningcxx . . $ WidgetWithStatus#m_iconWarning.); |
| 42 | break; |
| 43 | |
| 44 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Errorcxx . . $ WidgetWithStatus#StatusType#Error.: |
| 45 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconErrorcxx . . $ WidgetWithStatus#m_iconError.); |
| 46 | break; |
| 47 | |
| 48 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Okcxx . . $ WidgetWithStatus#StatusType#Ok.: |
| 49 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconOkcxx . . $ WidgetWithStatus#m_iconOk.); |
| 50 | break; |
| 51 | |
| 52 | case StatusTypecxx . . $ WidgetWithStatus#StatusType#::Questioncxx . . $ WidgetWithStatus#StatusType#Question.: |
| 53 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(m_iconQuestioncxx . . $ WidgetWithStatus#m_iconQuestion.); |
| 54 | break; |
| 55 | |
| 56 | default: |
| 57 | break; |
| 58 | } |
| 59 | |
| 60 | // Setup the tooltip text. |
| 61 | m_btnStatuscxx . . $ WidgetWithStatus#m_btnStatus.->setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(tooltip_text); |
| 62 | } |