mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 14:07:13 -06:00
15.05
This commit is contained in:
committed by
Kornel Lesiński
parent
0713a3ab80
commit
54490d51d5
@@ -6,25 +6,78 @@
|
||||
#include "../../../Common/MyString.h"
|
||||
#include "../../../Common/MyTypes.h"
|
||||
|
||||
void ConvertUInt64ToStringAligned(UInt64 value, char *s, int alignSize);
|
||||
|
||||
class CMessageBox
|
||||
struct CPercentPrinterState
|
||||
{
|
||||
AString _title;
|
||||
int _width;
|
||||
public:
|
||||
void Init(const AString &title, int width);
|
||||
void ShowMessages(const char *strings[], int numStrings);
|
||||
UInt64 Completed;
|
||||
UInt64 Total;
|
||||
|
||||
UInt64 Files;
|
||||
UInt64 FilesTotal;
|
||||
|
||||
AString Command;
|
||||
UString FileName;
|
||||
|
||||
void ClearCurState();
|
||||
|
||||
bool IsEqualTo(const CPercentPrinterState &s) const
|
||||
{
|
||||
return
|
||||
Completed == s.Completed
|
||||
&& Total == s.Total
|
||||
&& Files == s.Files
|
||||
&& FilesTotal == s.FilesTotal
|
||||
&& Command == s.Command
|
||||
&& FileName == s.FileName;
|
||||
}
|
||||
|
||||
CPercentPrinterState():
|
||||
Completed(0),
|
||||
Total((UInt64)(Int64)-1),
|
||||
Files(0),
|
||||
FilesTotal(0)
|
||||
{}
|
||||
};
|
||||
|
||||
class CProgressBox: public CMessageBox
|
||||
class CProgressBox: public CPercentPrinterState
|
||||
{
|
||||
AString _prevMessage;
|
||||
AString _prevPercentMessage;
|
||||
bool _wasShown;
|
||||
UInt32 _tickStep;
|
||||
DWORD _prevTick;
|
||||
DWORD _prevElapsedSec;
|
||||
|
||||
bool _wasPrinted;
|
||||
|
||||
UString _tempU;
|
||||
UString _name1U;
|
||||
UString _name2U;
|
||||
|
||||
CPercentPrinterState _printedState;
|
||||
|
||||
AString _title;
|
||||
|
||||
AString _timeStr;
|
||||
AString _files;
|
||||
AString _sizesStr;
|
||||
AString _name1;
|
||||
AString _name2;
|
||||
AString _perc;
|
||||
|
||||
void ReduceString(const UString &src, AString &dest);
|
||||
|
||||
public:
|
||||
void Init(const AString &title, int width);
|
||||
void Progress(const UInt64 *total, const UInt64 *completed, const AString &message);
|
||||
DWORD StartTick;
|
||||
bool UseBytesForPercents;
|
||||
unsigned MaxLen;
|
||||
|
||||
CProgressBox(UInt32 tickStep = 200):
|
||||
_tickStep(tickStep),
|
||||
_prevTick(0),
|
||||
StartTick(0),
|
||||
UseBytesForPercents(true),
|
||||
MaxLen(60)
|
||||
{}
|
||||
|
||||
void Init(const AString &title);
|
||||
void Print();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user