Skip to content

Commit 18cb138

Browse files
committed
Do not allow error reports on fatal error from dev/unoffiical builds
1 parent 95975e2 commit 18cb138

File tree

3 files changed

+41
-28
lines changed

3 files changed

+41
-28
lines changed

qrenderdoc/Code/CaptureContext.cpp

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -158,43 +158,47 @@ CaptureContext::CaptureContext(PersistantConfig &cfg) : m_Config(cfg)
158158

159159
bool add_report = false;
160160

161-
if(CrashDialog::HasCaptureReady(m_Config))
161+
if(m_MainWindow->ErrorReportsAllowed())
162162
{
163-
text += tr(
164-
"If you think this may be a RenderDoc bug please click the button below to report it, "
165-
"but note that this will require you to upload the capture for reproduction as "
166-
"otherwise it is impossible to tell what the problem may be.");
167-
168-
add_report = true;
169-
}
170-
else if(CrashDialog::CaptureTooLarge(m_Config))
171-
{
172-
text = tr("<html>%1<br><br>"
173-
"Your capture is too lage to upload as a crash report so this can't be "
174-
"automatically reported. "
175-
"Please email me at <a "
176-
"href=\"mailto:[email protected]?subject=RenderDoc%20Unrecoverable%20error\">"
177-
"[email protected]</a> with information and I can help investigate.</html>")
178-
.arg(text);
179-
}
180-
else
181-
{
182-
text += tr("The capture must be saved locally if you want to report this as a bug. ");
183-
184-
if(Replay().CurrentRemote().IsConnected())
163+
if(CrashDialog::HasCaptureReady(m_Config))
185164
{
186165
text +=
187-
tr("Before closing the capture you can save it to disk and manually report a bug. "
188-
"Please include the capture, or else it will be impossible to tell what the "
189-
"problem may be.");
166+
tr("If you think this may be a RenderDoc bug please click the button below to report "
167+
"it, "
168+
"but note that this will require you to upload the capture for reproduction as "
169+
"otherwise it is impossible to tell what the problem may be.");
170+
171+
add_report = true;
172+
}
173+
else if(CrashDialog::CaptureTooLarge(m_Config))
174+
{
175+
text = tr("<html>%1<br><br>"
176+
"Your capture is too lage to upload as a crash report so this can't be "
177+
"automatically reported. "
178+
"Please email me at <a "
179+
"href=\"mailto:[email protected]?subject=RenderDoc%20Unrecoverable%20error\">"
180+
"[email protected]</a> with information and I can help investigate.</html>")
181+
.arg(text);
190182
}
191183
else
192184
{
193-
text += tr("You will need to reconnect to the remote server to save the capture.");
185+
text += tr("The capture must be saved locally if you want to report this as a bug. ");
186+
187+
if(Replay().CurrentRemote().IsConnected())
188+
{
189+
text +=
190+
tr("Before closing the capture you can save it to disk and manually report a bug. "
191+
"Please include the capture, or else it will be impossible to tell what the "
192+
"problem may be.");
193+
}
194+
else
195+
{
196+
text += tr("You will need to reconnect to the remote server to save the capture.");
197+
}
194198
}
195199
}
196200

197-
QMessageBox mb(QMessageBox::Critical, title, text, QMessageBox::Ok, m_MainWindow);
201+
QMessageBox mb(QMessageBox::Critical, title, text.trimmed(), QMessageBox::Ok, m_MainWindow);
198202
mb.setDefaultButton(QMessageBox::NoButton);
199203
QPushButton *report = NULL;
200204
if(add_report)

qrenderdoc/Windows/MainWindow.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,11 @@ void MainWindow::LoadInitialLayout()
16811681
}
16821682
}
16831683

1684+
bool MainWindow::ErrorReportsAllowed()
1685+
{
1686+
return ui->action_Send_Error_Report->isEnabled();
1687+
}
1688+
16841689
void MainWindow::RemoveRecentCapture(const QString &filename)
16851690
{
16861691
RemoveRecentFile(m_Ctx.Config().RecentCaptureFiles, filename);
@@ -2848,6 +2853,9 @@ void MainWindow::on_action_Send_Error_Report_triggered()
28482853

28492854
void MainWindow::sendErrorReport(bool forceCaptureInclusion)
28502855
{
2856+
if(!ErrorReportsAllowed())
2857+
return;
2858+
28512859
rdcstr report;
28522860
RENDERDOC_CreateBugReport(RENDERDOC_GetLogFile(), "", report);
28532861

qrenderdoc/Windows/MainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class MainWindow : public QMainWindow, public IMainWindow, public ICaptureViewer
9696

9797
void LoadInitialLayout();
9898

99+
bool ErrorReportsAllowed();
99100
void sendErrorReport(bool forceCaptureInclusion);
100101

101102
void setProgress(float val);

0 commit comments

Comments
 (0)