| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/gui/notifications/singlenotificationeditor.cpp`/ |
| 2 | |
| 3 | #include "gui/notifications/singlenotificationeditor.h"cxx . . $ `<file>/src/librssguard/gui/notifications/singlenotificationeditor.h`/ |
| 4 | |
| 5 | #include "gui/dialogs/filedialog.h"cxx . . $ `<file>/src/librssguard/gui/dialogs/filedialog.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 | |
| 9 | #include <QCompleter> |
| 10 | #include <QFileSystemModel> |
| 11 | |
| 12 | SingleNotificationEditorcxx . . $ SingleNotificationEditor#::SingleNotificationEditorcxx . . $ SingleNotificationEditor#SingleNotificationEditor(1e84aca3ec06c154).(const Notificationcxx . . $ Notification#& notification, QWidgetcxx . . $ QWidget#* parent) |
| 13 | : QGroupBoxcxx . . $ QGroupBox#(parent), m_notificationEventcxx . . $ SingleNotificationEditor#m_notificationEvent.(Notificationcxx . . $ Notification#::Eventcxx . . $ Notification#Event#::NoEventcxx . . $ Notification#Event#NoEvent.) { |
| 14 | m_uicxx . . $ SingleNotificationEditor#m_ui..setupUicxx . . $ Ui_SingleNotificationEditor#setupUi(8217eace75329612).(this); |
| 15 | |
| 16 | #if defined(Q_OS_OS2) |
| 17 | m_ui.m_wdgSound->setVisible(false); |
| 18 | #else |
| 19 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_btnBrowseSoundcxx . . $ Ui_SingleNotificationEditor#m_btnBrowseSound.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("document-open"))); |
| 20 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_btnPlaySoundcxx . . $ Ui_SingleNotificationEditor#m_btnPlaySound.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->fromThemecxx . . $ IconFactory#fromTheme(e457fbbee8993f3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("media-playback-start"))); |
| 21 | #endif |
| 22 | |
| 23 | loadNotificationcxx . . $ SingleNotificationEditor#loadNotification(432d67552e9d770b).(notification); |
| 24 | |
| 25 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_btnPlaySoundcxx . . $ Ui_SingleNotificationEditor#m_btnPlaySound., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::playSoundcxx . . $ SingleNotificationEditor#playSound(49f6e7a06ebc5aa8).); |
| 26 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_btnBrowseSoundcxx . . $ Ui_SingleNotificationEditor#m_btnBrowseSound., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::selectSoundFilecxx . . $ SingleNotificationEditor#selectSoundFile(49f6e7a06ebc5aa8).); |
| 27 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_txtSoundcxx . . $ Ui_SingleNotificationEditor#m_txtSound., &QLineEditcxx . . $ QLineEdit#::textChangedcxx . . $ QLineEdit#textChanged(3520e46b33348bf6)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8).); |
| 28 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbBallooncxx . . $ Ui_SingleNotificationEditor#m_cbBalloon., &QCheckBoxcxx . . $ QCheckBox#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8).); |
| 29 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbDialogscxx . . $ Ui_SingleNotificationEditor#m_cbDialogs., &QCheckBoxcxx . . $ QCheckBox#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8).); |
| 30 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbPlaySoundcxx . . $ Ui_SingleNotificationEditor#m_cbPlaySound., &QCheckBoxcxx . . $ QCheckBox#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8).); |
| 31 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_uicxx . . $ SingleNotificationEditor#m_ui..m_slidVolumecxx . . $ Ui_SingleNotificationEditor#m_slidVolume., &QSlidercxx . . $ QSlider#::valueChangedcxx . . $ QAbstractSlider#valueChanged(d4f767463ce0a6b3)., this, &SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationChangedcxx . . $ SingleNotificationEditor#notificationChanged(49f6e7a06ebc5aa8).); |
| 32 | |
| 33 | QCompletercxx . . $ QCompleter#* completer = new QCompletercxx . . $ QCompleter#QCompleter(78e4acac01d4ee4c).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->builtinSoundscxx . . $ Application#builtinSounds(2b25566bdf736d18).(), this); |
| 34 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_txtSoundcxx . . $ Ui_SingleNotificationEditor#m_txtSound.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 35 | |
| 36 | setFixedHeightcxx . . $ QWidget#setFixedHeight(d4f767463ce0a6b3).(sizeHintcxx . . $ QWidget#sizeHint(4b3b776e5ee2b367).().heightcxx . . $ QSize#height(ea6fe5115c70a13f).()); |
| 37 | } |
| 38 | |
| 39 | Notificationcxx . . $ Notification# SingleNotificationEditorcxx . . $ SingleNotificationEditor#::notificationcxx . . $ SingleNotificationEditor#notification(1421dd5d50d2fb71).() const { |
| 40 | return Notificationcxx . . $ Notification#Notification(113beba568247365).(m_notificationEventcxx . . $ SingleNotificationEditor#m_notificationEvent., |
| 41 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbBallooncxx . . $ Ui_SingleNotificationEditor#m_cbBalloon.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(), |
| 42 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbDialogscxx . . $ Ui_SingleNotificationEditor#m_cbDialogs.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(), |
| 43 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbPlaySoundcxx . . $ Ui_SingleNotificationEditor#m_cbPlaySound.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(), |
| 44 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_txtSoundcxx . . $ Ui_SingleNotificationEditor#m_txtSound.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(), |
| 45 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_slidVolumecxx . . $ Ui_SingleNotificationEditor#m_slidVolume.->valuecxx . . $ QAbstractSlider#value(455f465bc33b4cdf).()); |
| 46 | } |
| 47 | |
| 48 | void SingleNotificationEditorcxx . . $ SingleNotificationEditor#::selectSoundFilecxx . . $ SingleNotificationEditor#selectSoundFile(49f6e7a06ebc5aa8).() { |
| 49 | auto fil = FileDialogcxx . . $ FileDialog#::openFileNamecxx . . $ FileDialog#openFileName(7deab5c64a7710be).(windowcxx . . $ QWidget#window(27f420ad5cce8994).(), |
| 50 | trcxx . . $ SingleNotificationEditor#tr(75d9f1c324b4579d).("Select sound file"), |
| 51 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->homeFoldercxx . . $ Application#homeFolder(6ef7b6c27b00b43d).(), |
| 52 | trcxx . . $ SingleNotificationEditor#tr(75d9f1c324b4579d).("WAV files (*.wav);;MP3 files (*.mp3)"), |
| 53 | nullptr, |
| 54 | GENERAL_REMEMBERED_PATHcxx . . $ `src/librssguard/gui/dialogs/filedialog.h:9:9`!); |
| 55 | |
| 56 | if (!fil.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 57 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_txtSoundcxx . . $ Ui_SingleNotificationEditor#m_txtSound.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(fil); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void SingleNotificationEditorcxx . . $ SingleNotificationEditor#::playSoundcxx . . $ SingleNotificationEditor#playSound(49f6e7a06ebc5aa8).() { |
| 62 | notificationcxx . . $ SingleNotificationEditor#notification(1421dd5d50d2fb71).().playSoundcxx . . $ Notification#playSound(20e408e26c1df836).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!); |
| 63 | } |
| 64 | |
| 65 | void SingleNotificationEditorcxx . . $ SingleNotificationEditor#::loadNotificationcxx . . $ SingleNotificationEditor#loadNotification(432d67552e9d770b).(const Notificationcxx . . $ Notification#& notification) { |
| 66 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_txtSoundcxx . . $ Ui_SingleNotificationEditor#m_txtSound.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(notification.soundPathcxx . . $ Notification#soundPath(6ef7b6c27b00b43d).()); |
| 67 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_slidVolumecxx . . $ Ui_SingleNotificationEditor#m_slidVolume.->setValuecxx . . $ QAbstractSlider#setValue(d4f767463ce0a6b3).(notification.volumecxx . . $ Notification#volume(455f465bc33b4cdf).()); |
| 68 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbBallooncxx . . $ Ui_SingleNotificationEditor#m_cbBalloon.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(notification.balloonEnabledcxx . . $ Notification#balloonEnabled(50ce9a9e25b4a850).()); |
| 69 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbDialogscxx . . $ Ui_SingleNotificationEditor#m_cbDialogs.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(notification.dialogEnabledcxx . . $ Notification#dialogEnabled(50ce9a9e25b4a850).()); |
| 70 | m_uicxx . . $ SingleNotificationEditor#m_ui..m_cbPlaySoundcxx . . $ Ui_SingleNotificationEditor#m_cbPlaySound.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(notification.soundEnabledcxx . . $ Notification#soundEnabled(50ce9a9e25b4a850).()); |
| 71 | m_notificationEventcxx . . $ SingleNotificationEditor#m_notificationEvent. = notification.eventcxx . . $ Notification#event(752d85c5520a3778).(); |
| 72 | |
| 73 | setTitlecxx . . $ QGroupBox#setTitle(3520e46b33348bf6).(Notificationcxx . . $ Notification#::nameForEventcxx . . $ Notification#nameForEvent(50042268f9318a56).(notification.eventcxx . . $ Notification#event(752d85c5520a3778).())); |
| 74 | } |