diff options
author | Tobias Markmann <tm@ayena.de> | 2017-03-01 16:19:03 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2017-03-01 16:19:03 (GMT) |
commit | 1eac9453d347dea9a1d6490ff6a538291f5d3999 (patch) | |
tree | 0fc2ba5bdc4903f5ea93c0c06ef365dce2c5bafe /Swift/QtUI/QtHighlightNotificationConfigDialog.cpp | |
parent | b6fd152bf02199cf0a287af6031d75ccb8ae6117 (diff) | |
download | swift-1eac9453d347dea9a1d6490ff6a538291f5d3999.zip swift-1eac9453d347dea9a1d6490ff6a538291f5d3999.tar.bz2 |
Remove support for selecting custom notification sounds
Test-Information:
Tested on macOS 10.12.3 with Qt 5.7.1 that the custom
sound menu item was gone.
Change-Id: I75186d1a3b74db751fbdd5aaf54402f23f74661b
Diffstat (limited to 'Swift/QtUI/QtHighlightNotificationConfigDialog.cpp')
-rw-r--r-- | Swift/QtUI/QtHighlightNotificationConfigDialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtHighlightNotificationConfigDialog.cpp b/Swift/QtUI/QtHighlightNotificationConfigDialog.cpp index c4e64ab..19274a2 100644 --- a/Swift/QtUI/QtHighlightNotificationConfigDialog.cpp +++ b/Swift/QtUI/QtHighlightNotificationConfigDialog.cpp @@ -106,61 +106,61 @@ void QtHighlightNotificationConfigDialog::setHighlightManager(HighlightManager* highlightManager_ = highlightManager; } void QtHighlightNotificationConfigDialog::setContactSuggestions(const std::vector<Contact::ref>& /*suggestions*/) { } HighlightConfiguration QtHighlightNotificationConfigDialog::getHighlightConfigurationFromDialog() const { auto qtColorToOptionalString = [&](const QColor& color) { boost::optional<std::string> colorString; if (color.isValid()) { colorString = Q2PSTRING(color.name(QColor::HexRgb)); } return colorString; }; auto getHighlightActionFromWidgetItem = [&](const QTreeWidgetItem* item, int startingColumn) { HighlightAction action; action.setFrontColor(qtColorToOptionalString(item->data(startingColumn, QtColorSelectionStyledItemDelegate::DATA_ROLE).value<QColor>())); action.setBackColor(qtColorToOptionalString(item->data(startingColumn + 1, QtColorSelectionStyledItemDelegate::DATA_ROLE).value<QColor>())); std::string soundFilePath = Q2PSTRING(item->data(startingColumn + 2, Qt::EditRole).toString()); if (soundFilePath == "defaultSound") { action.setSoundFilePath(boost::optional<std::string>("")); } else if (soundFilePath.empty()) { action.setSoundFilePath(boost::optional<std::string>()); } else { - action.setSoundFilePath(boost::optional<std::string>(soundFilePath)); + action.setSoundFilePath(boost::optional<std::string>("")); } action.setSystemNotificationEnabled(item->data(startingColumn + 3, QtCheckBoxStyledItemDelegate::DATA_ROLE).toBool()); return action; }; HighlightConfiguration uiConfiguration; // contact highlights for (int i = 0; i < ui_.userHighlightTreeWidget->topLevelItemCount(); i++) { auto item = ui_.userHighlightTreeWidget->topLevelItem(i); HighlightConfiguration::ContactHighlight contactHighlight; contactHighlight.name = Q2PSTRING(item->data(0, Qt::EditRole).toString()); contactHighlight.action = getHighlightActionFromWidgetItem(item, 1); uiConfiguration.contactHighlights.push_back(contactHighlight); } // keyword highlights for (int i = 0; i < ui_.keywordHighlightTreeWidget->topLevelItemCount(); i++) { auto item = ui_.keywordHighlightTreeWidget->topLevelItem(i); HighlightConfiguration::KeywordHightlight keywordHighlight; keywordHighlight.keyword = Q2PSTRING(item->data(0, Qt::EditRole).toString()); keywordHighlight.matchCaseSensitive = item->data(1, QtCheckBoxStyledItemDelegate::DATA_ROLE).toBool(); keywordHighlight.action = getHighlightActionFromWidgetItem(item, 2); uiConfiguration.keywordHighlights.push_back(keywordHighlight); } // general configuration uiConfiguration.playSoundOnIncomingDirectMessages = ui_.playSoundOnDirectMessagesCheckBox->isChecked(); uiConfiguration.showNotificationOnIncomingDirectMessages = ui_.notificationOnDirectMessagesCheckBox->isChecked(); |