1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-28 16:15:10 +02:00

Remove hardcoded MHz values, use the defined main/max clocks instead

This commit is contained in:
Paul Cercueil 2012-12-06 20:53:39 -03:00
parent df7fb985a3
commit 473949bb4f
3 changed files with 9 additions and 23 deletions

View File

@ -1210,7 +1210,7 @@ void GMenu2X::editLink() {
#ifdef HAVE_LIBOPK
}
#endif
sd.addSetting(new MenuSettingInt(this, ts, tr["Clock (default: 336)"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple));
sd.addSetting(new MenuSettingInt(this, ts, tr["Clock frequency"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple));
sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Directory"], tr["Directory to scan for the selector"], &linkSelDir));
sd.addSetting(new MenuSettingBool(this, ts, tr["Selector Browser"], tr["Allow the selector to change directory"], &linkSelBrowser));
#ifdef HAVE_LIBOPK
@ -1350,13 +1350,7 @@ void GMenu2X::scanner() {
#ifdef PLATFORM_PANDORA
//char *configpath = pnd_conf_query_searchpath();
#else
if (confInt["menuClock"]<336) {
setClock(336);
scanbg.write(font,tr["Raising cpu clock to 336MHz"],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
}
setSafeMaxClock();
scanbg.write(font,tr["Scanning filesystem..."],5,lineY);
scanbg.blit(s,0,0);
@ -1399,14 +1393,7 @@ void GMenu2X::scanner() {
s->flip();
lineY += 26;
if (confInt["menuClock"]<336) {
setClock(confInt["menuClock"]);
scanbg.write(font,tr["Decreasing cpu clock"],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
}
setMenuClock();
sync();
#endif

View File

@ -159,6 +159,9 @@ public:
void changeWallpaper();
void setClock(unsigned mhz);
unsigned getDefaultAppClock() { return cpuFreqAppDefault; }
void setMenuClock() { setClock(cpuFreqMenuDefault); }
void setSafeMaxClock() { setClock(cpuFreqSafeMax); }
void setInputSpeed();

View File

@ -68,7 +68,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
manual = "";
file = linkfile;
dontleave = false;
setClock(336);
setClock(gmenu2x->getDefaultAppClock());
selectordir = "";
selectorfilter = "";
icon = iconPath = "";
@ -418,7 +418,7 @@ void LinkApp::showManual() {
string ext8 = manual.substr(manual.size()-8,8);
if (ext8==".man.png" || ext8==".man.bmp" || ext8==".man.jpg" || manual.substr(manual.size()-9,9)==".man.jpeg") {
//Raise the clock to speed-up the loading of the manual
gmenu2x->setClock(336);
gmenu2x->setSafeMaxClock();
Surface *pngman = Surface::loadImage(manual);
if (!pngman) {
@ -441,7 +441,7 @@ void LinkApp::showManual() {
ss >> spagecount;
//Lower the clock
gmenu2x->setClock(gmenu2x->confInt["menuClock"]);
gmenu2x->setMenuClock();
while (!close) {
if (repaint) {
@ -496,12 +496,10 @@ void LinkApp::showManual() {
string line;
ifstream infile(manual.c_str(), ios_base::in);
if (infile.is_open()) {
gmenu2x->setClock(336);
while (getline(infile, line, '\n')) txtman.push_back(line);
infile.close();
TextManualDialog tmd(gmenu2x, getTitle(), getIconPath(), &txtman);
gmenu2x->setClock(gmenu2x->confInt["menuClock"]);
tmd.exec();
}
@ -514,12 +512,10 @@ void LinkApp::showManual() {
string line;
ifstream infile(manual.c_str(), ios_base::in);
if (infile.is_open()) {
gmenu2x->setClock(336);
while (getline(infile, line, '\n')) readme.push_back(line);
infile.close();
TextDialog td(gmenu2x, getTitle(), "ReadMe", getIconPath(), &readme);
gmenu2x->setClock(gmenu2x->confInt["menuClock"]);
td.exec();
}
}