Date:2012-04-13 19:21:49 (1 year 1 month ago)
Author:Paul Cercueil
Commit:e6ca072c46d076118d6b24d788ae96f5775ea795
Message:Added a "show console" link parameter (Dingux build only).

Files: src/gmenu2x.cpp (1 diff)
src/linkapp.cpp (5 diffs)
src/linkapp.h (1 diff)

Change Details

src/gmenu2x.cpp
17051705    sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens));
17061706    sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases));
17071707    sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &menu->selLinkApp()->runsInBackgroundRef()));
1708#ifdef PLATFORM_DINGUX
1709    sd.addSetting(new MenuSettingBool(this, ts, tr["Display Console"], tr["Must be enabled for console-based applications"], &menu->selLinkApp()->consoleApp));
1710#endif
17081711
17091712    if (sd.exec() && sd.edited()) {
17101713        ledOn();
src/linkapp.cpp
3232#include <sys/ioctl.h>
3333#include <signal.h>
3434#include <unistd.h>
35#include <fcntl.h>
3536
3637#include <fstream>
3738#include <sstream>
...... 
5354    icon = iconPath = "";
5455    selectorbrowser = false;
5556    useRamTimings = false;
57#ifdef PLATFORM_DINGUX
58    consoleApp = false;
59#endif
5660
5761    string line;
5862    ifstream infile (linkfile, ios_base::in);
...... 
7882            manual = value;
7983        } else if (name == "dontleave") {
8084            if (value=="true") dontleave = true;
85#ifdef PLATFORM_DINGUX
86        } else if (name == "consoleapp") {
87            if (value == "true") consoleApp = true;
88#endif
8189        } else if (name == "clock") {
8290            setClock( atoi(value.c_str()) );
8391        } else if (name == "selectordir") {
...... 
167175        if (selectorscreens!="") f << "selectorscreens=" << selectorscreens << endl;
168176        if (aliasfile!="" ) f << "selectoraliases=" << aliasfile << endl;
169177        if (dontleave ) f << "dontleave=true" << endl;
178#ifdef PLATFORM_DINGUX
179        if (consoleApp ) f << "consoleapp=true" << endl;
180#endif
170181        f.close();
171182        sync();
172183        return true;
...... 
429440        signal(SIGTTOU, SIG_IGN);
430441        tcsetpgrp(STDOUT_FILENO, pgid);
431442
443#ifdef PLATFORM_DINGUX
444        if (consoleApp) {
445            /* Enable the framebuffer console */
446            char c = '1';
447            int fd = open("/sys/devices/virtual/vtconsole/vtcon1/bind", O_WRONLY);
448            if (fd < 0) {
449                WARNING("Unable to open fbcon handle\n");
450            } else {
451                write(fd, &c, 1);
452                close(fd);
453            }
454        }
455#endif
456
432457        execlp("/bin/sh","/bin/sh", "-c", command.c_str(), NULL);
433458        //if execution continues then something went wrong and as we already called SDL_Quit we cannot continue
434459        //try relaunching gmenu2x
src/linkapp.h
5858            const char* linkfile);
5959    virtual const std::string &searchIcon();
6060
61#ifdef PLATFORM_DINGUX
62    bool consoleApp;
63#endif
64
6165    const std::string &getExec();
6266    void setExec(const std::string &exec);
6367    const std::string &getParams();

Archive Download the corresponding diff file



interactive