| 2893 | } |
| 2894 | |
| 2895 | void Key_ShowSettingsDialogWindow(QString paramsStr) |
| 2896 | { |
| 2897 | HWND settingsWindow = FindWindowEx(NULL, NULL, NULL, L"BumpTop Settings"); |
| 2898 | if (settingsWindow) |
| 2899 | { |
| 2900 | // bring the existing settings window to the top if there is one |
| 2901 | BringWindowToTop(settingsWindow); |
| 2902 | } |
| 2903 | else |
| 2904 | { |
| 2905 | // launch the new settings window |
| 2906 | QDir settingsPath = winOS->GetExecutableDirectory(); |
| 2907 | QFileInfo settingsApp = make_file(settingsPath, "BumpTop Settings.exe"); |
| 2908 | |
| 2909 | LOG("Key_ShowSettingsDialog::settingsPath"); |
| 2910 | LOG(native(settingsPath)); |
| 2911 | LOG("Key_ShowSettingsDialog::settingsApp"); |
| 2912 | LOG(native(settingsApp)); |
| 2913 | |
| 2914 | QString execDirStr = native(winOS->GetExecutableDirectory()); |
| 2915 | |
| 2916 | LOG("Key_ShowSettingsDialog::params"); |
| 2917 | LOG(paramsStr); |
| 2918 | |
| 2919 | QString settingsAppStr = native(settingsApp); |
| 2920 | printUnique("Key_ShowSettingsDialog", BtUtilStr->getString("LaunchSettings")); |
| 2921 | |
| 2922 | SHELLEXECUTEINFO sei = {0}; |
| 2923 | sei.cbSize = sizeof(SHELLEXECUTEINFO); |
| 2924 | sei.hwnd = winOS->GetWindowsHandle(); |
| 2925 | sei.lpVerb = NULL; // giving a null value for the verb forces it to use the default verb |
| 2926 | sei.lpFile = (LPCTSTR) settingsAppStr.utf16(); |
| 2927 | sei.lpDirectory = (LPCTSTR) execDirStr.utf16(); |
| 2928 | sei.lpParameters = (LPCTSTR)paramsStr.utf16(); |
| 2929 | sei.nShow = SW_SHOWNORMAL; |
| 2930 | ShellExecuteEx(&sei); |
| 2931 | |
| 2932 | statsManager->getStats().bt.settings.instantiations++; |
| 2933 | } |
| 2934 | } |
| 2935 | |
| 2936 | void Key_ToggleSharingMode() |
| 2937 | { |
no test coverage detected