1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 18:05:26 +03:00

Do not run the main loop inside the GMenu2X constructor, but in a method.

This commit is contained in:
Maarten ter Huurne 2010-06-19 03:50:23 +02:00
parent 7a5d099ff8
commit 3efa602af0
2 changed files with 9 additions and 12 deletions

View File

@ -85,7 +85,11 @@ int main(int /*argc*/, char */*argv*/[]) {
cout << "----" << endl;
signal(SIGINT,&exit);
GMenu2X app();
GMenu2X app;
#ifdef DEBUG
cout << "Starting main()" << endl;
#endif
app.main();
return 0;
}
@ -283,19 +287,14 @@ GMenu2X::GMenu2X() {
readTmp();
if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty()))
menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir);
}
#ifdef DEBUG
cout << "Starting main()" << endl;
#endif
main();
GMenu2X::~GMenu2X() {
writeConfig();
if (fwType=="open2x") writeConfigOpen2x();
quit();
exit(0);
}
GMenu2X::~GMenu2X() {
free(menu);
free(s);
free(font);
@ -768,7 +767,7 @@ int GMenu2X::getBackLight()
return val;
}
int GMenu2X::main() {
void GMenu2X::main() {
uint linksPerPage = linkColumns*linkRows;
int linkSpacingX = (resX-10 - linkColumns*skinConfInt["linkWidth"])/linkColumns;
int linkSpacingY = (resY-35 - skinConfInt["topBarHeight"] - linkRows*skinConfInt["linkHeight"])/linkRows;
@ -997,8 +996,6 @@ int GMenu2X::main() {
usleep(LOOP_DELAY);
}
return -1;
}
void GMenu2X::explorer() {

View File

@ -193,7 +193,7 @@ public:
ASFont *font;
//Status functions
int main();
void main();
void options();
void settingsOpen2x();
void skinMenu();