Fixed thi Install-Bug ... i think

This commit is contained in:
ardi@ist-einmalig.de 2009-05-11 18:45:33 +00:00
parent 319c82e588
commit fc20580add
5 changed files with 35 additions and 20 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -1346,11 +1346,17 @@ ShowProgress (s32 done, s32 total)
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))
{
last_percent = (int)(percent*100);
sprintf(prozent, "%d.%.2d", last_percent/100, last_percent%100);
prTxt.SetText(prozent); prTxt.SetText(prozent);
}
//prTxt.SetFont(fontClock); //prTxt.SetFont(fontClock);
if(last_d != d)
{
last_d = d;
sprintf(timet,"Time left: %d:%02d:%02d",h,m,s); sprintf(timet,"Time left: %d:%02d:%02d",h,m,s);
timeTxt.SetText(timet); 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));
{
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); 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++)
{ {