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 | ||
---|---|---|
1269 | 1269 | |
1270 | 1270 | void GMenu2X::options() { |
1271 | 1271 | int curMenuClock = confInt["menuClock"]; |
1272 | //G | |
1273 | 1272 | int oldBacklight = getBackLight(); |
1274 | 1273 | int newBacklight = oldBacklight; |
1275 | 1274 | bool showRootFolder = fileExists(CARD_ROOT); |
... | ... | |
1292 | 1291 | sd.addSetting(new MenuSettingInt(this, ts, tr["Clock for GMenu2X"], tr["Set the cpu working frequency when running GMenu2X"], &confInt["menuClock"], cpuFreqMin, cpuFreqSafeMax, cpuFreqMultiple)); |
1293 | 1292 | sd.addSetting(new MenuSettingInt(this, ts, tr["Maximum overclock"], tr["Set the maximum overclock for launching links"], &confInt["maxClock"], cpuFreqMin, cpuFreqMax, cpuFreqMultiple)); |
1294 | 1293 | 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 | |
1296 | 1294 | sd.addSetting(new MenuSettingInt(this, ts, tr["Lcd Backlight"], tr["Set Lcd Backlight value (default: 100)"], &newBacklight, 5, 100)); |
1297 | 1295 | sd.addSetting(new MenuSettingInt(this, ts, tr["Screen Timeout"], tr["Set screen's backlight timeout in seconds"], &confInt["backlightTimeout"], 0, 120)); |
1298 | 1296 | // sd.addSetting(new MenuSettingMultiString(this, ts, tr["Tv-Out encoding"], tr["Encoding of the tv-out signal"], &confStr["tvoutEncoding"], &encodings)); |
1299 | 1297 | sd.addSetting(new MenuSettingBool(this, ts, tr["Show root"], tr["Show root folder in the file selection dialogs"], &showRootFolder)); |
1300 | 1298 | |
1301 | 1299 | if (sd.exec() && sd.edited()) { |
1302 | //G | |
1303 | 1300 | if (newBacklight != oldBacklight) setBacklight(newBacklight); |
1304 | 1301 | if (curMenuClock != confInt["menuClock"]) setClock(confInt["menuClock"]); |
1305 | 1302 | |
... | ... | |
1685 | 1682 | string linkSelScreens = menu->selLinkApp()->getSelectorScreens(); |
1686 | 1683 | string linkSelAliases = menu->selLinkApp()->getAliasFile(); |
1687 | 1684 | int linkClock = menu->selLinkApp()->clock(); |
1688 | //G | |
1689 | //int linkGamma = menu->selLinkApp()->gamma(); | |
1690 | 1685 | |
1691 | 1686 | string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL); |
1692 | 1687 | string diagIcon = menu->selLinkApp()->getIconPath(); |
... | ... | |
1705 | 1700 | sd.addSetting(new MenuSettingString(this, ts, tr["Selector Filter"], tr["Selector filter (Separate values with a comma)"], &linkSelFilter, diagTitle, diagIcon)); |
1706 | 1701 | sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens)); |
1707 | 1702 | sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases)); |
1708 | //G | |
1709 | 1703 | sd.addSetting(new MenuSettingBool(this, ts, tr["Wrapper"], tr["Explicitly relaunch GMenu2X after execution"], &menu->selLinkApp()->needsWrapperRef())); |
1710 | 1704 | sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &menu->selLinkApp()->runsInBackgroundRef())); |
1711 | 1705 |
src/linkapp.cpp | ||
---|---|---|
48 | 48 | wrapper = false; |
49 | 49 | dontleave = false; |
50 | 50 | setClock(336); |
51 | //G | |
52 | //setGamma(0); | |
53 | 51 | selectordir = ""; |
54 | 52 | selectorfilter = ""; |
55 | 53 | icon = iconPath = ""; |
... | ... | |
84 | 82 | if (value=="true") dontleave = true; |
85 | 83 | } else if (name == "clock") { |
86 | 84 | setClock( atoi(value.c_str()) ); |
87 | //G | |
88 | } else if (name == "gamma") { | |
89 | setGamma( atoi(value.c_str()) ); | |
90 | 85 | } else if (name == "selectordir") { |
91 | 86 | setSelectorDir( value ); |
92 | 87 | } else if (name == "selectorbrowser") { |
... | ... | |
150 | 145 | edited = true; |
151 | 146 | } |
152 | 147 | |
153 | //G | |
154 | int LinkApp::gamma() { | |
155 | return igamma; | |
156 | } | |
157 | ||
158 | const string &LinkApp::gammaStr() { | |
159 | return sgamma; | |
160 | } | |
161 | ||
162 | void 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 | ||
173 | 148 | bool LinkApp::targetExists() |
174 | 149 | { |
175 | 150 | return fileExists(exec); |
... | ... | |
188 | 163 | if (manual!="" ) f << "manual=" << manual << endl; |
189 | 164 | if (iclock!=0 ) f << "clock=" << iclock << endl; |
190 | 165 | if (useRamTimings ) f << "useramtimings=true" << endl; |
191 | //G | |
192 | if (igamma!=0 ) f << "gamma=" << igamma << endl; | |
193 | 166 | if (selectordir!="" ) f << "selectordir=" << selectordir << endl; |
194 | 167 | if (selectorbrowser ) f << "selectorbrowser=true" << endl; |
195 | 168 | if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl; |
... | ... | |
444 | 417 | gmenu2x->setClock(clock()); |
445 | 418 | } |
446 | 419 | gmenu2x->quit(); |
447 | //if (gamma()!=0 && gamma()!=gmenu2x->confInt["gamma"]) | |
448 | // gmenu2x->setGamma(gamma()); | |
449 | 420 | |
450 | 421 | /* Make the terminal we're connected to (via stdin/stdout) our |
451 | 422 | controlling terminal again. Else many console programs are |
src/linkapp.h | ||
---|---|---|
39 | 39 | InputManager &inputMgr; |
40 | 40 | std::string sclock; |
41 | 41 | int iclock; |
42 | //G | |
43 | std::string sgamma; | |
44 | //G | |
45 | int igamma; | |
46 | 42 | std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens; |
47 | 43 | bool selectorbrowser, useRamTimings; |
48 | 44 | void drawRun(); |
... | ... | |
81 | 77 | const std::string &clockStr(int maxClock); |
82 | 78 | void setClock(int mhz); |
83 | 79 | |
84 | //G | |
85 | int gamma(); | |
86 | const std::string &gammaStr(); | |
87 | void setGamma(int gamma); | |
88 | ||
89 | 80 | bool save(); |
90 | 81 | void run(); |
91 | 82 | void showManual(); |
Branches:
install_locations
master
opkrun
packages