Commit b1b00cee authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

settings: fix ringtone selection

- Move ringtone selection to account detail where
it belongs
- Use the selection model of ringtone model
- Fix ring ringtones install path
- Remove copy of ringtones in client git

Tuleap: #340

Change-Id: I75dd1205fd53d13db73b756b642bbe8c8487ba67
parent 7cf39e2d
......@@ -166,12 +166,11 @@ INSTALLS += QM_FILES
DISTFILES += \
License.rtf \
ringtones/konga.ul \
ring.nsi
win32 {
RINGTONES.files = ringtones
RINGTONES.files = $${RING}/share/ring/ringtones
RINGTONES.path = $$OUT_PWD/release
PACKAGING.files = ring.nsi images/ring.ico
......
......@@ -28,6 +28,7 @@
#include "protocolmodel.h"
#include "certificate.h"
#include "ciphermodel.h"
#include "ringtonemodel.h"
AccountDetails::AccountDetails(QWidget *parent) :
QWidget(parent),
......@@ -148,6 +149,11 @@ AccountDetails::setAccount(Account* currentAccount) {
});
ui->cipherListView->setModel(currentAccount_->cipherModel());
disconnect(ui->ringtonesBox);
ui->ringtonesBox->setModel(&RingtoneModel::instance());
ui->ringtonesBox->setCurrentIndex(RingtoneModel::instance().selectionModel(currentAccount_)->currentIndex().row());
connect(ui->ringtonesBox, SIGNAL(currentIndexChanged(int)), this, SLOT(ringtonesBoxCurrentIndexChanged(int)));
}
void
......@@ -207,3 +213,17 @@ AccountDetails::videoCodecSelectionChanged(const QItemSelection& selected,
auto idx = codecModel_->videoCodecs()->mapToSource(selected.indexes().at(0));
codecModel_->selectionModel()->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect);
}
void
AccountDetails::ringtonesBoxCurrentIndexChanged(int index)
{
RingtoneModel::instance().selectionModel(currentAccount_)->setCurrentIndex(
RingtoneModel::instance().index(index, 0), QItemSelectionModel::ClearAndSelect);
}
void
AccountDetails::on_playButton_clicked()
{
RingtoneModel::instance().play(RingtoneModel::instance().index(
ui->ringtonesBox->currentIndex(), 0));
}
......@@ -54,6 +54,10 @@ private slots:
private slots:
void onCertButtonClicked();
void ringtonesBoxCurrentIndexChanged(int index);
void on_playButton_clicked();
private:
Ui::AccountDetails *ui;
CodecModel* codecModel_;
......
......@@ -55,8 +55,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>646</height>
<width>733</width>
<height>668</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
......@@ -140,7 +140,7 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,0,0,0,0,0,0">
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,0,0,0,0,0,0,0,0">
<property name="spacing">
<number>5</number>
</property>
......@@ -413,6 +413,49 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_28">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Ringtone Selection</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="ringtonesBox"/>
</item>
<item>
<widget class="QPushButton" name="playButton">
<property name="text">
<string>Play</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -1910,7 +1953,7 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="dtmfGroup"/>
<buttongroup name="publishGroup"/>
<buttongroup name="dtmfGroup"/>
</buttongroups>
</ui>
......@@ -70,7 +70,6 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
ui->accountTypeBox->setModel(accountModel_->protocolModel());
ui->startupBox->setChecked(Utils::CheckStartupLink());
ui->ringtonesBox->setModel(&RingtoneModel::instance());
ui->historyDaySettingsSpinBox->setValue(
CategorizedHistoryModel::instance().historyLimit());
ui->closeOrMinCheckBox->setChecked(settings_.value(
......
......@@ -107,45 +107,6 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Ringtones Selection</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="ringtonesBox"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="font">
......
This diff is collapsed.
......@@ -111,7 +111,7 @@ Utils::GetRingtonePath() {
GetCurrentDirectory(MAX_PATH, workingDirectory);
QString ringtonePath = QString::fromWCharArray(workingDirectory);
ringtonePath += "\\ringtones\\konga.ul";
ringtonePath += QStringLiteral("\\ringtones\\default.wav");
return ringtonePath;
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment