Skip to content
Snippets Groups Projects
Commit 031c305c authored by Edric Milaret's avatar Edric Milaret Committed by Guillaume Roguez
Browse files

windows: fix invalid ringtones parameters

Also add ringtone to packaging

Refs #71986

Change-Id: I4cfa2ea99fd303f4f760b4de818374654912130a
parent 559bda52
No related branches found
No related tags found
No related merge requests found
...@@ -76,4 +76,16 @@ RC_FILE = ico.rc ...@@ -76,4 +76,16 @@ RC_FILE = ico.rc
DISTFILES += \ DISTFILES += \
ring.wxs \ 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() ...@@ -152,9 +152,10 @@ ConfigurationWidget::on_deleteAccountButton_clicked()
void void
ConfigurationWidget::on_addAccountButton_clicked() ConfigurationWidget::on_addAccountButton_clicked()
{ {
accountModel_->add("New Account", auto account = accountModel_->add("New Account",
ui->accountTypeBox->model()->index( ui->accountTypeBox->model()->index(
ui->accountTypeBox->currentIndex(), 0)); ui->accountTypeBox->currentIndex(), 0));
account->setRingtonePath(Utils::GetRingtonePath());
accountModel_->save(); accountModel_->save();
} }
......
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
<File Id='qwindowsDLL' Name='qwindows.dll' DiskId='1' Source='platforms/qwindows.dll' KeyPath='yes' /> <File Id='qwindowsDLL' Name='qwindows.dll' DiskId='1' Source='platforms/qwindows.dll' KeyPath='yes' />
</Component> </Component>
</Directory> </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> </Directory>
</Directory> </Directory>
...@@ -76,6 +81,7 @@ ...@@ -76,6 +81,7 @@
<ComponentRef Id='StdLibrary' /> <ComponentRef Id='StdLibrary' />
<ComponentRef Id='QtDeps' /> <ComponentRef Id='QtDeps' />
<ComponentRef Id='QtPlatformsLibrary' /> <ComponentRef Id='QtPlatformsLibrary' />
<ComponentRef Id='RingtonesFiles' />
<ComponentRef Id='ProgramMenuDir' /> <ComponentRef Id='ProgramMenuDir' />
</Feature> </Feature>
</Feature> </Feature>
......
This diff is collapsed.
...@@ -79,3 +79,14 @@ Utils::CheckStartupLink() { ...@@ -79,3 +79,14 @@ Utils::CheckStartupLink() {
return PathFileExists(linkPath.c_str()); 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 @@ ...@@ -27,6 +27,7 @@
#include <shlwapi.h> #include <shlwapi.h>
#include <string> #include <string>
#include <QString>
class Utils class Utils
{ {
...@@ -35,6 +36,7 @@ public: ...@@ -35,6 +36,7 @@ public:
static void DeleteStartupLink(); static void DeleteStartupLink();
static bool CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszPathLink); static bool CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszPathLink);
static bool CheckStartupLink(); static bool CheckStartupLink();
static QString GetRingtonePath();
}; };
#endif // UTILS_H #endif // UTILS_H
...@@ -25,7 +25,8 @@ WizardDialog::~WizardDialog() ...@@ -25,7 +25,8 @@ WizardDialog::~WizardDialog()
void void
WizardDialog::on_buttonBox_accepted() 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(); AccountModel::instance()->save();
Utils::CreateStartupLink(); Utils::CreateStartupLink();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment