Skip to content

Commit

Permalink
Remove Preview, Beta, and Demo modes
Browse files Browse the repository at this point in the history
- Also try to fix the build error
  • Loading branch information
bitigchi committed Mar 14, 2024
1 parent b4cca95 commit 03b7f39
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 98 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 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 1061653508
1 English application/x-vnd.wgp-CapitalBe 548178424
Year ReportWindow Year
Edit transaction TransactionEditWindow Edit transaction
None ReportWindow None
Expand All @@ -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…
Expand Down
33 changes: 0 additions & 33 deletions src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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 [email protected]",
B_IDEA_ALERT
);

#endif
}

App::~App(void) {
Expand Down
4 changes: 1 addition & 3 deletions src/BuildOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

#include <BeBuild.h>

// 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
26 changes: 2 additions & 24 deletions src/CheckView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <Window.h>

#include "Account.h"
#include "BuildOptions.h"
#include "CategoryBox.h"
#include "CheckNumBox.h"
#include "CheckView.h"
Expand All @@ -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"
Expand All @@ -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) {
Expand All @@ -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));
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/LanguageRoster.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class LanguageRoster {
Language *fDefaultLanguage;
};

extern Language *gCurrentLanguage;
extern LanguageRoster *language_roster;

#endif
2 changes: 1 addition & 1 deletion src/Layout.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef LAYOUT_H
#define LAYOUT_H


extern int32 gTextViewHeight;
extern int32 gStringViewHeight;

#define TRANSLATE(x) gCurrentLanguage->Translate(x).String()

#endif
34 changes: 4 additions & 30 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "AccountSettingsWindow.h"
#include "BudgetWindow.h"
#include "BuildOptions.h"
#include "CBLocale.h"
#include "CategoryWindow.h"
#include "DAlert.h"
Expand Down Expand Up @@ -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 --
Expand Down Expand Up @@ -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), ','));
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion src/ReconcileWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "ReconcileWindow"

Language *gCurrentLanguage = NULL;

enum {
M_TOGGLE_DEPOSIT = 'tgdp',
Expand Down
1 change: 0 additions & 1 deletion src/ReportWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/ScheduleListWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "ScheduleListWindow"

Language *gCurrentLanguage = NULL;

enum { M_REMOVE_ITEM = 'rmit' };

Expand Down
1 change: 0 additions & 1 deletion src/SplitView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 03b7f39

Please sign in to comment.