#define IDS_TRAYMENU_MUTE_ALL_DEVICES 410
#define IDS_TRAYMENU_SETTINGS 411
#define IDS_TRAYMENU_EXIT 412
+#define IDS_SETTINGS_BTN_SAVE 1000
+#define IDS_SETTINGS_BTN_CANCEL 1001
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE 1101
+#define IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE 1102
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL 1103
// Next default values for new objects
//
btdi.dwSize = sizeof(btdi);
HBLUETOOTH_DEVICE_FIND hBtDevFind = BluetoothFindFirstDevice(&bfrp, &btdi);
if (hBtDevFind == nullptr) {
- PrintWindowsError(L"BluetoothFindFirstDevice");
log.WriteWindowsError(L"BluetoothFindFirstDevice", GetLastError());
} else {
do {
return false;
}
+static void LoadBluetoothAddDlgTranslation(HWND hDlg, bool isEdit)
+{
+ WMi18n &i18n = WMi18n::GetInstance();
+ if (isEdit) {
+ i18n.SetItemText(hDlg, IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE);
+ } else {
+ i18n.SetItemText(hDlg, IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE);
+ }
+ i18n.SetItemText(hDlg, IDC_LABEL_BT_DEVICE_NAME, IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL);
+ i18n.SetItemText(hDlg, IDOK, IDS_SETTINGS_BTN_SAVE);
+ i18n.SetItemText(hDlg, IDCANCEL, IDS_SETTINGS_BTN_CANCEL);
+}
+
static INT_PTR CALLBACK Settings_BluetoothAddDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
return FALSE;
}
SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(btDeviceData));
+ LoadBluetoothAddDlgTranslation(hDlg, btDeviceData->devName.length() == 0);
- if (btDeviceData->devName.length() == 0) {
- if (!SetWindowTextW(hDlg, L"Add Bluetooth device")) {
- PrintWindowsError(L"SetWindowText", GetLastError());
- return FALSE;
- }
- } else {
- if (!SetWindowTextW(hDlg, L"Edit Bluetooth device")
- || !SetWindowTextW(GetDlgItem(hDlg, IDC_BT_DEVICE_NAME),
- btDeviceData->devName.c_str())) {
- PrintWindowsError(L"SetWindowText", GetLastError());
- return FALSE;
- }
- }
// Fill Combobox
std::vector<std::wstring> registeredBtDevices;
if (GetPairedBtAudioDevices(registeredBtDevices)) {
BEGIN
DEFPUSHBUTTON "Save",IDOK,91,41,50,14
PUSHBUTTON "Cancel",IDCANCEL,144,41,50,14
- LTEXT "Bluetooth device name:",IDC_STATIC,7,7,187,14
+ LTEXT "Bluetooth device name:",IDC_LABEL_BT_DEVICE_NAME,7,7,187,14
COMBOBOX IDC_BT_DEVICE_NAME,7,22,187,17,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDS_TRAYMENU_EXIT "Exit"
END
+STRINGTABLE
+BEGIN
+ IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE "Add bluetooth device"
+ IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE "Edit bluetooth device"
+ IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL "Bluetooth device name:"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_SETTINGS_BTN_SAVE "Save"
+ IDS_SETTINGS_BTN_CANCEL "Cancel"
+END
+
#endif // English (United Kingdom) resources
/////////////////////////////////////////////////////////////////////////////
#define IDS_TRAYMENU_MUTE_ALL_DEVICES 410
#define IDS_TRAYMENU_SETTINGS 411
#define IDS_TRAYMENU_EXIT 412
+#define IDS_SETTINGS_BTN_SAVE 1000
#define IDC_LINK_HOMEPAGE 1001
+#define IDS_SETTINGS_BTN_CANCEL 1001
#define IDC_LINK_SUPPORT 1002
#define IDC_LINK_PROJECT 1002
#define IDC_ENABLEQUIETHOURS 1003
#define IDC_ENDPOINT_NAME 1049
#define IDC_MUTEDELAY 1050
#define IDC_LANGUAGE 1051
+#define IDC_LABEL_BT_DEVICE_NAME 1052
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE 1101
+#define IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE 1102
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL 1103
#define ID_TRAYMENU_INFO 40001
#define ID_TRAYMENU_ 40002
#define ID_TRAYMENU_MUTEON 40003
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 140
#define _APS_NEXT_COMMAND_VALUE 40041
-#define _APS_NEXT_CONTROL_VALUE 1052
+#define _APS_NEXT_CONTROL_VALUE 1053
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif