Progress bar during updates
This commit is contained in:
parent
a2374f8fa0
commit
b8111b7a22
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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", ¤t) == B_OK)
|
&& msg->FindInt32("current", ¤t) == 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Ŝarĝante…
Reference in New Issue