mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 20:25:54 +02:00
Do not run the main loop inside the GMenu2X constructor, but in a method.
This commit is contained in:
parent
7a5d099ff8
commit
3efa602af0
@ -85,7 +85,11 @@ int main(int /*argc*/, char */*argv*/[]) {
|
|||||||
cout << "----" << endl;
|
cout << "----" << endl;
|
||||||
|
|
||||||
signal(SIGINT,&exit);
|
signal(SIGINT,&exit);
|
||||||
GMenu2X app();
|
GMenu2X app;
|
||||||
|
#ifdef DEBUG
|
||||||
|
cout << "Starting main()" << endl;
|
||||||
|
#endif
|
||||||
|
app.main();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,19 +287,14 @@ GMenu2X::GMenu2X() {
|
|||||||
readTmp();
|
readTmp();
|
||||||
if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty()))
|
if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty()))
|
||||||
menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir);
|
menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
GMenu2X::~GMenu2X() {
|
||||||
cout << "Starting main()" << endl;
|
|
||||||
#endif
|
|
||||||
main();
|
|
||||||
writeConfig();
|
writeConfig();
|
||||||
if (fwType=="open2x") writeConfigOpen2x();
|
if (fwType=="open2x") writeConfigOpen2x();
|
||||||
|
|
||||||
quit();
|
quit();
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
GMenu2X::~GMenu2X() {
|
|
||||||
free(menu);
|
free(menu);
|
||||||
free(s);
|
free(s);
|
||||||
free(font);
|
free(font);
|
||||||
@ -768,7 +767,7 @@ int GMenu2X::getBackLight()
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GMenu2X::main() {
|
void GMenu2X::main() {
|
||||||
uint linksPerPage = linkColumns*linkRows;
|
uint linksPerPage = linkColumns*linkRows;
|
||||||
int linkSpacingX = (resX-10 - linkColumns*skinConfInt["linkWidth"])/linkColumns;
|
int linkSpacingX = (resX-10 - linkColumns*skinConfInt["linkWidth"])/linkColumns;
|
||||||
int linkSpacingY = (resY-35 - skinConfInt["topBarHeight"] - linkRows*skinConfInt["linkHeight"])/linkRows;
|
int linkSpacingY = (resY-35 - skinConfInt["topBarHeight"] - linkRows*skinConfInt["linkHeight"])/linkRows;
|
||||||
@ -997,8 +996,6 @@ int GMenu2X::main() {
|
|||||||
|
|
||||||
usleep(LOOP_DELAY);
|
usleep(LOOP_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMenu2X::explorer() {
|
void GMenu2X::explorer() {
|
||||||
|
@ -193,7 +193,7 @@ public:
|
|||||||
ASFont *font;
|
ASFont *font;
|
||||||
|
|
||||||
//Status functions
|
//Status functions
|
||||||
int main();
|
void main();
|
||||||
void options();
|
void options();
|
||||||
void settingsOpen2x();
|
void settingsOpen2x();
|
||||||
void skinMenu();
|
void skinMenu();
|
||||||
|
Loading…
Reference in New Issue
Block a user