From 26a1975c3bd5f009c67d46fe18921eb3db5ffa83 Mon Sep 17 00:00:00 2001 From: Daniel Klaffenbach Date: Sun, 27 Jun 2010 10:00:40 +0200 Subject: [PATCH] Added a help viewer --- src/de.qm | Bin 1469 -> 1905 bytes src/de.ts | 48 ++++++++++++++++++++++++++++++++++++++---------- src/help_de.html | 16 ++++++++++++++++ src/help_en.html | 13 +++++++++++-- src/helpwindow.cpp | 13 ++++++++++++- src/helpwindow.ui | 16 ++-------------- src/main.cpp | 2 ++ src/mainwindow.cpp | 1 + src/mainwindow.ui | 10 +++++----- src/resources.qrc | 1 + 10 files changed, 88 insertions(+), 32 deletions(-) create mode 100644 src/help_de.html diff --git a/src/de.qm b/src/de.qm index af4c0d9a16b7e8bcbb8006c17a09a14fd75a5b86..c06e9a457c6ee971e6a339ecc8c28a6af310f996 100644 GIT binary patch delta 607 zcmZ`#JxE(o6#jDa67yo~P*TC|2I?r(I*6mxptM6piejB!%uVv@%e(2zdyy0&v~(zi zit?bdpty^hAe17si_*QgI1AFn!9n`n7l3k(ZRKCEMv_JF{Dv`v;7g3z!?t6KQ%qdK$## zBw}u7Mv<%((blv|Nk+iGce9B3HTv6(26s1`!1(LB3Y2Uq)o963%d(P=YzCTpG~~J) Y)@4UWfow$;O;Q*&iyVG9{*;;e2mgPEod5s; delta 239 zcmey!x0ic@NPPhV%LP>i2FCvk?$eGifWY)=EI@u2lj!0`AWw%iy6GPS19Jz5kqZ}4 zT#F;}?nDL#rfZx+d0s%eku&QYh}PkJ6#WaRj+ZOHCW?W9Wetz}q%T1A$9aOn`hff| zeD5a%?~1@j4}$!6@<01(MIdH?_b diff --git a/src/de.ts b/src/de.ts index bd2f36e..d51522c 100644 --- a/src/de.ts +++ b/src/de.ts @@ -2,10 +2,29 @@ + HelpWindow + + + Help + Hilfe + + + + QCPUFreq + QCPUFreq + + + + Cannot open help file! + Kann die Hilfe-Datei nicht öffnen! + + + MainWindow - + + QCPUFreq QCPUFreq @@ -19,7 +38,7 @@ - + Unknown Unbekannt @@ -45,9 +64,9 @@ - - Disabled - Deaktiviert + Enable + Disabled + Aktivieren @@ -60,22 +79,31 @@ Datei - + About Über - + + Help + Hilfe + + + + There seems to be a problem with your sudo setup! + Es liegt offenbar ein Problem bei der sudo Einrichtung vor! + + + Could not get information from /sys! Konnte Informationen aus /sys nicht lesen! - Enabled - Aktiviert + Aktiviert - + SmartReflex support is known to be unstable on some devices and may cause random reboots. SmartReflex kann auf einigen Geräten instabil sein und zu zufälligen Neustarts führen. diff --git a/src/help_de.html b/src/help_de.html new file mode 100644 index 0000000..f840738 --- /dev/null +++ b/src/help_de.html @@ -0,0 +1,16 @@ +

QCPUFreq Hilfe

+ +Dieses Programm ermöglicht es die maximale CPU Geschwindigkeit herabzusetzen. +

+Das kann besonders bei Anwendungen nützlich sein, die stets die CPU dazu veranlassen, mit maximaler Geschwindigkeit zu laufen, obwohl es nicht notwendig ist (zum Beispiel Emulatoren). Falls solche Anwendungen häufig zum Einsatz kommen, kann man relativ viel Akku-Leistung sparen. Jedoch kann nicht in allen Fällen Akku gespart werden! +
+WICHTIG: +
    +
  • Alle Änderungen sind NICHT dauerhaft
    + Wenn die CPU Frequenz oder die SmartReflex™ Einstellungen dauerhaft geändert werden sollen, muss die Datei /etc/pmconfig angepasst werden. Ändern Sie diese Datei nur, wenn Sie genau wissen, was Sie machen! +
  • +
  • Nachdem das Akku-Ladegerät herausgezogen wird, verwendet die CPU wieder die Systemeinstellung für die maximaler Geschwindigkeit. Verwenden Sie nach dem Aufladen QCPUFreq, um diese wieder herabzusetzen!
  • +
  • SmartReflex™ ist auf einigen Geräten instabil und kann zu zufälligen Neustarts führen.
  • +
  • Ab PR 1.2 hat Nokia "VDD2 SR" deaktiviert, um das Gerät stabiler zu machen. Aus diesem Grund aktiviert QCPUFreq auf neueren Firmwareversionen nur VDD1 SmartReflex™.
  • +
  • Es kann vorkommen, dass als Wert für die CPU-Temperatur "0" angezeigt wird. Es handelt sich hierbei um ein Kernel-Problem und stellt keine Fehlfunktion dieses Programmes dar.
  • +
diff --git a/src/help_en.html b/src/help_en.html index 767c67c..c0cd4b0 100644 --- a/src/help_en.html +++ b/src/help_en.html @@ -2,6 +2,15 @@ This application allows you to lower your maximum CPU speed.

-You only need to +This might be useful for some applications (like emulators), which cause your CPU to always run at full speed when it is really not required. You can save quite a lot of battery power if you use such applications frequently. Please note that you won't always be able to save battery power!
-fsd +IMPORTANT: +
    +
  • Changes are NON-permanent
    + If you want to permanently change your CPU frequency or SmartReflex™ settings, you need to edit /etc/pmconfig. Only edit this file if you know what you are doing! +
  • +
  • After unplugging the charger from your device the CPU will always use the full maximum speed setting. Use QCPUFreq after charging for lowering the speed again!
  • +
  • SmartReflex™ is known to be unstable on some devices and may cause random reboots.
  • +
  • Starting with PR 1.2, Nokia has disabled "VDD2 SR" in order to make the device more stable. This is why QCPUFreq only enables VDD1 SmartReflex™ on newer firmwares.
  • +
  • The value of the CPU temperature might sometimes be "0". This is actually a kernel problem and not a bug in QCPUFreq.
  • +
diff --git a/src/helpwindow.cpp b/src/helpwindow.cpp index a4d2a3a..37870fe 100644 --- a/src/helpwindow.cpp +++ b/src/helpwindow.cpp @@ -5,6 +5,9 @@ #include #include #include +#include +#include +#include HelpWindow::HelpWindow(QWidget *parent) : QWidget(parent), @@ -18,8 +21,14 @@ HelpWindow::HelpWindow(QWidget *parent) : setHelpText(); + //format color of help text according to system color scheme + QPalette palette; + QBrush brush = palette.windowText(); + QColor color = brush.color(); + ui->textBrowser->setStyleSheet( "background: transparent; color: " + color.name() + ";" ); } + HelpWindow::~HelpWindow() { delete ui; @@ -33,6 +42,8 @@ void HelpWindow::setHelpText() { //get the current locale name for lacalized help messages QString locale = QLocale::system().name(); + QStringList tmp = locale.split("_"); + locale = tmp.first(); //open help text QFile help( ":/txt/help_" + locale ); @@ -55,5 +66,5 @@ void HelpWindow::setHelpText() txt += "\n"; } while ( !in.atEnd() ); - ui->textEdit->setText( txt ); + ui->textBrowser->setText( txt ); } diff --git a/src/helpwindow.ui b/src/helpwindow.ui index bfd7e2e..3619ded 100644 --- a/src/helpwindow.ui +++ b/src/helpwindow.ui @@ -15,28 +15,16 @@ - - - - 0 - 0 - - + - background: transparent; + QFrame::NoFrame - - QFrame::Plain - Qt::ScrollBarAlwaysOff - - true - diff --git a/src/main.cpp b/src/main.cpp index 31872a6..b17d5b4 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); QString locale = QLocale::system().name(); + QStringList tmp = locale.split("_"); + locale = tmp.first(); QString localedir = "/opt/usr/share/qcpufreq"; QTranslator translator; translator.load( locale, localedir ); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dcc6f7a..919292c 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -76,6 +76,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged())); connect(ui->sr_box, SIGNAL(clicked()), this, SLOT(setSmartReflex())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh())); + } MainWindow::~MainWindow() diff --git a/src/mainwindow.ui b/src/mainwindow.ui index eaf6ca2..05775bf 100755 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 699 - 619 + 469 + 636 @@ -100,13 +100,13 @@ - + 0 0 - Enable SR + Enable @@ -325,7 +325,7 @@ 0 0 - 699 + 469 21 diff --git a/src/resources.qrc b/src/resources.qrc index d897943..1d3667c 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -5,5 +5,6 @@ help_en.html + help_de.html -- 1.7.9.5