Skip to content

Commit 9a1cf39

Browse files
authored
Merge pull request #1674 from wwivbbs/1673-make-list-plus-switchable
Make ListPlus switchable
2 parents 8bee8c7 + ced1760 commit 9a1cf39

5 files changed

Lines changed: 38 additions & 18 deletions

File tree

‎bbs/defaults.cpp‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ static void print_cur_stat() {
164164
(a()->user()->has_flag(User::fullScreenReader) ? "Full-Screen" : "Traditional"));
165165
}
166166
bout.print("|#1I|#9) Internet Address : |#2{}\r\n", inet_addr);
167-
bout.pl("|#1K|#9) Configure Menus");
167+
bout.print("|#1K|#9) Configure Menus ");
168+
if (okansi()) {
169+
bout.print("|#1L|#9) ListPlus Enabled : |#2{}", YesNoString(a()->user()->data.lp_options & cfl_enable));
170+
}
171+
bout.nl();
172+
168173
if (num_instances() > 1) {
169174
bout.print("|#1M|#9) Allow user msgs : |#2{:<16} |#1N|#9) Configure QWK", YesNoString(!a()->user()->ignore_msgs()));
170175
}
@@ -737,7 +742,7 @@ void defaults(bool& need_menu_reload) {
737742
bout.outstr("|#9Defaults: ");
738743
std::string allowable = "Q?1234567BCDIKMNTUW";
739744
if (okansi()) {
740-
allowable.append("89AS");
745+
allowable.append("89ALS");
741746
if (a()->fullscreen_read_prompt()) {
742747
allowable.push_back('G');
743748
}
@@ -803,6 +808,9 @@ void defaults(bool& need_menu_reload) {
803808
wwiv::bbs::menus::ConfigUserMenuSet("");
804809
need_menu_reload = true;
805810
break;
811+
case 'L':
812+
a()->user()->data.lp_options ^= cfl_enable;
813+
break;
806814
case 'M':
807815
a()->user()->toggle_flag(User::noMsgs);
808816
break;

‎bbs/listplus.cpp‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,8 @@ static void update_user_config_screen(uploadsrec* u, int which) {
932932
bout.clreol();
933933
bout.nl();
934934
bout.clreol();
935+
bout.nl();
936+
bout.clreol();
935937
bout.goxy(1, 21);
936938

937939
search_record sr{};
@@ -1019,12 +1021,7 @@ void config_file_list() {
10191021
which = 10;
10201022
break;
10211023
}
1022-
1023-
if (a()->user()->data.lp_options & bit) {
1024-
a()->user()->data.lp_options &= ~bit;
1025-
} else {
1026-
a()->user()->data.lp_options |= bit;
1027-
}
1024+
a()->user()->data.lp_options ^= bit;
10281025
break;
10291026

10301027
case '!':

‎bbs/xfer.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void listfiles() {
300300
return;
301301
}
302302

303-
if (okansi()) {
303+
if (okansi() && a()->user()->data.lp_options & cfl_enable ) {
304304
listfiles_plus(LP_LIST_DIR);
305305
return;
306306
}
@@ -345,7 +345,7 @@ void nscandir(uint16_t nDirNum, bool& need_title, bool *abort) {
345345
a()->set_current_user_dir_num(nDirNum);
346346
dliscan();
347347
if (this_date >= a()->sess().nscandate()) {
348-
if (okansi()) {
348+
if (okansi() && a()->user()->data.lp_options & cfl_enable) {
349349
*abort = listfiles_plus(LP_NSCAN_DIR) ? 1 : 0;
350350
a()->set_current_user_dir_num(old_cur_dir);
351351
return;
@@ -391,7 +391,7 @@ void nscanall() {
391391
tmp_disable_conf(true);
392392
}
393393
}
394-
if (okansi()) {
394+
if (okansi() && a()->user()->data.lp_options & cfl_enable) {
395395
const auto save_dir = a()->current_user_dir_num();
396396
listfiles_plus(LP_NSCAN_NSCAN);
397397
if (scan_all_confs) {
@@ -436,7 +436,7 @@ void searchall() {
436436
bout.pl("|#6No directories available.");
437437
return;
438438
}
439-
if (okansi()) {
439+
if (okansi() && a()->user()->data.lp_options & cfl_enable ) {
440440
listfiles_plus(LP_SEARCH_ALL);
441441
return;
442442
}

‎bbs/xferovl.cpp‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,20 @@ void xfer_defaults() {
734734
do {
735735
bout.cls();
736736
bout.outstr("|#7[|#21|#7]|#1 Set New-Scan Directories.\r\n");
737-
bout.outstr("|#7[|#22|#7]|#1 Set Default Protocol.\r\n");
738-
bout.print("|#7[|#23|#7]|#1 New-Scan Transfer after Message Base ({}).\r\n",
737+
bout.print("|#7[|#22|#7]|#1 Set Default Protocol: |#7(|#2{}|#7).\r\n",prot_name(a()->user()->default_protocol()));
738+
bout.print("|#7[|#23|#7]|#1 New-Scan Transfer after Message Base: |#7(|#2{}|#7)\r\n",
739739
YesNoString(a()->user()->newscan_files()));
740-
bout.print("|#7[|#24|#7]|#1 Number of lines of extended description to print [{} line(s)].\r\n",
740+
bout.print("|#7[|#24|#7]|#1 Number of lines of extended description to print: #|7[|#2{} line(s)|#7]|#1.\r\n",
741741
a()->user()->GetNumExtended());
742-
const std::string onek_options = "Q12345";
742+
if (okansi()) {
743+
bout.print("|#7[|#2L|#7]|#1 ListPlus Enabled: |#7(|#2{}|#7)\r\n", YesNoString(a()->user()->data.lp_options & cfl_enable));
744+
}
745+
std::string onek_options = "Q12345L";
746+
if (a()->user()->data.lp_options & cfl_enable) {
747+
bout.print("|#7[|#2K|#7]|#1 Configure ListPlus\r\n");
748+
onek_options.append("K");
749+
}
750+
743751
bout.outstr("|#7[|#2Q|#7]|#1 Quit.\r\n\n");
744752
bout.outstr("|#5Which? ");
745753
char ch = onek(onek_options);
@@ -775,13 +783,19 @@ void xfer_defaults() {
775783
}
776784
}
777785
break;
786+
case 'L':
787+
a()->user()->data.lp_options ^= cfl_enable;
788+
break;
789+
case 'K':
790+
config_file_list();
791+
break;
778792
}
779793
}
780794
while (!done && !a()->sess().hangup());
781795
}
782796

783797
void finddescription() {
784-
if (okansi()) {
798+
if (okansi() && a()->user()->data.lp_options & cfl_enable ) {
785799
listfiles_plus(LP_SEARCH_ALL);
786800
return;
787801
}

‎sdk/user.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static constexpr uint32_t unused_cfl_times_a_day_dloaded = 0x00000100;
4747
static constexpr uint32_t unused_cfl_days_between_dloads = 0x00000200;
4848
static constexpr uint32_t cfl_description = 0x00000400;
4949
static constexpr uint32_t cfl_header = 0x80000000;
50+
static constexpr uint32_t cfl_enable = 0x10000000;
5051

5152
namespace wwiv::sdk {
5253
struct validation_config_t;
@@ -1076,4 +1077,4 @@ int years_old(const User* u, core::Clock& clock);
10761077

10771078
} // namespace wwiv::sdk
10781079

1079-
#endif
1080+
#endif

0 commit comments

Comments
 (0)