From 03b7f39017351b0c3e5aa2cf37a7013184de2e4c Mon Sep 17 00:00:00 2001 From: Emir SARI Date: Thu, 14 Mar 2024 20:38:25 +0300 Subject: [PATCH] Remove Preview, Beta, and Demo modes - Also try to fix the build error --- Makefile | 2 +- locales/en.catkeys | 4 ++-- src/App.cpp | 33 --------------------------------- src/BuildOptions.h | 4 +--- src/CheckView.cpp | 26 ++------------------------ src/LanguageRoster.h | 1 + src/Layout.h | 2 +- src/MainWindow.cpp | 34 ++++------------------------------ src/ReconcileWindow.cpp | 1 - src/ReportWindow.cpp | 1 - src/ScheduleListWindow.cpp | 1 - src/SplitView.cpp | 1 - 12 files changed, 12 insertions(+), 98 deletions(-) diff --git a/Makefile b/Makefile index 4e41fe9..3642ff8 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ RSRCS = \ # - if your library does not follow the standard library naming scheme, # you need to specify the path to the library and it's name. # (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a") -LIBS = be tracker localestub sqlite3 columnlistview $(STDCPPLIBS) +LIBS = be tracker localestub translation sqlite3 columnlistview $(STDCPPLIBS) # Specify additional paths to directories following the standard libXXX.so # or libXXX.a naming scheme. You can specify full paths or paths relative diff --git a/locales/en.catkeys b/locales/en.catkeys index 05a1190..a6f7ced 100644 --- a/locales/en.catkeys +++ b/locales/en.catkeys @@ -1,4 +1,4 @@ -1 English application/x-vnd.wgp-CapitalBe 1061653508 +1 English application/x-vnd.wgp-CapitalBe 548178424 Year ReportWindow Year Edit transaction TransactionEditWindow Edit transaction None ReportWindow None @@ -7,10 +7,10 @@ Transfer from %%PAYEE%% MainWindow Transfer from %%PAYEE%% Reports ReportWindow Reports Monthly ScheduleAddWindow Monthly Annually BudgetWindow Annually +Report a bug… MainWindow Report a bug… OK PrefWindow OK Changes will take effect on restart MainWindow Changes will take effect on restart CapitalBe didn't understand the date you entered. DateBox CapitalBe didn't understand the date you entered. -CapitalBe Preview Edition MainWindow CapitalBe Preview Edition To account TransferWindow To account Category CheckView Category Reports… MainWindow Reports… diff --git a/src/App.cpp b/src/App.cpp index 7668326..9f4d790 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -19,25 +19,6 @@ bool gRestartApp = false; App::App(void) : BApplication("application/x-vnd.wgp-CapitalBe") { -#ifdef BETA_MODE - - // To create the UNIX number, run the Terminal command - // date --date="25 Dec 2006" +%s - // and change the date accordingly - if (GetCurrentDate() > 1167022800) { - ShowAlert( - "This beta version has expired.", - "This is only a test version of CapitalBe and is intended to work only " - "for a short period of time to allow the community to help find bugs and " - "make CapitalBe the best financial manager possible.\n\nYou can download " - "a new copy of CapitalBe from http://www.capitalbe.com/" - ); - be_app->PostMessage(B_QUIT_REQUESTED); - return; - } - -#endif - // Load preferences and then initialize the translation system LoadPreferences(PREFERENCES_PATH "/CapitalBeSettings"); @@ -50,20 +31,6 @@ App::App(void) : BApplication("application/x-vnd.wgp-CapitalBe") { MainWindow *win = new MainWindow(winframe); win->Show(); - -#ifdef PREVIEW_MODE - - ShowAlert( - "Welcome to CapitalBe's Technology Preview!", - "Welcome and thank you for trying CapitalBe, what will be the foremost " - "personal finance manager for BeOS, Zeta, and Haiku.\n\n" - "This preview version may contain bugs and is not feature complete, but " - "will give you an idea of what the full version will be like when released.\n\n" - "Please feel free to experiment and send any feedback to capitalbe@earthlink.net", - B_IDEA_ALERT - ); - -#endif } App::~App(void) { diff --git a/src/BuildOptions.h b/src/BuildOptions.h index 8edfc2e..16c47ba 100644 --- a/src/BuildOptions.h +++ b/src/BuildOptions.h @@ -3,13 +3,11 @@ #include -// Uncomment DEMO_MODE to turn this into the demo package version -enum { NORMAL_MODE = 0, PREVIEW_MODE, BETA_MODE }; #define BUILD_MODE NORMAL_MODE - // Uncomment ENTER_NAVIGATION to enable using the Enter key to navigate fields. // It copies Quicken, but it is also not consistent in its behavior, which is NOT good // #define ENTER_NAVIGATION + #endif diff --git a/src/CheckView.cpp b/src/CheckView.cpp index 2b4864f..5bdf8a5 100644 --- a/src/CheckView.cpp +++ b/src/CheckView.cpp @@ -6,7 +6,6 @@ #include #include "Account.h" -#include "BuildOptions.h" #include "CategoryBox.h" #include "CheckNumBox.h" #include "CheckView.h" @@ -15,7 +14,6 @@ #include "Database.h" #include "DateBox.h" #include "LanguageRoster.h" -#include "Layout.h" #include "MainWindow.h" #include "MsgDefs.h" #include "NavTextBox.h" @@ -31,8 +29,6 @@ #define B_TRANSLATION_CONTEXT "CheckView" -Language *gCurrentLanguage = NULL; - enum { M_ENTER_TRANSACTION = 'entr' }; CheckView::CheckView(const char *name, int32 flags) : BView(name, flags | B_FRAME_EVENTS) { @@ -59,7 +55,8 @@ CheckView::CheckView(const char *name, int32 flags) : BView(name, flags | B_FRAM prefsLock.Lock(); BString rechelp = gAppPath; prefsLock.Unlock(); - rechelp << "helpfiles/" << gCurrentLanguage->Name() << "/Main Window Help"; + BString currentLanguage = gCurrentLanguage->Name(); + rechelp << "helpfiles/" << currentLanguage << "/Main Window Help"; fHelpButton = new HelpButton("rechelp", rechelp.String()); fEnter = new BButton("enterbutton", B_TRANSLATE("Enter"), new BMessage(M_ENTER_TRANSACTION)); @@ -155,25 +152,6 @@ CheckView::MessageReceived(BMessage *msg) { // from the Memo field. The CheckView instance should do whatever is // needed to post the transaction into the register -#ifdef DEMO_MODE - Account *demoacc = gDatabase.CurrentAccount(); - if (demoacc && demoacc->CountTransactions() >= 25) { - ShowAlert( - B_TRANSLATE("Demo mode limit"), - B_TRANSLATE( - "The Demo Mode limit has been reached on this account.", - "You can manually enter up to 25 transactions per " - "account. We hope that you like CapitalBe and will " - "purchase the full version. Have a nice day!" - ), - B_IDEA_ALERT - ); - MakeEmpty(); - break; - } - -#endif - if (!fDate->Validate() || !fType->Validate() || !fPayee->Validate() || !fAmount->Validate() || !fCategory->Validate()) break; diff --git a/src/LanguageRoster.h b/src/LanguageRoster.h index d0aeeba..4739b93 100644 --- a/src/LanguageRoster.h +++ b/src/LanguageRoster.h @@ -25,6 +25,7 @@ class LanguageRoster { Language *fDefaultLanguage; }; +extern Language *gCurrentLanguage; extern LanguageRoster *language_roster; #endif diff --git a/src/Layout.h b/src/Layout.h index 648eb1a..c02550c 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -1,9 +1,9 @@ #ifndef LAYOUT_H #define LAYOUT_H + extern int32 gTextViewHeight; extern int32 gStringViewHeight; -#define TRANSLATE(x) gCurrentLanguage->Translate(x).String() #endif diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 0810629..ceca8ca 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -14,7 +14,6 @@ #include "AccountSettingsWindow.h" #include "BudgetWindow.h" -#include "BuildOptions.h" #include "CBLocale.h" #include "CategoryWindow.h" #include "DAlert.h" @@ -45,19 +44,14 @@ // Internal definition of the Haiku services daemon #define B_SERVICES_DAEMON_RESTART 'SDRS' -Language *gCurrentLanguage = NULL; int32 gTextViewHeight = 20; int32 gStringViewHeight = 20; +Language *gCurrentLanguage = NULL; + MainWindow::MainWindow(BRect frame) : BWindow(frame, "", B_DOCUMENT_WINDOW, 0) { BString temp; - // Main window title changes in demo mode - if (BUILD_MODE == PREVIEW_MODE) - SetTitle(B_TRANSLATE("CapitalBe Preview Edition")); - else if (BUILD_MODE == BETA_MODE) - SetTitle("CapitalBe: Beta"); - else SetTitle(B_TRANSLATE_SYSTEM_NAME("CapitalBe")); // These chunks of code will save a lot of headache later on -- @@ -104,17 +98,10 @@ MainWindow::MainWindow(BRect frame) : BWindow(frame, "", B_DOCUMENT_WINDOW, 0) { r.bottom = 20; BMenuBar *bar = new BMenuBar("keybar"); -#ifdef BETA_MODE temp = B_TRANSLATE("Report a bug…"); bar->AddItem(new BMenuItem(temp.String(), new BMessage(M_REPORT_BUG))); -#endif BMenu *menu = new BMenu(B_TRANSLATE("Program")); -#ifdef DEMO_MODE - menu->AddItem(new BMenuItem(B_TRANSLATE("Buy CapitalBe"), new BMessage(M_PURCHASE_FULL_VERSION)) - ); - menu->AddSeparatorItem(); -#endif temp = B_TRANSLATE("Settings…"); menu->AddItem(new BMenuItem(temp.String(), new BMessage(M_SHOW_OPTIONS_WINDOW), ',')); @@ -321,24 +308,11 @@ MainWindow::MessageReceived(BMessage *msg) { break; } case M_REPORT_BUG: { - BString cmdstring("/boot/beos/apps/BeMail mailto:support@capitalbe.com &"); - system(cmdstring.String()); + char *argv[2] = {(char*)"https://github.com/HaikuArchives/CapitalBe", NULL}; + be_roster->Launch("text/html", 1, argv); break; } case M_SHOW_NEW_ACCOUNT: { -#ifdef PREVIEW_MODE - if (gDatabase.CountAccounts() >= 5) { - ShowAlert( - B_TRANSLATE("Preview mode limit"), - B_TRANSLATE("You can have up to 5 accounts in CapitalBe's demo version. " - "We hope that you like CapitalBe and will " - "purchase the full version. Have a nice day!"), - B_IDEA_ALERT - ); - break; - } -#endif - AccountSettingsWindow *newaccwin = new AccountSettingsWindow(NULL); BRect r(Frame()); newaccwin->MoveTo( diff --git a/src/ReconcileWindow.cpp b/src/ReconcileWindow.cpp index 5963630..ced9361 100644 --- a/src/ReconcileWindow.cpp +++ b/src/ReconcileWindow.cpp @@ -21,7 +21,6 @@ #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "ReconcileWindow" -Language *gCurrentLanguage = NULL; enum { M_TOGGLE_DEPOSIT = 'tgdp', diff --git a/src/ReportWindow.cpp b/src/ReportWindow.cpp index 82539f9..a5106d9 100644 --- a/src/ReportWindow.cpp +++ b/src/ReportWindow.cpp @@ -24,7 +24,6 @@ #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "ReportWindow" -Language *gCurrentLanguage = NULL; int compare_stringitem(const void *item1, const void *item2); diff --git a/src/ScheduleListWindow.cpp b/src/ScheduleListWindow.cpp index 5a0e04a..9a0485a 100644 --- a/src/ScheduleListWindow.cpp +++ b/src/ScheduleListWindow.cpp @@ -30,7 +30,6 @@ #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "ScheduleListWindow" -Language *gCurrentLanguage = NULL; enum { M_REMOVE_ITEM = 'rmit' }; diff --git a/src/SplitView.cpp b/src/SplitView.cpp index 9e16f66..e621704 100644 --- a/src/SplitView.cpp +++ b/src/SplitView.cpp @@ -31,7 +31,6 @@ #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "SplitView" -Language *gCurrentLanguage = NULL; SplitView::SplitView(const char *name, const TransactionData &trans, const int32 &flags) : BView(name, flags | B_FRAME_EVENTS),