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

Merged LinkAction class into its base class.

LinkApp now calls its launch method via the delegate mechanism instead of
via an overridden virtual method. This should make it easier to move the
launch method out of LinkApp and into the GMenu2X main class.
This commit is contained in:
Maarten ter Huurne
2011-12-30 16:54:36 +01:00
parent 2d81b13459
commit 57ad81e3df
10 changed files with 26 additions and 92 deletions

View File

@@ -173,14 +173,14 @@ void Menu::setSectionIndex(int i) {
bool Menu::addActionLink(uint section, const string &title, LinkRunAction action, const string &description, const string &icon) {
if (section>=sections.size()) return false;
LinkAction *linkact = new LinkAction(gmenu2x, ts, action);
linkact->setSize(gmenu2x->skinConfInt["linkWidth"],gmenu2x->skinConfInt["linkHeight"]);
linkact->setTitle(title);
linkact->setDescription(description);
Link *link = new Link(gmenu2x, ts, action);
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
link->setTitle(title);
link->setDescription(description);
if (gmenu2x->sc.exists(icon) || (icon.substr(0,5)=="skin:" && !gmenu2x->sc.getSkinFilePath(icon.substr(5,icon.length())).empty()) || fileExists(icon))
linkact->setIcon(icon);
link->setIcon(icon);
sectionLinks(section)->push_back(linkact);
sectionLinks(section)->push_back(link);
return true;
}