mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-02-20 01:04:42 +02:00
Added a "show console" link parameter (Dingux build only).
This commit is contained in:
parent
7687212b4e
commit
e6ca072c46
@ -1705,6 +1705,9 @@ void GMenu2X::editLink() {
|
|||||||
sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens));
|
sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens));
|
||||||
sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases));
|
sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases));
|
||||||
sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &menu->selLinkApp()->runsInBackgroundRef()));
|
sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &menu->selLinkApp()->runsInBackgroundRef()));
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
sd.addSetting(new MenuSettingBool(this, ts, tr["Display Console"], tr["Must be enabled for console-based applications"], &menu->selLinkApp()->consoleApp));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sd.exec() && sd.edited()) {
|
if (sd.exec() && sd.edited()) {
|
||||||
ledOn();
|
ledOn();
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -53,6 +54,9 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
|
|||||||
icon = iconPath = "";
|
icon = iconPath = "";
|
||||||
selectorbrowser = false;
|
selectorbrowser = false;
|
||||||
useRamTimings = false;
|
useRamTimings = false;
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
consoleApp = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
ifstream infile (linkfile, ios_base::in);
|
ifstream infile (linkfile, ios_base::in);
|
||||||
@ -78,6 +82,10 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
|
|||||||
manual = value;
|
manual = value;
|
||||||
} else if (name == "dontleave") {
|
} else if (name == "dontleave") {
|
||||||
if (value=="true") dontleave = true;
|
if (value=="true") dontleave = true;
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
} else if (name == "consoleapp") {
|
||||||
|
if (value == "true") consoleApp = true;
|
||||||
|
#endif
|
||||||
} else if (name == "clock") {
|
} else if (name == "clock") {
|
||||||
setClock( atoi(value.c_str()) );
|
setClock( atoi(value.c_str()) );
|
||||||
} else if (name == "selectordir") {
|
} else if (name == "selectordir") {
|
||||||
@ -167,6 +175,9 @@ bool LinkApp::save() {
|
|||||||
if (selectorscreens!="") f << "selectorscreens=" << selectorscreens << endl;
|
if (selectorscreens!="") f << "selectorscreens=" << selectorscreens << endl;
|
||||||
if (aliasfile!="" ) f << "selectoraliases=" << aliasfile << endl;
|
if (aliasfile!="" ) f << "selectoraliases=" << aliasfile << endl;
|
||||||
if (dontleave ) f << "dontleave=true" << endl;
|
if (dontleave ) f << "dontleave=true" << endl;
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
if (consoleApp ) f << "consoleapp=true" << endl;
|
||||||
|
#endif
|
||||||
f.close();
|
f.close();
|
||||||
sync();
|
sync();
|
||||||
return true;
|
return true;
|
||||||
@ -429,6 +440,20 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
|||||||
signal(SIGTTOU, SIG_IGN);
|
signal(SIGTTOU, SIG_IGN);
|
||||||
tcsetpgrp(STDOUT_FILENO, pgid);
|
tcsetpgrp(STDOUT_FILENO, pgid);
|
||||||
|
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
if (consoleApp) {
|
||||||
|
/* Enable the framebuffer console */
|
||||||
|
char c = '1';
|
||||||
|
int fd = open("/sys/devices/virtual/vtconsole/vtcon1/bind", O_WRONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
WARNING("Unable to open fbcon handle\n");
|
||||||
|
} else {
|
||||||
|
write(fd, &c, 1);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
execlp("/bin/sh","/bin/sh", "-c", command.c_str(), NULL);
|
execlp("/bin/sh","/bin/sh", "-c", command.c_str(), NULL);
|
||||||
//if execution continues then something went wrong and as we already called SDL_Quit we cannot continue
|
//if execution continues then something went wrong and as we already called SDL_Quit we cannot continue
|
||||||
//try relaunching gmenu2x
|
//try relaunching gmenu2x
|
||||||
|
@ -58,6 +58,10 @@ public:
|
|||||||
const char* linkfile);
|
const char* linkfile);
|
||||||
virtual const std::string &searchIcon();
|
virtual const std::string &searchIcon();
|
||||||
|
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
bool consoleApp;
|
||||||
|
#endif
|
||||||
|
|
||||||
const std::string &getExec();
|
const std::string &getExec();
|
||||||
void setExec(const std::string &exec);
|
void setExec(const std::string &exec);
|
||||||
const std::string &getParams();
|
const std::string &getParams();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user