Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Remove option to send email with bug report.
Update catkeys.
Co-authored-by: humdinger <[email protected]>
  • Loading branch information
dospuntos committed Apr 23, 2024
1 parent a53d6cc commit 95f19f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
7 changes: 3 additions & 4 deletions locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 English application/x-vnd.wgp-CapitalBe 329903186
1 English application/x-vnd.wgp-CapitalBe 566598982
Year ReportWindow Year
Edit transaction TransactionEditWindow Edit transaction
None ReportWindow None
Expand Down Expand Up @@ -87,6 +87,7 @@ Could not import the data in the file %%FILENAME%%. MainWindow Could not import
Quit Locale Quit
Once deleted, you will not be able to get back any data on this account. MainWindow Once deleted, you will not be able to get back any data on this account.
Total deposits: %s ReconcileWindow Total deposits: %s
Save bugreport Locale Save bugreport
Amount CheckView Amount
Indefinitely ScheduleAddWindow Indefinitely
Cancel MainWindow Cancel
Expand Down Expand Up @@ -158,7 +159,6 @@ Account settings AccountSettingsWindow Account settings
Account name: AccountSettingsWindow Account name:
Set all to zero BudgetWindow Set all to zero
When the split items are added together, they need to add up to %%ENTERED_AMOUNT%%. Currently, they add up to %%TOTAL_AMOUNT%% SplitView When the split items are added together, they need to add up to %%ENTERED_AMOUNT%%. Currently, they add up to %%TOTAL_AMOUNT%%
CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Have CapitalBe make an e-mail to send to Support\n2) Save the bug to a text file for e-mailing later\n3) Just quit and do nothing\n Locale CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Have CapitalBe make an e-mail to send to Support\n2) Save the bug to a text file for e-mailing later\n3) Just quit and do nothing\n
Date is missing. ReconcileWindow Date is missing.
Date: ReconcileWindow Date:
Numbered transactions cannot be scheduled. MainWindow Numbered transactions cannot be scheduled.
Expand All @@ -170,9 +170,7 @@ Transfer BudgetWindow Transfer
Starting date: ScheduleAddWindow Starting date:
Settings… MainWindow Settings…
Monthly Budget Monthly
Save to File Locale Save to File
Cancel PrefWindow Cancel
Make an E-mail Locale Make an E-mail
Unreconciled total ReconcileWindow Unreconciled total
Quarterly ScheduleListWindow Quarterly
12 month statistics BudgetWindow 12 month statistics
Expand Down Expand Up @@ -235,6 +233,7 @@ CapitalBe didn't understand the amount for Interest Earned. ReconcileWindow Cap
Split SplitView Split
The split total must match the amount box. SplitView The split total must match the amount box.
Delete… MainWindow Delete…
CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Save the bug to a text file for uploading to\nCapitalBe's issue tracker (https://github.com/HaikuArchives/CapitalBe/issues)\n\n2) Just quit and do nothing\n Locale CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Save the bug to a text file for uploading to\nCapitalBe's issue tracker (https://github.com/HaikuArchives/CapitalBe/issues)\n\n2) Just quit and do nothing\n
Amount BudgetWindow Amount
About CapitalBe… MainWindow About CapitalBe…
Cancel CategoryBox Cancel
Expand Down
23 changes: 10 additions & 13 deletions src/Locale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,16 +807,16 @@ ShowBug(const char* string)
{
BString message =
B_TRANSLATE("CapitalBe has run into a bug. This shouldn't happen, but it has.\n"
"Would you like to:\n\n1) Have CapitalBe make an e-mail to send to Support\n"
"2) Save the bug to a text file for e-mailing later\n"
"3) Just quit and do nothing\n");
"Would you like to:\n\n1) Save the bug to a text file for uploading to\n"
"CapitalBe's issue tracker (https://github.com/HaikuArchives/CapitalBe/issues)\n\n"
"2) Just quit and do nothing\n");

DAlert* alert =
new DAlert(B_TRANSLATE("Agh! Bug!"), message.String(), B_TRANSLATE("Make an E-mail"),
B_TRANSLATE("Save to File"), B_TRANSLATE("Quit"));
new DAlert(B_TRANSLATE("Agh! Bug!"), message.String(),
B_TRANSLATE("Save bugreport"), B_TRANSLATE("Quit"));
int32 value = alert->Go();

if (value == 0) {
if (value == 1) {
be_app->PostMessage(M_QUIT_NOW);
return;
}
Expand All @@ -830,19 +830,16 @@ ShowBug(const char* string)
message << "Error: " << string << "\n";

if (value == 0) {
// Make an e-mail to myself. :D

BString cmdstring("/boot/beos/apps/BeMail mailto:[email protected] ");
cmdstring << "-subject 'CapitalBe Bug Report' -body '" << message << "'";
cmdstring << " &";
system(cmdstring.String());
} else if (value == 1) {
// Generate a text file of the bug on the Desktop
BString filename("/boot/home/Desktop/CapitalBe Bug Report ");
filename << real_time_clock() << ".txt";
BFile file(filename.String(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
file.Write(message.String(), message.Length());
file.Unset();

// Open GitHub in browser
char* argv[2] = {(char*)"https://github.com/HaikuArchives/CapitalBe/issues/", NULL};
be_roster->Launch("text/html", 1, argv);
}

be_app->PostMessage(M_QUIT_NOW);
Expand Down

0 comments on commit 95f19f8

Please sign in to comment.