Skip to content

Commit

Permalink
Merge branch 'feature-delete'
Browse files Browse the repository at this point in the history
  • Loading branch information
adiultra committed May 31, 2016
2 parents 7e78619 + d73c72f commit 30f7153
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Binary file modified data.tdx
Binary file not shown.
12 changes: 6 additions & 6 deletions fabric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void List::indexView() {
cout << endl << endl;

for (int i = 0; i < _listIndex; i++) {
cout << i << ". [" << list[i].status << "] ";
cout << " " << i << ". [" << list[i].status << "] ";
cout << list[i].content << endl;
}
}
Expand All @@ -172,9 +172,9 @@ void List::tagIndexView() {
cout << title << endl;
cout << "============" << endl;

cout << "Tags : ";
cout << "Tags :" << endl;
for (int i = 0; i < _tagIndex; i++) {
cout << i << ". " << tags[i] << endl;
cout << " " << i << ". " << tags[i] << endl;
}
}

Expand All @@ -198,10 +198,10 @@ void List::removeTodo(int index) {
}

void List::removeTag(int index) {
for (int i = index; i < _listIndex; i++) {
list[i] = list[i + 1];
for (int i = index; i < _tagIndex; i++) {
strcpy(tags[i], tags[i + 1]);
}
_listIndex--;
_tagIndex--;
}


Expand Down
14 changes: 7 additions & 7 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int parse(char command[80]){
// Delete Things

char choice[10];
cout << "What do you want to delete? (list/todo)" << endl << Bred << " ?> " << normal;
cout << "What do you want to delete? (list/todo/tag)" << endl << Bred << " ?> " << normal;
cin.getline(choice, sizeof(choice));

if (!(strcmp(choice, "list") * strcmp(choice, "List"))) {
Expand All @@ -196,7 +196,7 @@ int parse(char command[80]){
cout << Bblue << " #> " << normal;
cin >> index;
cin.ignore();
cout << "Are you sure, This cannot be undone, This will delete ->" << endl;
cout << "Are you sure, This cannot be undone, This will delete the List ->" << endl;
arrayL[index].view();

if ( confirm() ) {
Expand All @@ -218,7 +218,7 @@ int parse(char command[80]){
cout << Bblue << " #> " << normal;
cin >> index;
cin.ignore();
cout << "Are you sure, This cannot be undone, This will delete ->" << endl;
cout << "Are you sure, This cannot be undone, This will delete the ToDo ->" << endl;
currentL.todoView(index);

if ( confirm() ) {
Expand All @@ -239,16 +239,16 @@ int parse(char command[80]){
int index;

cout << "Enter the Index of Tag to Delete " << endl;
currentL.indexView();
currentL.tagIndexView();

cout << Bblue << " #> " << normal;
cin >> index;
cin.ignore();
cout << "Are you sure, This cannot be undone, This will delete ->" << endl;
currentL.todoView(index);
cout << "Are you sure, This cannot be undone, This will delete the Tag ->" << endl;
cout << currentL.tags[index] << endl;

if ( confirm() ) {
currentL.removeTodo(index);
currentL.removeTag(index);
}

arrayL[_currentLindex] = currentL; // To Help Improving Finalization
Expand Down

0 comments on commit 30f7153

Please sign in to comment.