Commit 031c305c authored by Edric Milaret's avatar Edric Milaret Committed by Guillaume Roguez

windows: fix invalid ringtones parameters

Also add ringtone to packaging

Refs #71986

Change-Id: I4cfa2ea99fd303f4f760b4de818374654912130a
parent 559bda52
......@@ -76,4 +76,16 @@ RC_FILE = ico.rc
DISTFILES += \
ring.wxs \
License.rtf
License.rtf \
ringtones/konga.ul
RINGTONES.files = ringtones
release:RINGTONES.path = $$OUT_PWD/release
PACKAGING.files = ring.wxs
release:PACKAGING.path = $$OUT_PWD/release
LICENSE.files = License.rtf
release:LICENSE.path = $$OUT_PWD/release
INSTALLS += RINGTONES PACKAGING LICENSE
......@@ -152,9 +152,10 @@ ConfigurationWidget::on_deleteAccountButton_clicked()
void
ConfigurationWidget::on_addAccountButton_clicked()
{
accountModel_->add("New Account",
auto account = accountModel_->add("New Account",
ui->accountTypeBox->model()->index(
ui->accountTypeBox->currentIndex(), 0));
account->setRingtonePath(Utils::GetRingtonePath());
accountModel_->save();
}
......
......@@ -52,6 +52,11 @@
<File Id='qwindowsDLL' Name='qwindows.dll' DiskId='1' Source='platforms/qwindows.dll' KeyPath='yes' />
</Component>
</Directory>
<Directory Id="ringtones" Name="ringtones">
<Component Id='RingtonesFiles' Guid='2B493BC2-281E-4B85-B93D-237DFFAD4D6E'>
<File Id='konga' Name='konga.ul' DiskId='1' Source='ringtones/konga.ul' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
......@@ -76,6 +81,7 @@
<ComponentRef Id='StdLibrary' />
<ComponentRef Id='QtDeps' />
<ComponentRef Id='QtPlatformsLibrary' />
<ComponentRef Id='RingtonesFiles' />
<ComponentRef Id='ProgramMenuDir' />
</Feature>
</Feature>
......
This diff is collapsed.
......@@ -79,3 +79,14 @@ Utils::CheckStartupLink() {
return PathFileExists(linkPath.c_str());
}
QString
Utils::GetRingtonePath() {
TCHAR workingDirectory[MAX_PATH];
GetCurrentDirectory(MAX_PATH, workingDirectory);
QString ringtonePath = QString::fromWCharArray(workingDirectory);
ringtonePath += "\\ringtones\\konga.ul";
return ringtonePath;
}
......@@ -27,6 +27,7 @@
#include <shlwapi.h>
#include <string>
#include <QString>
class Utils
{
......@@ -35,6 +36,7 @@ public:
static void DeleteStartupLink();
static bool CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszPathLink);
static bool CheckStartupLink();
static QString GetRingtonePath();
};
#endif // UTILS_H
......@@ -25,7 +25,8 @@ WizardDialog::~WizardDialog()
void
WizardDialog::on_buttonBox_accepted()
{
AccountModel::instance()->add(ui->usernameEdit->text(), Account::Protocol::RING);
auto account = AccountModel::instance()->add(ui->usernameEdit->text(), Account::Protocol::RING);
account->setRingtonePath(Utils::GetRingtonePath());
AccountModel::instance()->save();
Utils::CreateStartupLink();
}
......
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