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 ...@@ -166,12 +166,11 @@ INSTALLS += QM_FILES
DISTFILES += \ DISTFILES += \
License.rtf \ License.rtf \
ringtones/konga.ul \
ring.nsi ring.nsi
win32 { win32 {
RINGTONES.files = ringtones RINGTONES.files = $${RING}/share/ring/ringtones
RINGTONES.path = $$OUT_PWD/release RINGTONES.path = $$OUT_PWD/release
PACKAGING.files = ring.nsi images/ring.ico PACKAGING.files = ring.nsi images/ring.ico
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "protocolmodel.h" #include "protocolmodel.h"
#include "certificate.h" #include "certificate.h"
#include "ciphermodel.h" #include "ciphermodel.h"
#include "ringtonemodel.h"
AccountDetails::AccountDetails(QWidget *parent) : AccountDetails::AccountDetails(QWidget *parent) :
QWidget(parent), QWidget(parent),
...@@ -148,6 +149,11 @@ AccountDetails::setAccount(Account* currentAccount) { ...@@ -148,6 +149,11 @@ AccountDetails::setAccount(Account* currentAccount) {
}); });
ui->cipherListView->setModel(currentAccount_->cipherModel()); 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 void
...@@ -207,3 +213,17 @@ AccountDetails::videoCodecSelectionChanged(const QItemSelection& selected, ...@@ -207,3 +213,17 @@ AccountDetails::videoCodecSelectionChanged(const QItemSelection& selected,
auto idx = codecModel_->videoCodecs()->mapToSource(selected.indexes().at(0)); auto idx = codecModel_->videoCodecs()->mapToSource(selected.indexes().at(0));
codecModel_->selectionModel()->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect); 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: ...@@ -54,6 +54,10 @@ private slots:
private slots: private slots:
void onCertButtonClicked(); void onCertButtonClicked();
void ringtonesBoxCurrentIndexChanged(int index);
void on_playButton_clicked();
private: private:
Ui::AccountDetails *ui; Ui::AccountDetails *ui;
CodecModel* codecModel_; CodecModel* codecModel_;
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>746</width> <width>733</width>
<height>646</height> <height>668</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_12"> <layout class="QVBoxLayout" name="verticalLayout_12">
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</layout> </layout>
</item> </item>
<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"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
...@@ -413,6 +413,49 @@ ...@@ -413,6 +413,49 @@
</property> </property>
</widget> </widget>
</item> </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> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
...@@ -1910,7 +1953,7 @@ ...@@ -1910,7 +1953,7 @@
</connection> </connection>
</connections> </connections>
<buttongroups> <buttongroups>
<buttongroup name="dtmfGroup"/>
<buttongroup name="publishGroup"/> <buttongroup name="publishGroup"/>
<buttongroup name="dtmfGroup"/>
</buttongroups> </buttongroups>
</ui> </ui>
...@@ -70,7 +70,6 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) : ...@@ -70,7 +70,6 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
ui->accountTypeBox->setModel(accountModel_->protocolModel()); ui->accountTypeBox->setModel(accountModel_->protocolModel());
ui->startupBox->setChecked(Utils::CheckStartupLink()); ui->startupBox->setChecked(Utils::CheckStartupLink());
ui->ringtonesBox->setModel(&RingtoneModel::instance());
ui->historyDaySettingsSpinBox->setValue( ui->historyDaySettingsSpinBox->setValue(
CategorizedHistoryModel::instance().historyLimit()); CategorizedHistoryModel::instance().historyLimit());
ui->closeOrMinCheckBox->setChecked(settings_.value( ui->closeOrMinCheckBox->setChecked(settings_.value(
......
...@@ -107,45 +107,6 @@ ...@@ -107,45 +107,6 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="font"> <property name="font">
......
This diff is collapsed.
...@@ -111,7 +111,7 @@ Utils::GetRingtonePath() { ...@@ -111,7 +111,7 @@ Utils::GetRingtonePath() {
GetCurrentDirectory(MAX_PATH, workingDirectory); GetCurrentDirectory(MAX_PATH, workingDirectory);
QString ringtonePath = QString::fromWCharArray(workingDirectory); QString ringtonePath = QString::fromWCharArray(workingDirectory);
ringtonePath += "\\ringtones\\konga.ul"; ringtonePath += QStringLiteral("\\ringtones\\default.wav");
return ringtonePath; return ringtonePath;
#else #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