Progress bar during updates

This commit is contained in:
Jaidyn Ann 2021-02-18 22:38:59 -06:00
parent a2374f8fa0
commit b8111b7a22
4 changed files with 11 additions and 11 deletions

View File

@ -64,5 +64,5 @@ point soon.
BORING INFO
--------------------------------------------------
Pogger is under the MIT license.
https://git.feneas.org/detruota/pogger
https://github.com/JadedCtrl/Pogger
jadedctrl@teknik.io

View File

@ -80,7 +80,7 @@ App::MessageReceived(BMessage* msg)
case kFeedsEdited:
case kProgress:
{
fMainWindow->MessageReceived(msg);
fMainWindow->PostMessage(msg);
break;
}
case kClearQueue:

View File

@ -60,8 +60,7 @@ MainWindow::MessageReceived(BMessage *msg)
if (msg->FindInt32("max", &max) == B_OK
&& msg->FindInt32("current", &current) == B_OK)
{
int32 prog = max - current;
printf("%i / %i\n", prog, max);
_UpdateProgress(max, current);
}
break;
}
@ -115,13 +114,14 @@ MainWindow::_InitInterface()
void
MainWindow::_UpdateProgress()
MainWindow::_UpdateProgress(int32 max, int32 current)
{
fStatusBar->SetTo(50.0);
// if (fInProgress == 0)
// printf("Done!\n");
// else
// printf("Current: %i\n", fInProgress);
int32 prog = max - current;
fStatusBar->SetMaxValue(max);
fStatusBar->SetTo(prog);
printf("%i / %i\n", prog, max);
}

View File

@ -22,7 +22,7 @@ public:
private:
void _InitInterface();
void _UpdateProgress();
void _UpdateProgress(int32 max, int32 current);
BGroupView* fBaseView;
BTabView* fTabView;