From 22d3f99525091633b398e9b3f17e695ae9322e0d Mon Sep 17 00:00:00 2001 From: Daniel Klaffenbach Date: Sun, 6 Mar 2011 21:03:01 +0100 Subject: [PATCH] Helpviewer: split up help files into regular/power kernel help --- src/help_en.html | 23 ++++++----------------- src/help_en_power.html | 15 +++++++++++++++ src/helpwindow.cpp | 15 +++++++++++++-- src/src.pro | 2 +- 4 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 src/help_en_power.html diff --git a/src/help_en.html b/src/help_en.html index 2536f50..5f15787 100644 --- a/src/help_en.html +++ b/src/help_en.html @@ -6,28 +6,17 @@ This enables you to overclock your CPU easily (only on power kernel), but of cou


-Notes for official kernel users: +Notes: -

-Notes for power kernel users: - + \ No newline at end of file diff --git a/src/help_en_power.html b/src/help_en_power.html new file mode 100644 index 0000000..8e07500 --- /dev/null +++ b/src/help_en_power.html @@ -0,0 +1,15 @@ +

QCPUFreq Help

+ +This application allows you to adjust your maximum CPU speed. +

+This enables you to overclock your CPU easily, but of course you can also underclock the CPU if desired. Underclocking might save some battery power if you are running applications like emulators, which cause your CPU to always run at full speed when it is really not required. Please note that lowering the maximum CPU frequency does not always save battery power and is not always the best choice! +

+ +
+Notes: + diff --git a/src/helpwindow.cpp b/src/helpwindow.cpp index 972ad92..ec5b1c5 100644 --- a/src/helpwindow.cpp +++ b/src/helpwindow.cpp @@ -18,6 +18,7 @@ #include "helpwindow.h" #include "ui_helpwindow.h" +#include "settings.h" #include #include @@ -52,14 +53,24 @@ void HelpWindow::setHelpText() locale = tmp.first(); QString path = HELPPATH; + Settings settings; + QString suffix; + + //determine if we need to display the help file for power kernel users + if (settings.usePowerKernel()) { + suffix = "_power.html"; + } else + { + suffix = ".html"; + } //open help text - QFile help( path+"help_" + locale + ".html" ); + QFile help( path + "help_" + locale + suffix ); //open the file if ( !help.exists() || !help.open( QIODevice::ReadOnly ) ) { //try to open the file in english language instead - help.setFileName( path+"help_en.html" ); + help.setFileName( path + "help_en" + suffix ); if ( !help.exists() || !help.open( QIODevice::ReadOnly ) ) { QMessageBox::critical(this, tr("QCPUFreq"), tr("Cannot open help file!")); return; diff --git a/src/src.pro b/src/src.pro index 8cd94ed..3ccb09d 100644 --- a/src/src.pro +++ b/src/src.pro @@ -77,7 +77,7 @@ unix { locale_zh.files += zh.qm help_zh.html help_en.path = /opt/usr/share/qcpufreq - help_en.files += help_en.html + help_en.files += help_en.html help_en_power.html } -- 1.7.9.5