Added a help viewer
authorDaniel Klaffenbach <danielklaffenbach@gmail.com>
Sun, 27 Jun 2010 08:00:40 +0000 (10:00 +0200)
committerDaniel Klaffenbach <danielklaffenbach@gmail.com>
Sun, 27 Jun 2010 08:00:40 +0000 (10:00 +0200)
src/de.qm
src/de.ts
src/help_de.html [new file with mode: 0644]
src/help_en.html
src/helpwindow.cpp
src/helpwindow.ui
src/main.cpp
src/mainwindow.cpp
src/mainwindow.ui
src/resources.qrc

index af4c0d9..c06e9a4 100644 (file)
Binary files a/src/de.qm and b/src/de.qm differ
index bd2f36e..d51522c 100644 (file)
--- a/src/de.ts
+++ b/src/de.ts
@@ -2,10 +2,29 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="de_DE" sourcelanguage="en_US">
 <context>
+    <name>HelpWindow</name>
+    <message>
+        <location filename="helpwindow.ui" line="14"/>
+        <source>Help</source>
+        <translation>Hilfe</translation>
+    </message>
+    <message>
+        <location filename="helpwindow.cpp" line="56"/>
+        <source>QCPUFreq</source>
+        <translation>QCPUFreq</translation>
+    </message>
+    <message>
+        <location filename="helpwindow.cpp" line="56"/>
+        <source>Cannot open help file!</source>
+        <translation>Kann die Hilfe-Datei nicht öffnen!</translation>
+    </message>
+</context>
+<context>
     <name>MainWindow</name>
     <message>
         <location filename="mainwindow.ui" line="14"/>
-        <location filename="mainwindow.cpp" line="218"/>
+        <location filename="mainwindow.cpp" line="141"/>
+        <location filename="mainwindow.cpp" line="270"/>
         <source>QCPUFreq</source>
         <translation>QCPUFreq</translation>
     </message>
@@ -19,7 +38,7 @@
         <location filename="mainwindow.ui" line="55"/>
         <location filename="mainwindow.ui" line="69"/>
         <location filename="mainwindow.ui" line="83"/>
-        <location filename="mainwindow.cpp" line="107"/>
+        <location filename="mainwindow.cpp" line="156"/>
         <source>Unknown</source>
         <translation>Unbekannt</translation>
     </message>
@@ -45,9 +64,9 @@
     </message>
     <message>
         <location filename="mainwindow.ui" line="109"/>
-        <location filename="mainwindow.cpp" line="260"/>
-        <source>Disabled</source>
-        <translation>Deaktiviert</translation>
+        <source>Enable</source>
+        <oldsource>Disabled</oldsource>
+        <translation>Aktivieren</translation>
     </message>
     <message>
         <location filename="mainwindow.ui" line="306"/>
         <translation>Datei</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="342"/>
+        <location filename="mainwindow.ui" line="343"/>
         <source>About</source>
         <translation>Über</translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="218"/>
+        <location filename="mainwindow.ui" line="348"/>
+        <source>Help</source>
+        <translation>Hilfe</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="141"/>
+        <source>There seems to be a problem with your sudo setup!</source>
+        <translation>Es liegt offenbar ein Problem bei der sudo Einrichtung vor!</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="270"/>
         <source>Could not get information from /sys!</source>
         <translation>Konnte Informationen aus /sys nicht lesen!</translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="257"/>
         <source>Enabled</source>
-        <translation>Aktiviert</translation>
+        <translation type="obsolete">Aktiviert</translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="325"/>
+        <location filename="mainwindow.cpp" line="373"/>
         <source>SmartReflex support is known to be unstable on some devices and may cause random reboots.</source>
         <translation>SmartReflex kann auf einigen Geräten instabil sein und zu zufälligen Neustarts führen.</translation>
     </message>
diff --git a/src/help_de.html b/src/help_de.html
new file mode 100644 (file)
index 0000000..f840738
--- /dev/null
@@ -0,0 +1,16 @@
+<h1>QCPUFreq Hilfe</h1>
+
+Dieses Programm erm&ouml;glicht es die maximale CPU Geschwindigkeit herabzusetzen.
+<br><br>
+Das kann besonders bei Anwendungen n&uuml;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&auml;ufig zum Einsatz kommen, kann man relativ viel Akku-Leistung sparen. Jedoch kann nicht in allen F&auml;llen Akku gespart werden!
+<hr>
+WICHTIG:
+<ul>
+ <li>Alle &Auml;nderungen sind <strong>NICHT dauerhaft</strong><br>
+ Wenn die CPU Frequenz oder die SmartReflex™ Einstellungen dauerhaft ge&auml;ndert werden sollen, muss die Datei <em>/etc/pmconfig</em> angepasst werden. &Auml;ndern Sie diese Datei nur, wenn Sie genau wissen, was Sie machen!
+ </li>
+ <li>Nachdem das Akku-Ladeger&auml;t herausgezogen wird, verwendet die CPU wieder die Systemeinstellung f&uuml;r die maximaler Geschwindigkeit. Verwenden Sie nach dem Aufladen QCPUFreq, um diese wieder herabzusetzen!</li>
+ <li>SmartReflex™ ist auf einigen Ger&auml;ten instabil und kann zu zuf&auml;lligen Neustarts f&uuml;hren.</li>
+ <li>Ab PR 1.2 hat Nokia "VDD2 SR" deaktiviert, um das Ger&auml;t stabiler zu machen. Aus diesem Grund aktiviert QCPUFreq auf neueren Firmwareversionen nur VDD1 SmartReflex™.</li>
+ <li>Es kann vorkommen, dass als Wert f&uuml;r die CPU-Temperatur "0" angezeigt wird. Es handelt sich hierbei um ein Kernel-Problem und stellt keine Fehlfunktion dieses Programmes dar.</li>
+</ul>
index 767c67c..c0cd4b0 100644 (file)
@@ -2,6 +2,15 @@
 
 This application allows you to lower your maximum CPU speed.
 <br><br>
-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!
 <hr>
-fsd
+IMPORTANT:
+<ul>
+ <li>Changes are <strong>NON-permanent</strong><br>
+ 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!
+ </li>
+ <li>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!</li>
+ <li>SmartReflex™ is known to be unstable on some devices and may cause random reboots.</li>
+ <li>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.</li>
+ <li>The value of the CPU temperature might sometimes be "0". This is actually a kernel problem and not a bug in QCPUFreq.</li>
+</ul>
index a4d2a3a..37870fe 100644 (file)
@@ -5,6 +5,9 @@
 #include <QLocale>
 #include <QTextStream>
 #include <QMessageBox>
+#include <QPalette>
+#include <QBrush>
+#include <QColor>
 
 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 );
 }
index bfd7e2e..3619ded 100644 (file)
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
-    <widget class="QTextEdit" name="textEdit">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
+    <widget class="QTextBrowser" name="textBrowser">
      <property name="styleSheet">
-      <string notr="true">background: transparent;</string>
+      <string notr="true"/>
      </property>
      <property name="frameShape">
       <enum>QFrame::NoFrame</enum>
      </property>
-     <property name="frameShadow">
-      <enum>QFrame::Plain</enum>
-     </property>
      <property name="horizontalScrollBarPolicy">
       <enum>Qt::ScrollBarAlwaysOff</enum>
      </property>
-     <property name="readOnly">
-      <bool>true</bool>
-     </property>
     </widget>
    </item>
   </layout>
index 31872a6..b17d5b4 100755 (executable)
@@ -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 );
index dcc6f7a..919292c 100755 (executable)
@@ -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()
index eaf6ca2..05775bf 100755 (executable)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>699</width>
-    <height>619</height>
+    <width>469</width>
+    <height>636</height>
    </rect>
   </property>
   <property name="windowTitle">
           <item row="4" column="1">
            <widget class="QCheckBox" name="sr_box">
             <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="text">
-             <string>Enable SR</string>
+             <string>Enable</string>
             </property>
            </widget>
           </item>
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>699</width>
+     <width>469</width>
      <height>21</height>
     </rect>
    </property>
index d897943..1d3667c 100644 (file)
@@ -5,5 +5,6 @@
     </qresource>
     <qresource prefix="/txt">
         <file alias="help_en">help_en.html</file>
+        <file alias="help_de">help_de.html</file>
     </qresource>
 </RCC>