Debian Codegraph @

Oodle/src/CStatusDisplay.cpp

raw
1 #include "CStatusDisplay.h"
2
3
4 CStatusDisplay::CStatusDisplay(bool bar, int max)
5 : prog(bar), current(0), max(max)
6 { }
7
8 void CStatusDisplay::hasProgress(bool bar)
9 {
10 prog = bar;
11 }
12
13 void CStatusDisplay::setProgressMax(int max)
14 {
15 CStatusDisplay::max = max;
16 }
17
18 void CStatusDisplay::setMinorStatus(const string &s)
19 {
20 minorStatus = s;
21 }
22
23 void CStatusDisplay::setMajorStatus(const string &s)
24 {
25 majorStatus = s;
26 }
27
28 void CStatusDisplay::addMax(int i)
29 {
30 max += i;
31 }
32
33 void CStatusDisplay::addProgress(int i)
34 {
35 if (current < max) current += i;
36 }
37
38 const string& CStatusDisplay::getMajorStatus()
39 {
40 return majorStatus;
41 }
42
43 const string& CStatusDisplay::getMinorStatus()
44 {
45 return minorStatus;
46 }
47
48 int CStatusDisplay::getProgressMax()
49 {
50 return max;
51 }
52
53 int CStatusDisplay::getProgressCurrent()
54 {
55 return current;
56 }
57
58 double CStatusDisplay::getProgessFrac()
59 {
60 return (double)current/max;
61 }