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:
12
src/menu.cpp
12
src/menu.cpp
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user