Skip to content

Commit f27e19e

Browse files
committed
Added option to toggle multi-line notes
Cause well... its annoying to input " everytime we want to input quick notes
1 parent 1401f12 commit f27e19e

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

BluecoinsImportTool.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ENTRY entryTemplate;
99
int countEntry = 0,
1010
countDiscard = 0;
1111

12-
const int menusize = 10;
12+
const int menusize = 11;
1313

1414
// Main menu for program.
1515
int mainMenu() {
@@ -48,8 +48,17 @@ int mainMenu() {
4848
menu[7].count = 7;
4949
menu[7].content = "Toggle fixed entries status";
5050

51-
menu[9].count = 9;
52-
menu[9].content = "Exit";
51+
menu[8].count = 8;
52+
menu[8].content = "Toggle multi-line notes";
53+
if (multiLine) {
54+
menu[8].content += " [Enabled]";
55+
}
56+
else {
57+
menu[8].content += " [Disabled]";
58+
}
59+
60+
menu[10].count = 10;
61+
menu[10].content = "Exit";
5362

5463
// Output menu.
5564
menuHeading();
@@ -193,8 +202,11 @@ int main() {
193202
entryTemplate = fixedEntryMenu(properties, entryTemplate);
194203
break;
195204
}
196-
197-
case 9:
205+
case 8: {
206+
multiLine = !multiLine;
207+
break;
208+
}
209+
case 10:
198210
{
199211
heading("Exit");
200212
cout << "Thank you for using the bluecoins import tool. Throughout this session, you have: " << endl;
@@ -222,9 +234,9 @@ int main() {
222234
// system("pause");
223235
}
224236

225-
//outAllProperties();
237+
//outAllProperties();
226238

227-
return 0;
239+
return 0;
228240
}
229241

230242

BluecoinsImportTool.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ENTRY entry;
1010

1111
const string defaultJsonFileName = "D:\\WinLibrary\\Documents\\GIT-Code\\Bluecoins-ImportTool\\Tests\\ktn_new.json";
1212
bool splitTransac = false,
13-
usedSplit = false;
13+
usedSplit = false,
14+
multiLine = false;
1415

1516
// Global variables related with file output.
1617
ifstream fileCheck;
@@ -790,10 +791,20 @@ int entryInput(ENTRY entryTemplate) {
790791
heading("Transaction input");
791792
show_inputted(tempEntry);
792793
line(50, '-');
793-
cout << "Notes? (Multi-line available. Input \" to save and exit note-ing mode.)" << endl;
794-
line(50, '-');
795794

796-
getline(cin, userInput, '\"');
795+
if (multiLine) {
796+
cout << "Notes? (Multi-line mode on. Input \" then enter to save and exit note-ing mode.)" << endl;
797+
line(50, '-');
798+
799+
getline(cin, userInput, '\"');
800+
}
801+
else {
802+
cout << "Notes? (Multi-line mode off. Enter to save and exit note-ing mode.)" << endl;
803+
line(50, '-');
804+
805+
getline(cin, userInput);
806+
}
807+
797808
USER_INPUT_STRING_RETURN else if (userInput == "-1") { goto Amount_input; }
798809

799810
tempEntry.notes.set(userInput);

utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ inline void clearScreen() {
2323
inline void heading(std::string additional = "") {
2424
system("cls");
2525
cout << "############################################################" << endl;
26-
cout << "## Bluecoins Import Tool v2.1 by KwongTN ###" << endl;
26+
cout << "## Bluecoins Import Tool v2.2 by KwongTN ###" << endl;
2727
cout << "############################################################" << endl << endl;
2828

2929
if (additional != "") {

0 commit comments

Comments
 (0)