2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Refactor calls settings panel.

This commit is contained in:
John Preston
2019-01-11 14:07:56 +04:00
parent 8711830f66
commit 65430d92ea
10 changed files with 284 additions and 193 deletions

View File

@@ -652,14 +652,24 @@ void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCal
}
void OpenSystemSettingsForPermission(PermissionType type) {
if (type==PermissionType::Microphone) {
ShellExecute(NULL, L"open", L"ms-settings:privacy-microphone", NULL, NULL, SW_SHOWDEFAULT);
if (type == PermissionType::Microphone) {
crl::on_main([] {
ShellExecute(
nullptr,
L"open",
L"ms-settings:privacy-microphone",
nullptr,
nullptr,
SW_SHOWDEFAULT);
});
}
}
bool OpenSystemSettings(SystemSettingsType type) {
if (type == SystemSettingsType::Audio) {
WinExec("control.exe mmsys.cpl", SW_SHOW);
crl::on_main([] {
WinExec("control.exe mmsys.cpl", SW_SHOW);
});
}
return true;
}