bug 421552 - allow users to send a crash report and quit firefox. patch by Mike Beltzner <beltzner@mozilla.com>, r=me, a=shaver

This commit is contained in:
ted.mielczarek@gmail.com 2008-03-07 14:17:17 -08:00
parent 9ffbbf504a
commit 2e6c0f89ae
7 changed files with 47 additions and 33 deletions

View File

@ -421,6 +421,10 @@ void RewriteStrings(StringTable& queryParameters)
product.c_str());
gStrings[ST_RESTART] = buf;
UI_SNPRINTF(buf, sizeof(buf),
gStrings[ST_QUIT].c_str(),
product.c_str());
gStrings[ST_QUIT] = buf;
UI_SNPRINTF(buf, sizeof(buf),
gStrings[ST_ERROR_ENDOFLIFE].c_str(),

View File

@ -50,11 +50,11 @@ typedef std::map<std::string, std::string> StringTable;
#define ST_CHECKURL "CheckIncludeURL"
#define ST_CHECKEMAIL "CheckSendEmail"
#define ST_EMAILGRAYTEXT "EmailGrayText"
#define ST_REPORTPRESUBMIT "ReportPreSubmit"
#define ST_REPORTDURINGSUBMIT "ReportDuringSubmit"
#define ST_REPORTPRESUBMIT "ReportPreSubmit2"
#define ST_REPORTDURINGSUBMIT "ReportDuringSubmit2"
#define ST_REPORTSUBMITSUCCESS "ReportSubmitSuccess"
#define ST_SUBMITFAILED "ReportSubmitFailed"
#define ST_QUIT "Quit"
#define ST_QUIT "Quit2"
#define ST_RESTART "Restart"
#define ST_OK "Ok"
#define ST_CLOSE "Close"

View File

@ -265,11 +265,21 @@ static gboolean WindowDeleted(GtkWidget* window,
return TRUE;
}
static void MaybeSubmitReport()
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))) {
gDidTrySend = true;
SendReport();
} else {
gtk_main_quit();
}
}
static void CloseClicked(GtkButton* button,
gpointer userData)
{
SaveSettings();
gtk_main_quit();
MaybeSubmitReport();
}
static void RestartClicked(GtkButton* button,
@ -277,13 +287,7 @@ static void RestartClicked(GtkButton* button,
{
SaveSettings();
RestartApplication();
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))) {
gDidTrySend = true;
SendReport();
} else {
gtk_main_quit();
}
MaybeSubmitReport();
}
static void UpdateSubmit()

View File

@ -85,6 +85,7 @@
sendURL:(const std::string&)sendURL;
- (void)showErrorUI:(const std::string&)dumpfile;
- (void)showReportInfo;
- (void)maybeSubmitReport;
- (IBAction)submitReportClicked:(id)sender;
- (IBAction)viewReportClicked:(id)sender;

View File

@ -217,6 +217,25 @@ static bool RestartApplication()
[extra release];
}
- (void)maybeSubmitReport
{
if ([mSubmitReportButton state] == NSOnState) {
[self setStringFitVertically:mProgressText
string:Str(ST_REPORTDURINGSUBMIT)
resizeWindow:YES];
// disable all the controls
[self enableControls:NO];
[mSubmitReportButton setEnabled:NO];
[mRestartButton setEnabled:NO];
[mCloseButton setEnabled:NO];
[mProgressIndicator startAnimation:self];
gDidTrySend = true;
[self sendReport];
} else {
[NSApp terminate:self];
}
}
-(IBAction)submitReportClicked:(id)sender
{
[self updateSubmit];
@ -237,28 +256,13 @@ static bool RestartApplication()
-(IBAction)closeClicked:(id)sender
{
[NSApp terminate: self];
[self maybeSubmitReport];
}
-(IBAction)restartClicked:(id)sender
{
RestartApplication();
if ([mSubmitReportButton state] == NSOnState) {
[self setStringFitVertically:mProgressText
string:Str(ST_REPORTDURINGSUBMIT)
resizeWindow:YES];
// disable all the controls
[self enableControls:NO];
[mSubmitReportButton setEnabled:NO];
[mRestartButton setEnabled:NO];
[mCloseButton setEnabled:NO];
[mProgressIndicator startAnimation:self];
gDidTrySend = true;
[self sendReport];
} else {
[NSApp terminate:self];
}
[self maybeSubmitReport];
}
- (IBAction)includeURLClicked:(id)sender

View File

@ -879,7 +879,7 @@ static BOOL CALLBACK CrashReporterDialogProc(HWND hwndDlg, UINT message,
UpdateEmail(hwndDlg);
break;
case IDC_CLOSEBUTTON:
EndCrashReporterDialog(hwndDlg, 0);
MaybeSendReport(hwndDlg);
break;
case IDC_RESTARTBUTTON:
RestartApplication();

View File

@ -13,19 +13,20 @@ CrashReporterDescriptionText2=%s had a problem and crashed.\n\nTo help us diagno
CrashReporterDefault=This application is run after a crash to report the problem to the application vendor. It should not be run directly.
Details=Details…
ViewReportTitle=Report Contents
CommentGrayText=Add a comment. Note: Comments are publicly visible
CommentGrayText=Add a comment (comments are publicly visible)
ExtraReportInfo=This report also contains technical information about the state of the application when it crashed.
# LOCALIZATION NOTE (CheckSendReport): The %s is replaced with the vendor name.
CheckSendReport=Tell %s about this crash so they can fix it
CheckIncludeURL=Include the address of the page I was on
CheckSendEmail=Email me when more information is available
EmailGrayText=Enter your email address here
ReportPreSubmit=Your crash report will be submitted when you restart.
ReportDuringSubmit=Submitting your report and restarting
ReportPreSubmit2=Your crash report will be submitted before you quit or restart.
ReportDuringSubmit2=Submitting your report
ReportSubmitSuccess=Report submitted successfully!
ReportSubmitFailed=There was a problem submitting your report.
ReportResubmit=Resending reports that previously failed to send…
Quit=Quit without sending
# LOCALIZATION NOTE (Quit2): The %s is replaced with the product name.
Quit2=Quit %s
# LOCALIZATION NOTE (Restart): The %s is replaced with the product name.
Restart=Restart %s
Ok=OK