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 BORING INFO
-------------------------------------------------- --------------------------------------------------
Pogger is under the MIT license. Pogger is under the MIT license.
https://git.feneas.org/detruota/pogger https://github.com/JadedCtrl/Pogger
jadedctrl@teknik.io jadedctrl@teknik.io

View File

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

View File

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

View File

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