From 3937d55f556c7e817638c6ff259754e29262f38b Mon Sep 17 00:00:00 2001 From: Richard Maudsley Date: Tue, 21 Jan 2014 08:52:09 +0000 Subject: Added sound file picker. Change-Id: I68a1884f052e0016c177fe11fbb76564ac0fb3bc 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) -- cgit v0.10.2-6-g49f6