MCPcopy Create free account
hub / github.com/bumptop/BumpTop / onCommand

Method onCommand

trunk/win/Source/BT_CrashDialog.cpp:59–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool CrashDialog::onCommand(HWND hwnd, WPARAM wParam, LPARAM lParam )
60{
61 // Process Buttons
62 switch (LOWORD(wParam))
63 {
64 // update the type
65 case IDNO:
66 winOS->ExitBumpTop();
67 break;
68 case IDOK:
69 break;
70 case IDC_RESET_BUMPTOP_SETTINGS:
71 _resetBumpTopSettings = (BST_CHECKED == SendMessage(GetDlgItem(hwnd, IDC_RESET_BUMPTOP_SETTINGS), BM_GETCHECK, 0, 0));
72 return false;
73 case IDC_SEND_FEEDBACK:
74 _sendFeedback = (BST_CHECKED == SendMessage(GetDlgItem(hwnd, IDC_SEND_FEEDBACK), BM_GETCHECK, 0, 0));
75 return false;
76 default:
77 return false;
78 }
79
80 QString dumpFileName;
81 QString errorMessage;
82
83 // Variables used to read input
84 uint maxChar = 65536;
85 TCHAR buf[65536];
86
87 // Specify dump file name
88 dumpFileName = native(QFileInfo(winOS->GetDataDirectory(), "Bump.dmp"));
89
90 // Get the email address
91 GetWindowText(GetDlgItem(hwnd, IDC_CRASHBOX_EMAIL), buf, maxChar);
92 QString email(QString::fromUtf16((const ushort *) buf));
93
94 // Get the comments
95 memset(buf, 0, maxChar);
96 GetWindowText(GetDlgItem(hwnd, IDC_CRASHBOX_DLG_EDIT), buf, maxChar);
97 QString enteredText(QString::fromUtf16((const ushort *) buf));
98
99 if (_sendFeedback && EmailCrashReport("feedback@bumptop.com", "Crash Report", enteredText, email, dumpFileName))
100 {
101 errorMessage = WinOSStr->getString("ErrorInfoSent");
102 dlgManager->clearState();
103 dlgManager->setPrompt(BtUtilStr->getString("FeedbackSent"));
104 dlgManager->promptDialog(DialogOK);
105 }
106 else
107 errorMessage = QString(WinOSStr->getString("ErrorConnectBumpHQ")).arg(dumpFileName);
108
109 if (_resetBumpTopSettings)
110 {
111 Key_ResetBumpTopSettings();
112 Key_DeleteSceneFiles();
113
114 // Rename default theme folder
115 QDir userDefaultThemePath = winOS->GetUserThemesDirectory(true);
116 QDir themesDir = winOS->GetUserApplicationDataPath() / "Themes";

Callers

nothing calls this directly

Calls 15

QFileInfoClass · 0.85
EmailCrashReportFunction · 0.85
Key_ResetBumpTopSettingsFunction · 0.85
Key_DeleteSceneFilesFunction · 0.85
ExitBumpTopMethod · 0.80
GetDataDirectoryMethod · 0.80
clearStateMethod · 0.80
setPromptMethod · 0.80
promptDialogMethod · 0.80
getDirectoryContentsMethod · 0.80

Tested by

no test coverage detected