1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Add function GMenu2X::getTouchscreen(), to simplify Link and LinkApp prototypes

This commit is contained in:
Paul Cercueil
2013-09-05 19:19:16 -04:00
parent 20339c8849
commit 1ff17d83c9
6 changed files with 17 additions and 14 deletions

View File

@@ -399,7 +399,7 @@ void Menu::setSectionIndex(int i) {
bool Menu::addActionLink(uint section, const string &title, function_t action, const string &description, const string &icon) {
if (section>=sections.size()) return false;
Link *link = new Link(gmenu2x, ts, action);
Link *link = new Link(gmenu2x, action);
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
link->setTitle(title);
link->setDescription(description);
@@ -500,7 +500,7 @@ bool Menu::addLink(string path, string file, string section) {
INFO("Section: '%s(%i)'\n", sections[isection].c_str(), isection);
LinkApp* link = new LinkApp(gmenu2x, ts, gmenu2x->input, linkpath.c_str());
LinkApp* link = new LinkApp(gmenu2x, gmenu2x->input, linkpath.c_str());
link->setSize(gmenu2x->skinConfInt["linkWidth"],gmenu2x->skinConfInt["linkHeight"]);
links[isection].push_back( link );
}
@@ -703,7 +703,7 @@ void Menu::openPackage(std::string path, bool order)
if (!has_metadata)
break;
link = new LinkApp(gmenu2x, ts, gmenu2x->input, path.c_str(), opk);
link = new LinkApp(gmenu2x, gmenu2x->input, path.c_str(), opk);
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
addSection(link->getCategory());
@@ -845,7 +845,7 @@ void Menu::readLinks() {
sort(linkfiles.begin(), linkfiles.end(),case_less());
for (uint x=0; x<linkfiles.size(); x++) {
LinkApp *link = new LinkApp(gmenu2x, ts, gmenu2x->input, linkfiles[x].c_str());
LinkApp *link = new LinkApp(gmenu2x, gmenu2x->input, linkfiles[x].c_str());
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
if (link->targetExists())
links[i].push_back(link);