Date:2011-09-23 01:51:53 (12 years 6 months ago)
Author:Maarten ter Huurne
Commit:e73a8d06ea888d6e77dda646589aee754e9e561c
Message:Removed per-application brightness setting.

The desired backlight level depends on the amount of light coming in from
the environment, not on the application that is run. Setting the brightness
when launching an application discards what is probably the right value
for this location (indoor/outdoor) and time of day. So we decided that this
is not a desirable feature and therefore removed it.
Files: src/gmenu2x.cpp (3 diffs)
src/linkapp.cpp (5 diffs)
src/linkapp.h (2 diffs)

Change Details

src/gmenu2x.cpp
16821682    int linkVolume = menu->selLinkApp()->volume();
16831683    //G
16841684    //int linkGamma = menu->selLinkApp()->gamma();
1685    int linkBacklight = menu->selLinkApp()->backlight();
16861685
16871686    string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL);
16881687    string diagIcon = menu->selLinkApp()->getIconPath();
...... 
16961695    sd.addSetting(new MenuSettingInt(this,tr["Clock (default: 336)"],tr["Cpu clock frequency to set when launching this link"],&linkClock,cpuFreqMin,confInt["maxClock"],cpuFreqMultiple));
16971696// sd.addSetting(new MenuSettingBool(this,tr["Tweak RAM Timings"],tr["This usually speeds up the application at the cost of stability"],&linkUseRamTimings));
16981697    sd.addSetting(new MenuSettingInt(this,tr["Volume (default: -1)"],tr["Volume to set for this link"],&linkVolume,-1,100));
1699    sd.addSetting(new MenuSettingInt(this,tr["Backlight (default: -1)"],tr["LCD backlight value to set when launching this link"],&linkBacklight,-1,100));
17001698    sd.addSetting(new MenuSettingString(this,tr["Parameters"],tr["Parameters to pass to the application"],&linkParams, diagTitle,diagIcon));
17011699    sd.addSetting(new MenuSettingDir(this,tr["Selector Directory"],tr["Directory to scan for the selector"],&linkSelDir));
17021700    sd.addSetting(new MenuSettingBool(this,tr["Selector Browser"],tr["Allow the selector to change directory"],&linkSelBrowser));
...... 
17231721        menu->selLinkApp()->setAliasFile(linkSelAliases);
17241722        menu->selLinkApp()->setClock(linkClock);
17251723        menu->selLinkApp()->setVolume(linkVolume);
1726        //G
1727        if ((linkBacklight < 5) && (linkBacklight > -1))
1728            linkBacklight = 5;
1729        menu->selLinkApp()->setBacklight(linkBacklight);
17301724
17311725        INFO("New Section: '%s'\n", newSection.c_str());
17321726
src/linkapp.cpp
4747    setVolume(-1);
4848    //G
4949    //setGamma(0);
50    setBacklight(-1);
5150    selectordir = "";
5251    selectorfilter = "";
5352    icon = iconPath = "";
...... 
8786        //G
8887        } else if (name == "gamma") {
8988            setGamma( atoi(value.c_str()) );
90        } else if (name == "backlight") {
91            setBacklight( atoi(value.c_str()) );
9289        } else if (name == "volume") {
9390            setVolume( atoi(value.c_str()) );
9491        } else if (name == "selectordir") {
...... 
175172    edited = true;
176173}
177174
178int LinkApp::backlight()
179{
180    return ibacklight;
181}
182
183const string &LinkApp::backlightStr()
184{
185    return sbacklight;
186}
187
188void LinkApp::setBacklight(int val)
189{
190    ibacklight = constrain(val,-1,100);
191    stringstream ss;
192    sbacklight = "";
193    ss << ibacklight;
194    ss >> sbacklight;
195
196    edited = true;
197}
198175//G
199176int LinkApp::gamma() {
200177    return igamma;
...... 
241218        if (ivolume>0 ) f << "volume=" << ivolume << endl;
242219        //G
243220        if (igamma!=0 ) f << "gamma=" << igamma << endl;
244        if (ibacklight!=0 ) f << "backlight=" << ibacklight << endl;
245221        if (selectordir!="" ) f << "selectordir=" << selectordir << endl;
246222        if (selectorbrowser ) f << "selectorbrowser=true" << endl;
247223        if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl;
...... 
497473            gmenu2x->setClock(clock());
498474        //if (gamma()!=0 && gamma()!=gmenu2x->confInt["gamma"])
499475        // gmenu2x->setGamma(gamma());
500        if((backlight() != 0) && (backlight() != gmenu2x->confInt["backlight"]))
501            gmenu2x->setBacklight(backlight());
502476
503477        /* Make the terminal we're connected to (via stdin/stdout) our
504478                 contolling terminal again. Else many console programs are
src/linkapp.h
4242    int iclock, ivolume;
4343    //G
4444    string sgamma;
45    string sbacklight;
4645    //G
4746    int igamma;
48    int ibacklight;
4947    string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens;
5048    bool selectorbrowser, useRamTimings;
5149    void drawRun();
...... 
9492    const string &gammaStr();
9593    void setGamma(int gamma);
9694
97    int backlight();
98    const string &backlightStr();
99    void setBacklight(int val);
100// /G
101
10295    bool save();
10396    void run();
10497    void showManual();

Archive Download the corresponding diff file



interactive