summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-01-21 08:52:09 (GMT)
committerRichard Maudsley <richard.maudsley@isode.com>2014-01-21 08:52:09 (GMT)
commit3937d55f556c7e817638c6ff259754e29262f38b (patch)
treec7b3fd9f5ce451cf1cbe47aa1191b0ff081345a7 /Swift
parent4b076bfb2c95106d587949eab99b34e931dc6708 (diff)
downloadswift-3937d55f556c7e817638c6ff259754e29262f38b.zip
swift-3937d55f556c7e817638c6ff259754e29262f38b.tar.bz2
Added sound file picker.
Change-Id: I68a1884f052e0016c177fe11fbb76564ac0fb3bc
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp
index 06695ec..cb5f058 100644
--- a/Swift/QtUI/QtHighlightEditor.cpp
+++ b/Swift/QtUI/QtHighlightEditor.cpp
@@ -47,7 +47,7 @@ QtHighlightEditor::QtHighlightEditor(QtSettingsProvider* settings, QWidget* pare
connect(ui_.defaultSoundRadio, SIGNAL(clicked()), SLOT(soundOtherSelect()));
connect(ui_.customSoundRadio, SIGNAL(clicked()), SLOT(soundCustomSelect()));
- /* replace the static lineedit control with the roster autocompleter */
+ /* replace the static line-edit control with the roster autocompleter */
ui_.dummySenderName->setVisible(false);
jid_ = new QtSuggestingJIDInput(this, settings);
ui_.senderName->addWidget(jid_);
@@ -72,6 +72,9 @@ QtHighlightEditor::QtHighlightEditor(QtSettingsProvider* settings, QWidget* pare
connect(ui_.defaultSoundRadio, SIGNAL(clicked()), SLOT(widgetClick()));
connect(ui_.customSoundRadio, SIGNAL(clicked()), SLOT(widgetClick()));
+ /* allow selection of a custom sound file */
+ connect(ui_.soundFileButton, SIGNAL(clicked()), SLOT(selectSoundFile()));
+
/* if these are not needed, then they should be removed */
ui_.moveUpButton->setVisible(false);
ui_.moveDownButton->setVisible(false);
@@ -352,7 +355,8 @@ void QtHighlightEditor::handleContactSuggestionRequested(const QString& text)
void QtHighlightEditor::selectSoundFile()
{
- /* TODO: bring up standard Qt file selector here */
+ QString path = QFileDialog::getOpenFileName(this, tr("Select sound file..."), QString(), "Sounds (*.wav)");
+ ui_.soundFile->setText(path);
}
void QtHighlightEditor::selectRow(int row)