* New upstream release.
authorgregor herrmann <gregoa@debian.org>
Sat, 10 Mar 2007 01:27:07 +0000 (01:27 -0000)
committergregor herrmann <gregoa@debian.org>
Sat, 10 Mar 2007 01:27:07 +0000 (01:27 -0000)
ChangeLog
debian/changelog
main.cpp
qteleschorsch.pro
qteleschorsch_de.ts
qteleschorsch_fr.ts
teleschorsch.png

index c627b16645f580647dc17db9b87bcb99b107944b..a821c5ffc940d9c32524b7f4cf7c6f0a736a26d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,50 @@
 ------------------------------------------------------------------------
+r447 | philipp | 2007-03-09 23:42:31 +0100 (Fri, 09 Mar 2007) | 2 lines
+Changed paths:
+   M /teleschorsch/trunk/main.cpp
+   M /teleschorsch/trunk/qteleschorsch.pro
+   M /teleschorsch/trunk/qteleschorsch_de.ts
+   M /teleschorsch/trunk/qteleschorsch_fr.ts
+
+Implemented --help.
+
+------------------------------------------------------------------------
+r446 | philipp | 2007-03-09 21:53:29 +0100 (Fri, 09 Mar 2007) | 2 lines
+Changed paths:
+   M /teleschorsch/trunk/main.cpp
+
+Make first row selected after starup (only a small change)
+
+------------------------------------------------------------------------
+r445 | philipp | 2007-03-09 19:42:32 +0100 (Fri, 09 Mar 2007) | 7 lines
+Changed paths:
+   M /teleschorsch/trunk/main.cpp
+   M /teleschorsch/trunk/qteleschorsch_de.ts
+   M /teleschorsch/trunk/qteleschorsch_fr.ts
+   M /teleschorsch/trunk/teleschorsch.png
+   A /teleschorsch/trunk/teleschorsch.svg
+   M /teleschorsch/trunk/teleschorsch.xcf
+
+- Changed the icon. The background was created with inkscape, the fine-tuning was done with gimp.
+  The original image of Georg was dscf1950.jpg for the wedding 2006-10-07. :-)
+- Used QProcess::startDetached instead of QProcess::start so that qteleschorsch responds during playing (among other advantages)
+- Used QDir::homePath() to get the home directory instead of system variables
+- Used int row = lwChannels->row(selectedChannel); to play the selected channel (as it was before)
+  but fixed the previous error (now it is "if (row >= 0)" instead of "if (row > 0)").
+
+------------------------------------------------------------------------
+r444 | gregoa | 2007-03-09 12:15:46 +0100 (Fri, 09 Mar 2007) | 1 line
+Changed paths:
+   M /teleschorsch/trunk/main.cpp
+
+gmplayer need -cache and not --cache
+------------------------------------------------------------------------
+r443 | gregoa | 2007-03-09 11:57:52 +0100 (Fri, 09 Mar 2007) | 1 line
+Changed paths:
+   M /teleschorsch/trunk/main.cpp
+
+play only selected channel (selectedItems instead of currentRow) and play also the first
+------------------------------------------------------------------------
 r442 | gregoa | 2007-03-09 00:35:45 +0100 (Fri, 09 Mar 2007) | 1 line
 Changed paths:
    M /teleschorsch/trunk/teleschorschrc
index a18d7c5f2c64c7a735f531500b1e63e92381e7f3..e4691348025a0a73917bdfdf032450071aa0b779 100644 (file)
@@ -1,3 +1,9 @@
+teleschorsch (0.1.5-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian@comodo.priv.at>  Sat, 10 Mar 2007 02:26:38 +0100
+
 teleschorsch (0.1.4-1) unstable; urgency=low
 
   * New upstream release.
index 88292b8e9a11ef24d724620935e808a79f5faf7b..e277c6fbc59699cf39899d02efaf95a7187dc71f 100644 (file)
--- a/main.cpp
+++ b/main.cpp
 #include <QMessageBox>
 #include <QDateTime>
 #include <QLocale>
+#include <QDir>
 #include <QTranslator>
+
+#include <iostream> // for help output
+#include <string>   // for help output
+
 #include "main.h"
 #include "options.h"
 
 
+
 // Functions
 // =========
 
 void initConfigInfo(ConfigInfo& configInfo) {
-       QStringList environment = QProcess::systemEnvironment().filter(QRegExp("^HOME=")); // ("HOME=/home/gregoa")
-       if (environment.size() == 1) {
-               configInfo.home = environment.at(0).mid(5);
-               configInfo.userConfigFile = configInfo.home + + "/.teleschorschrc";
-       }
+       configInfo.userConfigFile = QDir::homePath() + "/.teleschorschrc";
        configInfo.systemConfigFile = "/etc/teleschorschrc";
 
        // User config file
@@ -215,18 +217,27 @@ bool evaluateStaticUrl(const QString& staticUrl, QDate date, QString& result, QS
 }
 
 
-void appendPlayerOffsetOption(const QString& player, QTime offset, QStringList& arguments) {
+void appendPlayerOptions(const QString& player, QTime offset, QStringList& arguments) {
        QTime zero = QTime(0, 0, 0, 0);
        int offsetSec = zero.secsTo(offset);
-       if (player.indexOf("vlc") != -1) arguments.append("--start-time");
-       if (player.indexOf("gmplayer") != -1) {
-               arguments << "-cache" << "512"; // -cache 512 does not belong to this function but for now...
+       if (player.contains("vlc")) arguments.append("--start-time");
+       if (player.contains("gmplayer")) {
+               arguments << "-cache" << "512";
+               arguments << "-prefer-ipv4";    // -"- avoids IPV6 error message
                arguments << "-ss"; 
        }
        arguments << QString::number(offsetSec);
 }
 
 
+void showHelp() {
+       // Isn't there a way to output QStrings directly?
+       std::cout << QObject::tr("Usage: qteleschorsch [options]").toStdString() << std::endl
+       << QObject::tr("Options: --help: Shows this message at the command line and exits qteleschorsch").toStdString() << std::endl
+       << QObject::tr("More help: man qteleschorsch").toStdString() << std::endl;
+}
+
+
 
 // MainDialog
 // ==========
@@ -267,15 +278,18 @@ void MainDialog::editOptions() {
 
 
 void MainDialog::updateLwChannels() {
+       int row = lwChannels->currentRow(); // remember selected row
        lwChannels->clear();
        for (int i = 0; i != channelVec.size(); ++i) lwChannels->addItem(channelVec[i].fullName);
+       if (row > lwChannels->count()) row = lwChannels->count()-1; // set to last row. if count==0, row gets -1.
+       if (row == -1 && lwChannels->count() > 0) row = 0; // set to first if nothing was selected previously.
+       if (row != -1) lwChannels->setCurrentRow(row);
 }
 
 
 bool MainDialog::startAction() {
-       QListWidgetItem* selectedChannel = lwChannels->selectedItems().at(0);
-       int row = lwChannels->row(selectedChannel);
-       if (row > -1) {
+       int row = lwChannels->currentRow();
+       if (row >= 0) {
                Channel channel = channelVec[row];
                QDate date = calDate->selectedDate();
                QString substUrl;
@@ -286,11 +300,10 @@ bool MainDialog::startAction() {
                }
                QStringList arguments;
                arguments.append(substUrl);
-               appendPlayerOffsetOption(channel.player, teOffset->time(), arguments);
+               appendPlayerOptions(channel.player, teOffset->time(), arguments);
                QProcess player(this);
                qDebug() << channel.player << arguments;
-               player.start(channel.player, arguments);
-               player.waitForFinished(-1);
+               player.startDetached(channel.player, arguments);
                return true;
        }
        return false;
@@ -303,10 +316,19 @@ bool MainDialog::startAction() {
 
 int main(int argc, char *argv[]) {
        QApplication app(argc, argv);
+
+       // Initialize translation
        QString locale = QLocale::system().name();
        QTranslator translator;
        translator.load(QString(":/qteleschorsch_") + locale);
        app.installTranslator(&translator);
+
+       // Parse command line options
+       if (app.arguments().size() > 1) {
+               showHelp();
+               return 0;
+       }
+
        MainDialog *mainDialog = new MainDialog();
        mainDialog->show();
        return app.exec();
index eb85fff36098fd5a9d20b0fb022fb4346e43d6c6..70d3963a2a21b091864375eec59d3878234e8a96 100644 (file)
@@ -1,7 +1,4 @@
 TEMPLATE = app
-# TARGET = 
-# DEPENDPATH += .
-# INCLUDEPATH += .
 
 # Input
 FORMS += maindialog.ui options.ui
@@ -9,6 +6,7 @@ HEADERS += main.h options.h
 SOURCES += main.cpp options.cpp
 TRANSLATIONS = qteleschorsch_de.ts qteleschorsch_fr.ts
 RESOURCES = qteleschorsch.qrc
+CONFIG += stl
 PRE_TARGETDEPS = compiler_translation_make_all
 
 translation.output  = ${QMAKE_FILE_BASE}.qm
index 7d84170f7cf8eab23f6375f50ea26450f3e199ed..17a36e8f3b87ed793808622d8b22077da8a5a43a 100644 (file)
@@ -3,12 +3,12 @@
 <context>
     <name>MainDialog</name>
     <message>
-        <location filename="main.cpp" line="262"/>
+        <location filename="main.cpp" line="273"/>
         <source>Problem when reading the configuration file</source>
         <translation>Die Konfigurationsdatei konnte nicht gelesen werden</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="283"/>
+        <location filename="main.cpp" line="298"/>
         <source>Problem when substituting URL</source>
         <translation>Problem beim Ersetzen der Parameter in der URL</translation>
     </message>
         <translation>TeleSchorsch</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="41"/>
+        <location filename="maindialog.ui" line="44"/>
         <source>Channel</source>
         <translation>Programm/Kanal</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="74"/>
+        <location filename="maindialog.ui" line="77"/>
         <source>Date</source>
         <translation>Datum</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="96"/>
+        <location filename="maindialog.ui" line="99"/>
         <source>Offset</source>
         <translation>Offset</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="135"/>
+        <location filename="maindialog.ui" line="138"/>
         <source>Options</source>
         <translation>Optionen</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="155"/>
+        <location filename="maindialog.ui" line="158"/>
         <source>Start</source>
         <translation>Start</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="165"/>
+        <location filename="maindialog.ui" line="168"/>
         <source>Quit</source>
         <translation>Beenden</translation>
     </message>
         <translation>TeleSchorsch Programm/Kanal-Konfiguration</translation>
     </message>
     <message>
-        <location filename="options.ui" line="72"/>
+        <location filename="options.ui" line="75"/>
         <source>Save</source>
         <translation>Speichern</translation>
     </message>
     <message>
-        <location filename="options.ui" line="82"/>
+        <location filename="options.ui" line="85"/>
         <source>Cancel</source>
         <translation>Abbrechen</translation>
     </message>
     <message>
-        <location filename="options.ui" line="41"/>
+        <location filename="options.ui" line="44"/>
         <source>You may use the following special characters:</source>
         <translation>Folgende Variablen sind erlaubt:</translation>
     </message>
 <context>
     <name>QObject</name>
     <message>
-        <location filename="main.cpp" line="62"/>
+        <location filename="main.cpp" line="64"/>
         <source>Could not open file %1</source>
         <translation>Konnte Datei %1 nicht öffnen</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="84"/>
+        <location filename="main.cpp" line="86"/>
         <source>Property %1 is only allowed in a [section].</source>
         <translation>Bezeichner %1 darf nur in einer [sektion] verwendet werden.</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="89"/>
+        <location filename="main.cpp" line="91"/>
         <source>Unknown key in ini file: %1</source>
         <translation>Unbekannter Bezeichner in ini-Datei: %1</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="92"/>
+        <location filename="main.cpp" line="94"/>
         <source>Line %1 is not valid.</source>
         <translation>Zeile %1 hat eine ungültige Syntax.</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="100"/>
+        <location filename="main.cpp" line="102"/>
         <source>Neither %1 nor %2 found.</source>
         <translation>Weder %1 noch %2 gefunden.</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="129"/>
+        <location filename="main.cpp" line="131"/>
         <source>No match for variable %1</source>
         <translation>Die Variable %1 existiert nicht</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="160"/>
+        <location filename="main.cpp" line="162"/>
         <source>${ not closed with }.</source>
         <translation>${ wurde nicht mit } abgeschlossen.</translation>
     </message>
     <message>
-        <location filename="main.cpp" line="187"/>
+        <location filename="main.cpp" line="189"/>
         <source>Shell command executed when substituting URL (%1) timed out.</source>
         <translation>Der Befehl zur Ersetzung der URL (%1) hat zu lange gebraucht (time out).</translation>
     </message>
+    <message>
+        <location filename="main.cpp" line="235"/>
+        <source>Usage: qteleschorsch [options]</source>
+        <translation>Aufruf: qteleschorsch [Optionen]</translation>
+    </message>
+    <message>
+        <location filename="main.cpp" line="236"/>
+        <source>Options: --help: Shows this message at the command line and exits qteleschorsch</source>
+        <translation>Optionen: --help: Zeigt diese Meldung in der Eingabeaufforderung und beendet qteleschorsch</translation>
+    </message>
+    <message>
+        <location filename="main.cpp" line="237"/>
+        <source>More help: man qteleschorsch</source>
+        <translation>Mehr Hilfe: man qteleschorsch</translation>
+    </message>
 </context>
 </TS>
index b49575e2bdfa08c4d14c80eae1fea688b823d85b..067ca38e088b4419c886668be328c782a87aa361 100644 (file)
@@ -3,12 +3,12 @@
 <context>
     <name>MainDialog</name>
     <message>
-        <location filename="main.cpp" line="262"/>
+        <location filename="main.cpp" line="273"/>
         <source>Problem when reading the configuration file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="283"/>
+        <location filename="main.cpp" line="298"/>
         <source>Problem when substituting URL</source>
         <translation type="unfinished"></translation>
     </message>
         <translation>TeleSchorsch</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="41"/>
+        <location filename="maindialog.ui" line="44"/>
         <source>Channel</source>
-        <translation>Chaîne</translation>
+        <translation>Chae</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="74"/>
+        <location filename="maindialog.ui" line="77"/>
         <source>Date</source>
         <translation>Date</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="96"/>
+        <location filename="maindialog.ui" line="99"/>
         <source>Offset</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="135"/>
+        <location filename="maindialog.ui" line="138"/>
         <source>Options</source>
         <translation>Options</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="155"/>
+        <location filename="maindialog.ui" line="158"/>
         <source>Start</source>
         <translation>Démarrer</translation>
     </message>
     <message>
-        <location filename="maindialog.ui" line="165"/>
+        <location filename="maindialog.ui" line="168"/>
         <source>Quit</source>
         <translation>Terminer</translation>
     </message>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="options.ui" line="72"/>
+        <location filename="options.ui" line="75"/>
         <source>Save</source>
         <translation>Sauvegarder</translation>
     </message>
     <message>
-        <location filename="options.ui" line="82"/>
+        <location filename="options.ui" line="85"/>
         <source>Cancel</source>
         <translation>Annuler</translation>
     </message>
     <message>
-        <location filename="options.ui" line="41"/>
+        <location filename="options.ui" line="44"/>
         <source>You may use the following special characters:</source>
         <translation type="unfinished"></translation>
     </message>
 <context>
     <name>QObject</name>
     <message>
-        <location filename="main.cpp" line="62"/>
+        <location filename="main.cpp" line="64"/>
         <source>Could not open file %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="84"/>
+        <location filename="main.cpp" line="86"/>
         <source>Property %1 is only allowed in a [section].</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="89"/>
+        <location filename="main.cpp" line="91"/>
         <source>Unknown key in ini file: %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="92"/>
+        <location filename="main.cpp" line="94"/>
         <source>Line %1 is not valid.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="100"/>
+        <location filename="main.cpp" line="102"/>
         <source>Neither %1 nor %2 found.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="129"/>
+        <location filename="main.cpp" line="131"/>
         <source>No match for variable %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="160"/>
+        <location filename="main.cpp" line="162"/>
         <source>${ not closed with }.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="main.cpp" line="187"/>
+        <location filename="main.cpp" line="189"/>
         <source>Shell command executed when substituting URL (%1) timed out.</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="main.cpp" line="235"/>
+        <source>Usage: qteleschorsch [options]</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="main.cpp" line="236"/>
+        <source>Options: --help: Shows this message at the command line and exits qteleschorsch</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="main.cpp" line="237"/>
+        <source>More help: man qteleschorsch</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>
index b47a974a860bf5c602b11547ffdeb47aada81918..1aab63a787492c46dd2a627c7c02a16278ffbe0f 100644 (file)
Binary files a/teleschorsch.png and b/teleschorsch.png differ