Progress bar during updates
This commit is contained in:
parent
a2374f8fa0
commit
b8111b7a22
|
@ -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
|
||||
|
|
|
@ -80,7 +80,7 @@ App::MessageReceived(BMessage* msg)
|
|||
case kFeedsEdited:
|
||||
case kProgress:
|
||||
{
|
||||
fMainWindow->MessageReceived(msg);
|
||||
fMainWindow->PostMessage(msg);
|
||||
break;
|
||||
}
|
||||
case kClearQueue:
|
||||
|
|
|
@ -60,8 +60,7 @@ MainWindow::MessageReceived(BMessage *msg)
|
|||
if (msg->FindInt32("max", &max) == B_OK
|
||||
&& msg->FindInt32("current", ¤t) == 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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
private:
|
||||
void _InitInterface();
|
||||
|
||||
void _UpdateProgress();
|
||||
void _UpdateProgress(int32 max, int32 current);
|
||||
|
||||
BGroupView* fBaseView;
|
||||
BTabView* fTabView;
|
||||
|
|
Ŝarĝante…
Reference in New Issue