mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-29 11:40:37 +02:00
Simplify again the prototype of LinkApp as gmenu2x->input is public
This commit is contained in:
parent
1ff17d83c9
commit
b73391486f
@ -57,14 +57,11 @@ using namespace std;
|
|||||||
static const char *tokens[] = { "%f", "%F", "%u", "%U", };
|
static const char *tokens[] = { "%f", "%F", "%u", "%U", };
|
||||||
|
|
||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
LinkApp::LinkApp(GMenu2X *gmenu2x_, InputManager &inputMgr_,
|
LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile, struct OPK *opk)
|
||||||
const char* linkfile, struct OPK *opk)
|
|
||||||
#else
|
#else
|
||||||
LinkApp::LinkApp(GMenu2X *gmenu2x_, InputManager &inputMgr_,
|
LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||||
const char* linkfile)
|
|
||||||
#endif
|
#endif
|
||||||
: Link(gmenu2x_, BIND(&LinkApp::start))
|
: Link(gmenu2x_, BIND(&LinkApp::start))
|
||||||
, inputMgr(inputMgr_)
|
|
||||||
{
|
{
|
||||||
manual = "";
|
manual = "";
|
||||||
file = linkfile;
|
file = linkfile;
|
||||||
@ -481,7 +478,7 @@ void LinkApp::showManual() {
|
|||||||
repaint = false;
|
repaint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(inputMgr.waitForPressedButton()) {
|
switch(gmenu2x->input.waitForPressedButton()) {
|
||||||
case InputManager::SETTINGS:
|
case InputManager::SETTINGS:
|
||||||
case InputManager::CANCEL:
|
case InputManager::CANCEL:
|
||||||
close = true;
|
close = true;
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class GMenu2X;
|
class GMenu2X;
|
||||||
class InputManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parses links files.
|
Parses links files.
|
||||||
@ -35,7 +34,6 @@ Parses links files.
|
|||||||
*/
|
*/
|
||||||
class LinkApp : public Link {
|
class LinkApp : public Link {
|
||||||
private:
|
private:
|
||||||
InputManager &inputMgr;
|
|
||||||
std::string sclock;
|
std::string sclock;
|
||||||
int iclock;
|
int iclock;
|
||||||
std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens;
|
std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens;
|
||||||
@ -61,11 +59,9 @@ public:
|
|||||||
bool isOpk() { return isOPK; }
|
bool isOpk() { return isOPK; }
|
||||||
const std::string &getOpkFile() { return opkFile; }
|
const std::string &getOpkFile() { return opkFile; }
|
||||||
|
|
||||||
LinkApp(GMenu2X *gmenu2x, InputManager &inputMgr,
|
LinkApp(GMenu2X *gmenu2x, const char* linkfile, struct OPK *opk = NULL);
|
||||||
const char* linkfile, struct OPK *opk = NULL);
|
|
||||||
#else
|
#else
|
||||||
LinkApp(GMenu2X *gmenu2x, InputManager &inputMgr,
|
LinkApp(GMenu2X *gmenu2x, const char* linkfile);
|
||||||
const char* linkfile);
|
|
||||||
bool isOpk() { return false; }
|
bool isOpk() { return false; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ bool Menu::addLink(string path, string file, string section) {
|
|||||||
|
|
||||||
INFO("Section: '%s(%i)'\n", sections[isection].c_str(), isection);
|
INFO("Section: '%s(%i)'\n", sections[isection].c_str(), isection);
|
||||||
|
|
||||||
LinkApp* link = new LinkApp(gmenu2x, gmenu2x->input, linkpath.c_str());
|
LinkApp* link = new LinkApp(gmenu2x, linkpath.c_str());
|
||||||
link->setSize(gmenu2x->skinConfInt["linkWidth"],gmenu2x->skinConfInt["linkHeight"]);
|
link->setSize(gmenu2x->skinConfInt["linkWidth"],gmenu2x->skinConfInt["linkHeight"]);
|
||||||
links[isection].push_back( link );
|
links[isection].push_back( link );
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ void Menu::openPackage(std::string path, bool order)
|
|||||||
if (!has_metadata)
|
if (!has_metadata)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
link = new LinkApp(gmenu2x, gmenu2x->input, path.c_str(), opk);
|
link = new LinkApp(gmenu2x, path.c_str(), opk);
|
||||||
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
|
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
|
||||||
|
|
||||||
addSection(link->getCategory());
|
addSection(link->getCategory());
|
||||||
@ -845,7 +845,7 @@ void Menu::readLinks() {
|
|||||||
|
|
||||||
sort(linkfiles.begin(), linkfiles.end(),case_less());
|
sort(linkfiles.begin(), linkfiles.end(),case_less());
|
||||||
for (uint x=0; x<linkfiles.size(); x++) {
|
for (uint x=0; x<linkfiles.size(); x++) {
|
||||||
LinkApp *link = new LinkApp(gmenu2x, gmenu2x->input, linkfiles[x].c_str());
|
LinkApp *link = new LinkApp(gmenu2x, linkfiles[x].c_str());
|
||||||
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
|
link->setSize(gmenu2x->skinConfInt["linkWidth"], gmenu2x->skinConfInt["linkHeight"]);
|
||||||
if (link->targetExists())
|
if (link->targetExists())
|
||||||
links[i].push_back(link);
|
links[i].push_back(link);
|
||||||
|
Loading…
Reference in New Issue
Block a user