Skip to content
Snippets Groups Projects
Commit 16abca56 authored by Eric Oulashin's avatar Eric Oulashin
Browse files

DDMsgReader: Display loading dots when counting sub-boards during indexed mode newscan

parent 8e350123
Branches
Tags
1 merge request!485DDMsgReader: When doing an indexed newscan, display the progress percentage when counting sub-boards for indexed newscan. For issue #846
Pipeline #7430 passed
...@@ -16716,6 +16716,12 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi ...@@ -16716,6 +16716,12 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi
var scanScope = (isValidScanScopeVal(pScanScope) ? pScanScope : SCAN_SCOPE_ALL); var scanScope = (isValidScanScopeVal(pScanScope) ? pScanScope : SCAN_SCOPE_ALL);
var newScanOnly = (typeof(pNewscanOnly) === "boolean" ? pNewscanOnly : false); var newScanOnly = (typeof(pNewscanOnly) === "boolean" ? pNewscanOnly : false);
   
// Display an initial loading text, since the following may take some time
// for BBSes with many sub-boards
console.attributes = "N";
console.crlf();
console.print("Loading...");
// Note: DDlightbarMenu supports non-ANSI terminals with a more traditional UI // Note: DDlightbarMenu supports non-ANSI terminals with a more traditional UI
// of listing the items and letting the user choose one by typing its number. // of listing the items and letting the user choose one by typing its number.
// If we are to use the traditional interface, the menu will be in numbered mode, // If we are to use the traditional interface, the menu will be in numbered mode,
...@@ -16780,14 +16786,6 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi ...@@ -16780,14 +16786,6 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi
} }
else else
DigDistMsgReader_IndexedModeChooseSubBoard.selectedItemIdx = this.indexedModeMenu.selectedItemIdx; DigDistMsgReader_IndexedModeChooseSubBoard.selectedItemIdx = this.indexedModeMenu.selectedItemIdx;
// New
//console.print("\x01n\r\nScanning...\x01;"); // Temporary
// 1 2 3
// 123456789012345678901234567890
// Progress: 100%
//var numBlocks = console.screen_columns - 15;
//var numBlocksPerPercent = 100.0 / numBlocks;
// End New
// Ensure the menu is clear, and (re-)populate the menu with sub-board information w/ # of new messages in each, etc. // Ensure the menu is clear, and (re-)populate the menu with sub-board information w/ # of new messages in each, etc.
// Also, build an array of sub-board codes for each menu item. // Also, build an array of sub-board codes for each menu item.
// Also, display loading percentage while this is happening. // Also, display loading percentage while this is happening.
...@@ -16797,12 +16795,9 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi ...@@ -16797,12 +16795,9 @@ function DigDistMsgReader_IndexedModeChooseSubBoard(pClearScreen, pDrawMenu, pDi
DigDistMsgReader_IndexedModeChooseSubBoard.selectedItemIdx = 0; DigDistMsgReader_IndexedModeChooseSubBoard.selectedItemIdx = 0;
var numSubBoards = 0; var numSubBoards = 0;
var totalNewMsgs = 0; var totalNewMsgs = 0;
console.attributes = "N";
console.crlf();
printf("Loading: %0.2f% ", 0.0);
// The total number of sub-boards we'll scan - For displaying the progress percentage // The total number of sub-boards we'll scan - For displaying the progress percentage
if (typeof(DigDistMsgReader_IndexedModeChooseSubBoard.totalNumSubBoards) !== "number") if (typeof(DigDistMsgReader_IndexedModeChooseSubBoard.totalNumSubBoards) !== "number")
DigDistMsgReader_IndexedModeChooseSubBoard.totalNumSubBoards = countSubBoardsForScanning(scanScope, newScanOnly); DigDistMsgReader_IndexedModeChooseSubBoard.totalNumSubBoards = countSubBoardsForScanning(scanScope, newScanOnly, true);
// Load the menu // Load the menu
for (var grpIdx = 0; grpIdx < msg_area.grp_list.length; ++grpIdx) for (var grpIdx = 0; grpIdx < msg_area.grp_list.length; ++grpIdx)
{ {
...@@ -25747,8 +25742,9 @@ function countOccurrencesInStr(pStr, pSubstr) ...@@ -25747,8 +25742,9 @@ function countOccurrencesInStr(pStr, pSubstr)
   
// Counts the number of sub-boards that would be scanned for the user, // Counts the number of sub-boards that would be scanned for the user,
// considering their sub-board access, for a particular scan scope // considering their sub-board access, for a particular scan scope
function countSubBoardsForScanning(pScanScope, pNewScanOnly) function countSubBoardsForScanning(pScanScope, pNewScanOnly, pDisplayStatusDots)
{ {
var displayStatusDots = (typeof(pDisplayStatusDots) === "boolean" ? pDisplayStatusDots : false);
var numSubBoards = 0; var numSubBoards = 0;
for (var grpIdx = 0; grpIdx < msg_area.grp_list.length; ++grpIdx) for (var grpIdx = 0; grpIdx < msg_area.grp_list.length; ++grpIdx)
{ {
...@@ -25767,6 +25763,9 @@ function countSubBoardsForScanning(pScanScope, pNewScanOnly) ...@@ -25767,6 +25763,9 @@ function countSubBoardsForScanning(pScanScope, pNewScanOnly)
if (pScanScope == SCAN_SCOPE_SUB_BOARD && bbs.cursub != subIdx) if (pScanScope == SCAN_SCOPE_SUB_BOARD && bbs.cursub != subIdx)
continue; continue;
++numSubBoards; ++numSubBoards;
// If we are to display status dots, then display a dot for every 4 sub-boards
if (displayStatusDots && numSubBoards % 4 == 0)
console.print(".");
} }
} }
return numSubBoards; return numSubBoards;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment