diff --git a/src/main.c b/src/main.c index c73acdb..ed218d9 100644 --- a/src/main.c +++ b/src/main.c @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) { vaultSelected = bypassVaultSelection; goto note_selection; } - vaultSelected = ncursesSelect(vaultsArray, "vault", vaultsCount, extraOptions, " ", "Or select an option below", "", shouldDebug); + vaultSelected = ncursesSelect(vaultsArray, "Select vault to open (Use arrows or WASD, Enter to select):", vaultsCount, extraOptions, " ", "Or select an option below", "", shouldDebug); // now that we won't use vaultsArray in this iteration of the loop, we should free it and all its elements. (As this is memory in the heap and not the stack and thus is our responsability to manage) for (int i = 0; i < vaultsCount; i++) { @@ -264,7 +264,7 @@ note_selection: goto note_creation; } } - noteSelected = ncursesSelect(filesArray, "note or journal", filesCount, extraNotesOptions, " ", "Or select an option below", "", shouldDebug); + noteSelected = ncursesSelect(filesArray, "Select note or journal to open (Use arrows or WASD, Enter to select):", filesCount, extraNotesOptions, " ", "Or select an option below", "", shouldDebug); // now that we won't use filesArray in this iteration of the loop, we should free it and all its elements. (As this is memory in the heap and not the stack and thus is our responsability to manage) for (int i = 0; i < filesCount; i++) { if (noteSelected != filesArray[i]) { // we must prevent noteSelected to be freed. It will cause a lot of problems @@ -306,7 +306,7 @@ note_creation: shouldChangeVault = 1; } else if (strcmp(noteSelected, "Delete vault") == 0) { const char *yesNo[] = {"No, go back to note selection.", "Yes."}; - char *answer = ncursesSelect((char **)yesNo, "Are you sure you want to delete the entire vault? This can not be undone.", 1, 1, " ", "", "", shouldDebug); // (TODO LATER) This is ugly with Select Are you sure[...] + char *answer = ncursesSelect((char **)yesNo, "Are you sure you want to delete the entire vault? This can not be undone (Use arrows or WASD, Enter to select):", 1, 1, " ", "", "", shouldDebug); // (TODO LATER) This is ugly with Select Are you sure[...] debug("You answered: %s for deleting the vault %s", answer, vaultSelected); if (strcmp(answer, "Yes.") == 0) { // delete the vault after confirmation by the user diff --git a/src/notes.c b/src/notes.c index 388b179..b007cb3 100644 --- a/src/notes.c +++ b/src/notes.c @@ -185,7 +185,7 @@ char *updateJournal(char *path, char *journal, char *timeFormat, int shouldDebug // free's some used memory closedir(dividedJournalDirectory); // we must now select to create new entry or to enter in old one - char *selectedOption = ncursesSelect(entryArray, "Create new entry or acces old entry:", 1, entryCount -1, " ", " ", "", shouldDebug); // the "Create new entry for the journal %s" will be the only options. All other will be extraOptions. This is made so that "Create [...] %s" will always be on top + char *selectedOption = ncursesSelect(entryArray, "Create new entry or acces old entry (Use arrows or WASD, Enter to select):", 1, entryCount -1, " ", " ", "", shouldDebug); // the "Create new entry for the journal %s" will be the only options. All other will be extraOptions. This is made so that "Create [...] %s" will always be on top debug("Selected option from journal entry selection: %s", selectedOption); if (strcmp(selectedOption, createEntryMessage) == 0) { // create new entry char temp[PATH_MAX]; diff --git a/src/ui.c b/src/ui.c index ef3575b..470b87a 100644 --- a/src/ui.c +++ b/src/ui.c @@ -103,7 +103,7 @@ char* ncursesSelect(char **options, char *optionsText, size_t optionsNumber, siz while (1) { clear(); attron(COLOR_PAIR(1)); - mvprintw(0,0, "Select %s (Use arrows or WASD, Enter to select):", optionsText); + mvprintw(0,0, "%s", optionsText); int offset = 1; if (strcmp(bottomText, "") != 0) { mvprintw(offset, 1, "%s", bottomText);