Date:2011-12-23 15:39:53 (12 years 3 months ago)
Author:Maarten ter Huurne
Commit:d90ed635be63f86fad7fb09912f7f03e3f773ca8
Message:Removed per-app gamma setting.

This functionality was half-removed already: some code missing, other
essential parts commented out.

I don't see the point of this either: RGB graphics are created for a certain
gamma value; if that differs from the screen gamma it is up to the application
to do something about it: gamma correct the graphics and/or change the screen
gamma. It doesn't make sense to make this user configurable.
Files: src/gmenu2x.cpp (4 diffs)
src/linkapp.cpp (5 diffs)
src/linkapp.h (2 diffs)

Change Details

src/gmenu2x.cpp
12691269
12701270void GMenu2X::options() {
12711271    int curMenuClock = confInt["menuClock"];
1272    //G
12731272    int oldBacklight = getBackLight();
12741273    int newBacklight = oldBacklight;
12751274    bool showRootFolder = fileExists(CARD_ROOT);
...... 
12921291    sd.addSetting(new MenuSettingInt(this, ts, tr["Clock for GMenu2X"], tr["Set the cpu working frequency when running GMenu2X"], &confInt["menuClock"], cpuFreqMin, cpuFreqSafeMax, cpuFreqMultiple));
12931292    sd.addSetting(new MenuSettingInt(this, ts, tr["Maximum overclock"], tr["Set the maximum overclock for launching links"], &confInt["maxClock"], cpuFreqMin, cpuFreqMax, cpuFreqMultiple));
12941293    sd.addSetting(new MenuSettingBool(this, ts, tr["Output logs"], tr["Logs the output of the links. Use the Log Viewer to read them."], &confInt["outputLogs"]));
1295    //G
12961294    sd.addSetting(new MenuSettingInt(this, ts, tr["Lcd Backlight"], tr["Set Lcd Backlight value (default: 100)"], &newBacklight, 5, 100));
12971295    sd.addSetting(new MenuSettingInt(this, ts, tr["Screen Timeout"], tr["Set screen's backlight timeout in seconds"], &confInt["backlightTimeout"], 0, 120));
12981296// sd.addSetting(new MenuSettingMultiString(this, ts, tr["Tv-Out encoding"], tr["Encoding of the tv-out signal"], &confStr["tvoutEncoding"], &encodings));
12991297    sd.addSetting(new MenuSettingBool(this, ts, tr["Show root"], tr["Show root folder in the file selection dialogs"], &showRootFolder));
13001298
13011299    if (sd.exec() && sd.edited()) {
1302        //G
13031300        if (newBacklight != oldBacklight) setBacklight(newBacklight);
13041301        if (curMenuClock != confInt["menuClock"]) setClock(confInt["menuClock"]);
13051302
...... 
16851682    string linkSelScreens = menu->selLinkApp()->getSelectorScreens();
16861683    string linkSelAliases = menu->selLinkApp()->getAliasFile();
16871684    int linkClock = menu->selLinkApp()->clock();
1688    //G
1689    //int linkGamma = menu->selLinkApp()->gamma();
16901685
16911686    string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL);
16921687    string diagIcon = menu->selLinkApp()->getIconPath();
...... 
17051700    sd.addSetting(new MenuSettingString(this, ts, tr["Selector Filter"], tr["Selector filter (Separate values with a comma)"], &linkSelFilter, diagTitle, diagIcon));
17061701    sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens));
17071702    sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases));
1708    //G
17091703    sd.addSetting(new MenuSettingBool(this, ts, tr["Wrapper"], tr["Explicitly relaunch GMenu2X after execution"], &menu->selLinkApp()->needsWrapperRef()));
17101704    sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &menu->selLinkApp()->runsInBackgroundRef()));
17111705
src/linkapp.cpp
4848    wrapper = false;
4949    dontleave = false;
5050    setClock(336);
51    //G
52    //setGamma(0);
5351    selectordir = "";
5452    selectorfilter = "";
5553    icon = iconPath = "";
...... 
8482            if (value=="true") dontleave = true;
8583        } else if (name == "clock") {
8684            setClock( atoi(value.c_str()) );
87        //G
88        } else if (name == "gamma") {
89            setGamma( atoi(value.c_str()) );
9085        } else if (name == "selectordir") {
9186            setSelectorDir( value );
9287        } else if (name == "selectorbrowser") {
...... 
150145    edited = true;
151146}
152147
153//G
154int LinkApp::gamma() {
155    return igamma;
156}
157
158const string &LinkApp::gammaStr() {
159    return sgamma;
160}
161
162void LinkApp::setGamma(int gamma) {
163    igamma = constrain(gamma,0,100);
164    stringstream ss;
165    sgamma = "";
166    ss << igamma;
167    ss >> sgamma;
168
169    edited = true;
170}
171// /G
172
173148bool LinkApp::targetExists()
174149{
175150    return fileExists(exec);
...... 
188163        if (manual!="" ) f << "manual=" << manual << endl;
189164        if (iclock!=0 ) f << "clock=" << iclock << endl;
190165        if (useRamTimings ) f << "useramtimings=true" << endl;
191        //G
192        if (igamma!=0 ) f << "gamma=" << igamma << endl;
193166        if (selectordir!="" ) f << "selectordir=" << selectordir << endl;
194167        if (selectorbrowser ) f << "selectorbrowser=true" << endl;
195168        if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl;
...... 
444417            gmenu2x->setClock(clock());
445418        }
446419        gmenu2x->quit();
447        //if (gamma()!=0 && gamma()!=gmenu2x->confInt["gamma"])
448        // gmenu2x->setGamma(gamma());
449420
450421        /* Make the terminal we're connected to (via stdin/stdout) our
451422           controlling terminal again. Else many console programs are
src/linkapp.h
3939    InputManager &inputMgr;
4040    std::string sclock;
4141    int iclock;
42    //G
43    std::string sgamma;
44    //G
45    int igamma;
4642    std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens;
4743    bool selectorbrowser, useRamTimings;
4844    void drawRun();
...... 
8177    const std::string &clockStr(int maxClock);
8278    void setClock(int mhz);
8379
84//G
85    int gamma();
86    const std::string &gammaStr();
87    void setGamma(int gamma);
88
8980    bool save();
9081    void run();
9182    void showManual();

Archive Download the corresponding diff file



interactive