mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-19 17:59:16 +01:00
Fixed thi Install-Bug ... i think
This commit is contained in:
parent
319c82e588
commit
fc20580add
@ -376,7 +376,7 @@ class GuiElement
|
|||||||
protected:
|
protected:
|
||||||
void Lock();
|
void Lock();
|
||||||
void Unlock();
|
void Unlock();
|
||||||
mutex_t mutex;
|
static mutex_t mutex;
|
||||||
friend class SimpleLock;
|
friend class SimpleLock;
|
||||||
|
|
||||||
//int position2; //! B Scrollbariable
|
//int position2; //! B Scrollbariable
|
||||||
@ -422,9 +422,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
GuiElement *element;
|
GuiElement *element;
|
||||||
};
|
};
|
||||||
//#define LOCK(e) SimpleLock LOCK(e)
|
#define LOCK(e) SimpleLock LOCK(e)
|
||||||
//disabled because of problems with FW 4.0
|
//disabled because of problems with FW 4.0
|
||||||
#define LOCK(e)
|
//#define LOCK(e)
|
||||||
|
|
||||||
//!Allows GuiElements to be grouped together into a "window"
|
//!Allows GuiElements to be grouped together into a "window"
|
||||||
class GuiWindow : public GuiElement
|
class GuiWindow : public GuiElement
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Constructor for the Object class.
|
* Constructor for the Object class.
|
||||||
*/
|
*/
|
||||||
|
mutex_t GuiElement::mutex = 0;
|
||||||
GuiElement::GuiElement()
|
GuiElement::GuiElement()
|
||||||
{
|
{
|
||||||
xoffset = 0;
|
xoffset = 0;
|
||||||
@ -55,8 +56,7 @@ GuiElement::GuiElement()
|
|||||||
// default alignment - align to top left
|
// default alignment - align to top left
|
||||||
alignmentVert = ALIGN_TOP;
|
alignmentVert = ALIGN_TOP;
|
||||||
alignmentHor = ALIGN_LEFT;
|
alignmentHor = ALIGN_LEFT;
|
||||||
LWP_MutexInit(&mutex, true);
|
if(mutex == 0) LWP_MutexInit(&mutex, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,7 +64,7 @@ GuiElement::GuiElement()
|
|||||||
*/
|
*/
|
||||||
GuiElement::~GuiElement()
|
GuiElement::~GuiElement()
|
||||||
{
|
{
|
||||||
LWP_MutexDestroy(mutex);
|
// LWP_MutexDestroy(mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiElement::SetParent(GuiElement * e)
|
void GuiElement::SetParent(GuiElement * e)
|
||||||
|
@ -67,7 +67,7 @@ GuiText::~GuiText()
|
|||||||
{
|
{
|
||||||
if(text)
|
if(text)
|
||||||
{
|
{
|
||||||
delete text;
|
delete [] text;
|
||||||
text = NULL;
|
text = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ void GuiText::SetText(const char * t)
|
|||||||
{
|
{
|
||||||
LOCK(this);
|
LOCK(this);
|
||||||
if(text)
|
if(text)
|
||||||
delete text;
|
delete [] text;
|
||||||
text = NULL;
|
text = NULL;
|
||||||
|
|
||||||
if(t)
|
if(t)
|
||||||
|
@ -1341,16 +1341,22 @@ void
|
|||||||
ShowProgress (s32 done, s32 total)
|
ShowProgress (s32 done, s32 total)
|
||||||
{
|
{
|
||||||
|
|
||||||
static time_t start;
|
static time_t start;
|
||||||
static u32 expected;
|
static u32 expected;
|
||||||
|
|
||||||
f32 percent; //, size;
|
f32 percent; //, size;
|
||||||
u32 d, h, m, s;
|
u32 d, h, m, s;
|
||||||
|
static int last_percent;
|
||||||
|
static u32 last_d;
|
||||||
|
static int last_gamesizedone;
|
||||||
|
|
||||||
//first time
|
//first time
|
||||||
if (!done) {
|
if (!done) {
|
||||||
start = time(0);
|
start = time(0);
|
||||||
expected = 300;
|
expected = 300;
|
||||||
|
last_percent = -1;
|
||||||
|
last_d = 0;
|
||||||
|
last_gamesizedone = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Elapsed time
|
//Elapsed time
|
||||||
@ -1374,19 +1380,31 @@ ShowProgress (s32 done, s32 total)
|
|||||||
percent = (done * 100.0) / total;
|
percent = (done * 100.0) / total;
|
||||||
//size = (hdd->wbfs_sec_sz / GB_SIZE) * total;
|
//size = (hdd->wbfs_sec_sz / GB_SIZE) * total;
|
||||||
|
|
||||||
sprintf(prozent, "%0.2f", percent);
|
if(last_percent != (int)(percent*100))
|
||||||
prTxt.SetText(prozent);
|
{
|
||||||
|
last_percent = (int)(percent*100);
|
||||||
|
sprintf(prozent, "%d.%.2d", last_percent/100, last_percent%100);
|
||||||
|
prTxt.SetText(prozent);
|
||||||
|
}
|
||||||
//prTxt.SetFont(fontClock);
|
//prTxt.SetFont(fontClock);
|
||||||
sprintf(timet,"Time left: %d:%02d:%02d",h,m,s);
|
if(last_d != d)
|
||||||
timeTxt.SetText(timet);
|
{
|
||||||
|
last_d = d;
|
||||||
|
sprintf(timet,"Time left: %d:%02d:%02d",h,m,s);
|
||||||
|
timeTxt.SetText(timet);
|
||||||
|
}
|
||||||
|
|
||||||
float gamesizedone = 0.00;
|
float gamesizedone = 0.00;
|
||||||
|
|
||||||
gamesizedone = gamesize * done/total;
|
gamesizedone = gamesize * done/total;
|
||||||
|
|
||||||
sprintf(sizeshow,"%0.2fGB/%0.2fGB", gamesizedone, gamesize);
|
if(last_gamesizedone != (int)(gamesizedone*100));
|
||||||
sizeTxt.SetText(sizeshow);
|
{
|
||||||
|
last_gamesizedone = (int)(gamesizedone*100);
|
||||||
|
int int_gamesize = (int)(gamesize*100);
|
||||||
|
sprintf(sizeshow,"%d.%.2dGB/%d.%.2dGB", last_gamesizedone/100, last_gamesizedone%100, int_gamesize/100, int_gamesize%100);
|
||||||
|
sizeTxt.SetText(sizeshow);
|
||||||
|
}
|
||||||
// timeTxt.SetFont(fontClock);
|
// timeTxt.SetFont(fontClock);
|
||||||
if ((Settings.wsprompt == yes) && (CFG.widescreen)){
|
if ((Settings.wsprompt == yes) && (CFG.widescreen)){
|
||||||
progressbarImg.SetTile(80*done/total);}
|
progressbarImg.SetTile(80*done/total);}
|
||||||
@ -2218,7 +2236,6 @@ static int MenuDiscList()
|
|||||||
//CLOCK
|
//CLOCK
|
||||||
struct tm * timeinfo;
|
struct tm * timeinfo;
|
||||||
char theTime[80];
|
char theTime[80];
|
||||||
int counter = 0;
|
|
||||||
time_t lastrawtime=0;
|
time_t lastrawtime=0;
|
||||||
|
|
||||||
WBFS_DiskSpace(&used, &freespace);
|
WBFS_DiskSpace(&used, &freespace);
|
||||||
@ -2496,8 +2513,6 @@ static int MenuDiscList()
|
|||||||
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
|
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
|
||||||
clockTime.SetText(theTime);
|
clockTime.SetText(theTime);
|
||||||
}
|
}
|
||||||
counter++;
|
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
for(i=0; i < 4; i++)
|
for(i=0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user