Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #282

  • Loading branch information...
commit e3ddd45cbb1609507b34cb8573f35d89c51dfd3d 1 parent 9ae32d4
Daniel Kabel authored
View
11 MediaElch.pro
@@ -129,7 +129,9 @@ SOURCES += main.cpp\
settings/AdvancedSettings.cpp \
smallWidgets/AlphabeticalList.cpp \
smallWidgets/MyTableView.cpp \
- data/ImageCache.cpp
+ data/ImageCache.cpp \
+ scrapers/TvTunes.cpp \
+ tvShows/TvTunesDialog.cpp
HEADERS += main/MainWindow.h \
movies/Movie.h \
@@ -233,7 +235,9 @@ HEADERS += main/MainWindow.h \
settings/AdvancedSettings.h \
smallWidgets/AlphabeticalList.h \
smallWidgets/MyTableView.h \
- data/ImageCache.h
+ data/ImageCache.h \
+ scrapers/TvTunes.h \
+ tvShows/TvTunesDialog.h
FORMS += main/MainWindow.ui \
movies/MovieSearch.ui \
@@ -268,7 +272,8 @@ FORMS += main/MainWindow.ui \
movies/MovieMultiScrapeDialog.ui \
smallWidgets/TagCloud.ui \
tvShows/TvShowWidgetSeason.ui \
- renamer/Renamer.ui
+ renamer/Renamer.ui \
+ tvShows/TvTunesDialog.ui
RESOURCES += \
MediaElch.qrc
View
11 data/TvShow.cpp
@@ -31,6 +31,7 @@ TvShow::TvShow(QString dir, QObject *parent) :
m_showId = ++m_idCounter;
m_databaseId = -1;
m_syncNeeded = false;
+ m_hasTune = false;
}
/**
@@ -1459,6 +1460,16 @@ void TvShow::removeImage(ImageType type, int season)
setChanged(true);
}
+void TvShow::setHasTune(bool hasTune)
+{
+ m_hasTune = hasTune;
+}
+
+bool TvShow::hasTune() const
+{
+ return m_hasTune;
+}
+
/*** DEBUG ***/
QDebug operator<<(QDebug dbg, const TvShow &show)
View
3  data/TvShow.h
@@ -92,6 +92,7 @@ class TvShow : public QObject
int databaseId() const;
bool syncNeeded() const;
QList<int> infosToLoad() const;
+ bool hasTune() const;
void setName(QString name);
void setShowTitle(QString title);
@@ -128,6 +129,7 @@ class TvShow : public QObject
void setNfoContent(QString content);
void setDatabaseId(int id);
void setSyncNeeded(bool syncNeeded);
+ void setHasTune(bool hasTune);
void removeActor(Actor *actor);
void removeGenre(QString genre);
@@ -210,6 +212,7 @@ class TvShow : public QObject
bool m_logoImageChanged;
bool m_clearArtImageChanged;
bool m_characterArtImageChanged;
+ bool m_hasTune;
QMap<int, QByteArray> m_seasonPosterImages;
QList<int> m_seasonPosterImagesChanged;
QMap<int, QByteArray> m_seasonBackdropImages;
View
7 globals/Manager.cpp
@@ -53,6 +53,8 @@ Manager::Manager(QObject *parent) :
m_trailerProviders.append(new MovieMaze(this));
m_trailerProviders.append(new HdTrailers(this));
+
+ m_tvTunes = new TvTunes(this);
}
/**
@@ -287,3 +289,8 @@ QList<TrailerProvider*> Manager::trailerProviders()
{
return m_trailerProviders;
}
+
+TvTunes* Manager::tvTunes()
+{
+ return m_tvTunes;
+}
View
3  globals/Manager.h
@@ -18,6 +18,7 @@
#include "data/TvShowProxyModel.h"
#include "imageProviders/FanartTv.h"
#include "main/FileScannerDialog.h"
+#include "scrapers/TvTunes.h"
#include "trailerProviders/TrailerProvider.h"
#include "tvShows/TvShowFilesWidget.h"
@@ -55,6 +56,7 @@ class Manager : public QObject
ScraperInterface* getScraperForName(QString name);
FanartTv* fanartTv();
TvShowFilesWidget *tvShowFilesWidget();
+ TvTunes* tvTunes();
void setTvShowFilesWidget(TvShowFilesWidget *widget);
void setFileScannerDialog(FileScannerDialog *dialog);
@@ -78,6 +80,7 @@ class Manager : public QObject
Database *m_database;
TvShowFilesWidget *m_tvShowFilesWidget;
FileScannerDialog *m_fileScannerDialog;
+ TvTunes *m_tvTunes;
};
#endif // MANAGER_H
View
BIN  i18n/MediaElch_de.qm
Binary file not shown
View
190 i18n/MediaElch_de.ts
@@ -1671,99 +1671,99 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../main/MainWindow.ui" line="558"/>
- <location filename="../main/MainWindow.cpp" line="266"/>
+ <location filename="../main/MainWindow.cpp" line="268"/>
<source>Settings</source>
<translation>Einstellungen</translation>
</message>
<message>
<location filename="../main/MainWindow.ui" line="563"/>
- <location filename="../main/MainWindow.cpp" line="272"/>
+ <location filename="../main/MainWindow.cpp" line="274"/>
<source>Quit</source>
<translation>Beenden</translation>
</message>
<message>
<location filename="../main/MainWindow.ui" line="568"/>
- <location filename="../main/MainWindow.cpp" line="271"/>
+ <location filename="../main/MainWindow.cpp" line="273"/>
<source>About</source>
<translation>Über</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="246"/>
+ <location filename="../main/MainWindow.cpp" line="248"/>
<source>Search</source>
<translation>Suche</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="248"/>
+ <location filename="../main/MainWindow.cpp" line="250"/>
<source>Search (%1)</source>
<translation>Suche (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="250"/>
+ <location filename="../main/MainWindow.cpp" line="252"/>
<source>Save</source>
<translation>Speichern</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="252"/>
+ <location filename="../main/MainWindow.cpp" line="254"/>
<source>Save (%1)</source>
<translation>Speichern (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="254"/>
+ <location filename="../main/MainWindow.cpp" line="256"/>
<source>Save All</source>
<translation>Alle Speichern</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="257"/>
+ <location filename="../main/MainWindow.cpp" line="259"/>
<source>Save All (%1)</source>
<translation>Alle Speichern (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="261"/>
+ <location filename="../main/MainWindow.cpp" line="263"/>
<source>Reload all files (%1)</source>
<translation>Lädt alle Dateien neu (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="263"/>
+ <location filename="../main/MainWindow.cpp" line="265"/>
<source>Rename</source>
<translation>Umbenennen</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="264"/>
+ <location filename="../main/MainWindow.cpp" line="266"/>
<source>Rename selected files</source>
<translation>Ausgewählte Dateien umbenennen</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="268"/>
+ <location filename="../main/MainWindow.cpp" line="270"/>
<source>XBMC</source>
<translation>XBMC</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="269"/>
+ <location filename="../main/MainWindow.cpp" line="271"/>
<source>Synchronize to XBMC</source>
<translation>Synchronisiere XBMC</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="274"/>
+ <location filename="../main/MainWindow.cpp" line="276"/>
<source>Support</source>
<translation>Support</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="394"/>
+ <location filename="../main/MainWindow.cpp" line="396"/>
<source>Reload all Movies (%1)</source>
<translation>Filme neu laden (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="396"/>
+ <location filename="../main/MainWindow.cpp" line="398"/>
<source>Reload all TV Shows (%1)</source>
<translation>Serien neu laden (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="398"/>
+ <location filename="../main/MainWindow.cpp" line="400"/>
<source>Reload all Concerts (%1)</source>
<translation>Konzerte neu laden (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="259"/>
+ <location filename="../main/MainWindow.cpp" line="261"/>
<source>Reload</source>
<translation>Neu laden</translation>
</message>
@@ -2836,12 +2836,12 @@ Operation abgebrochen.</translation>
<context>
<name>QObject</name>
<message>
- <location filename="../main.cpp" line="174"/>
+ <location filename="../main.cpp" line="175"/>
<source>Logfile could not be openened</source>
<translation>Logdatei konnte nicht geöffnet werden</translation>
</message>
<message>
- <location filename="../main.cpp" line="175"/>
+ <location filename="../main.cpp" line="176"/>
<source>The logfile %1 could not be openend for writing.</source>
<translation>Die Logdatei %1 konnte nicht zum Schreiben geöffnet werden.</translation>
</message>
@@ -5450,27 +5450,47 @@ p, li { white-space: pre-wrap; }
<translation>Inhalt</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="205"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="202"/>
+ <source>TV Tune</source>
+ <translation>TV Theme</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="211"/>
+ <source>Existing</source>
+ <translation>Vorhanden</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="218"/>
+ <source>Missing</source>
+ <translation>Fehlt</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="228"/>
+ <source>Download Theme</source>
+ <translation>Theme downloaden</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="252"/>
<source>Extended</source>
<translation>Erweitert</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="411"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="458"/>
<source>Extra Fanarts</source>
<translation>Extra Fanarts</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="433"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="480"/>
<source>Hint: Closed images will be deleted on save.</source>
<translation>Hinweis: Geschlossene Bilder werden beim Speichern gelöscht.</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="456"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="503"/>
<source>Add Images</source>
<translation>Bilder hinzufügen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="58"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="62"/>
<source>Genres</source>
<translation>Genres</translation>
</message>
@@ -5479,7 +5499,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Genre</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="59"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="63"/>
<source>Add Genre</source>
<translation>Genre hinzufügen</translation>
</message>
@@ -5488,33 +5508,33 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Genre entfernen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="235"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="282"/>
<source>Actor</source>
<translation>Schauspieler</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="240"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="287"/>
<source>Role</source>
<translation>Rolle</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="255"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="302"/>
<source>Add Actor</source>
<translation>Schauspieler hinzufügen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="286"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="333"/>
<source>Remove Actor</source>
<translation>Schauspieler entfernen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="346"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="730"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="393"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="777"/>
<source>Click to change</source>
<translation>Zum Ändern klicken</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="216"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="263"/>
<source>Actors</source>
<translation>Schauspieler</translation>
</message>
@@ -5523,16 +5543,16 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Staffelposter</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="608"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="655"/>
<source>Poster</source>
<translation>Poster</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="630"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="680"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="797"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="847"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="897"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="677"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="727"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="844"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="894"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="944"/>
<source>Click to Change</source>
<translation>Zum Ändern klicken</translation>
</message>
@@ -5541,17 +5561,17 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Vorschau</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="658"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="705"/>
<source>Fanart</source>
<translation>Fanart</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="708"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="755"/>
<source>Banner</source>
<translation>Banner</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="775"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="822"/>
<source>Logo</source>
<translation>Logo</translation>
</message>
@@ -5560,17 +5580,17 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Vorschau</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="825"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="872"/>
<source>Clear Art</source>
<translation>Clear Art</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="875"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="922"/>
<source>Character Art</source>
<translation>Character Art</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="362"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="409"/>
<source>Resolution</source>
<translation>Auflösung</translation>
</message>
@@ -5583,7 +5603,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Staffel %1</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="544"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="554"/>
<source>Downloading images...</source>
<translation>Lade Bilder...</translation>
</message>
@@ -5592,27 +5612,27 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Unbekanntes Genre</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="63"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="67"/>
<source>Tags</source>
<translation>Tags</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="64"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="68"/>
<source>Add Tag</source>
<translation>Tag hinzufügen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="891"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="901"/>
<source>Unknown Role</source>
<translation>Unbekannte Rolle</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1003"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1013"/>
<source>Choose Image</source>
<translation>Bild auswählen</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1003"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1013"/>
<source>Images (*.jpg *.jpeg)</source>
<translation>Bilder (*.jpg *.jpeg)</translation>
</message>
@@ -5621,7 +5641,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Unbekanntes Genre</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="890"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="900"/>
<source>Unknown Actor</source>
<translation>Unbekannter Schauspieler</translation>
</message>
@@ -5630,7 +5650,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Unbekannte Rolle</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="336"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="346"/>
<source>&lt;b&gt;&quot;%1&quot;&lt;/b&gt; Saved</source>
<translation>&lt;b&gt;&quot;%1&quot;&lt;/b&gt; gespeichert</translation>
</message>
@@ -5644,6 +5664,68 @@ p, li { white-space: pre-wrap; }
</message>
</context>
<context>
+ <name>TvTunesDialog</name>
+ <message>
+ <source>Dialog</source>
+ <translation type="obsolete">TV Tunes</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="17"/>
+ <source>TV Tunes</source>
+ <translation>TV Tunes</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="57"/>
+ <source>Result</source>
+ <translation>Ergebnis</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="95"/>
+ <source>0:00 / 0:00</source>
+ <translation>0:00 / 0:00</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="122"/>
+ <source>Progress</source>
+ <translation>Fortschritt</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="145"/>
+ <source>Download</source>
+ <translation>Download</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="152"/>
+ <source>Cancel Download</source>
+ <translation>Download abbrechen</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="176"/>
+ <source>Close</source>
+ <translation>Schließen</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="260"/>
+ <source>Download Finished</source>
+ <translation>Download abgeschlossen</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="265"/>
+ <source>The file %1 already exists.</source>
+ <translation>Die Datei %1 existiert bereits.</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="266"/>
+ <source>Do you want to overwrite it?</source>
+ <translation>Möchtest du sie überschreiben?</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="280"/>
+ <source>Download Canceled</source>
+ <translation>Download abgebrochen</translation>
+ </message>
+</context>
+<context>
<name>XbmcSql</name>
<message>
<source>Connection to XBMC MySQL Database failed!</source>
View
BIN  i18n/MediaElch_fr.qm
Binary file not shown
View
186 i18n/MediaElch_fr.ts
@@ -1483,99 +1483,99 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../main/MainWindow.ui" line="558"/>
- <location filename="../main/MainWindow.cpp" line="266"/>
+ <location filename="../main/MainWindow.cpp" line="268"/>
<source>Settings</source>
<translation>Réglages</translation>
</message>
<message>
<location filename="../main/MainWindow.ui" line="563"/>
- <location filename="../main/MainWindow.cpp" line="272"/>
+ <location filename="../main/MainWindow.cpp" line="274"/>
<source>Quit</source>
<translation>Quitter</translation>
</message>
<message>
<location filename="../main/MainWindow.ui" line="568"/>
- <location filename="../main/MainWindow.cpp" line="271"/>
+ <location filename="../main/MainWindow.cpp" line="273"/>
<source>About</source>
<translation>À propos</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="246"/>
+ <location filename="../main/MainWindow.cpp" line="248"/>
<source>Search</source>
<translation>Recherche</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="248"/>
+ <location filename="../main/MainWindow.cpp" line="250"/>
<source>Search (%1)</source>
<translation>Recherche (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="250"/>
+ <location filename="../main/MainWindow.cpp" line="252"/>
<source>Save</source>
<translation>Sauvegarder</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="252"/>
+ <location filename="../main/MainWindow.cpp" line="254"/>
<source>Save (%1)</source>
<translation>Sauvegarder (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="254"/>
+ <location filename="../main/MainWindow.cpp" line="256"/>
<source>Save All</source>
<translation>Sauvegarder tout</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="257"/>
+ <location filename="../main/MainWindow.cpp" line="259"/>
<source>Save All (%1)</source>
<translation>Sauvegarder tout (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="259"/>
+ <location filename="../main/MainWindow.cpp" line="261"/>
<source>Reload</source>
<translation>Recharger</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="261"/>
+ <location filename="../main/MainWindow.cpp" line="263"/>
<source>Reload all files (%1)</source>
<translation>Recharger tous les films (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="263"/>
+ <location filename="../main/MainWindow.cpp" line="265"/>
<source>Rename</source>
<translation>Renommer</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="264"/>
+ <location filename="../main/MainWindow.cpp" line="266"/>
<source>Rename selected files</source>
<translation>Renommer les fichiers sélectionnés</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="268"/>
+ <location filename="../main/MainWindow.cpp" line="270"/>
<source>XBMC</source>
<translation>XBMC</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="269"/>
+ <location filename="../main/MainWindow.cpp" line="271"/>
<source>Synchronize to XBMC</source>
<translation>Synchroniser avec XBMC</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="274"/>
+ <location filename="../main/MainWindow.cpp" line="276"/>
<source>Support</source>
<translation>Support</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="394"/>
+ <location filename="../main/MainWindow.cpp" line="396"/>
<source>Reload all Movies (%1)</source>
<translation>Recharger tous les films (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="396"/>
+ <location filename="../main/MainWindow.cpp" line="398"/>
<source>Reload all TV Shows (%1)</source>
<translation>Recharger tous les séries TV (%1)</translation>
</message>
<message>
- <location filename="../main/MainWindow.cpp" line="398"/>
+ <location filename="../main/MainWindow.cpp" line="400"/>
<source>Reload all Concerts (%1)</source>
<translation>Recharger tous les concerts (%1)</translation>
</message>
@@ -2552,12 +2552,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
- <location filename="../main.cpp" line="174"/>
+ <location filename="../main.cpp" line="175"/>
<source>Logfile could not be openened</source>
<translation>Le fichier journal n&apos;a pas pu être ouvert</translation>
</message>
<message>
- <location filename="../main.cpp" line="175"/>
+ <location filename="../main.cpp" line="176"/>
<source>The logfile %1 could not be openend for writing.</source>
<translation>Le fichier journal %1 n&apos;a pas pu être ouvert en écriture.</translation>
</message>
@@ -4647,32 +4647,52 @@ p, li { white-space: pre-wrap; }
<translation>Synopsis</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="205"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="202"/>
+ <source>TV Tune</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="211"/>
+ <source>Existing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="218"/>
+ <source>Missing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="228"/>
+ <source>Download Theme</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="252"/>
<source>Extended</source>
<translation>Étendue</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="411"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="458"/>
<source>Extra Fanarts</source>
<translation>Extra Fanarts</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="433"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="480"/>
<source>Hint: Closed images will be deleted on save.</source>
<translation>Astuce: Fermé les images elles seront effacées lors de la sauvegarde.</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="456"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="503"/>
<source>Add Images</source>
<translation>Ajouter Images</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="658"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="705"/>
<source>Fanart</source>
<translation>Fanart</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="58"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="62"/>
<source>Genres</source>
<translation>Genres</translation>
</message>
@@ -4681,7 +4701,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Genre</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="59"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="63"/>
<source>Add Genre</source>
<translation>Ajouter Genre</translation>
</message>
@@ -4690,38 +4710,38 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Enlever Genre</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="235"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="282"/>
<source>Actor</source>
<translation>Acteur</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="240"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="287"/>
<source>Role</source>
<translation>Rôle</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="255"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="302"/>
<source>Add Actor</source>
<translation>Ajouter Acteur</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="286"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="333"/>
<source>Remove Actor</source>
<translation>Enlever Acteur</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="346"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="730"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="393"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="777"/>
<source>Click to change</source>
<translation>Cliquer pour changer</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="362"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="409"/>
<source>Resolution</source>
<translation>Résolution</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="216"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="263"/>
<source>Actors</source>
<translation>Acteurs</translation>
</message>
@@ -4730,16 +4750,16 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Jaquettes Saison</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="608"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="655"/>
<source>Poster</source>
<translation>Affiche</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="630"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="680"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="797"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="847"/>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="897"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="677"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="727"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="844"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="894"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="944"/>
<source>Click to Change</source>
<translation>Cliquer pour Changer</translation>
</message>
@@ -4752,12 +4772,12 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Fond</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="708"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="755"/>
<source>Banner</source>
<translation>Bannière</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="775"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="822"/>
<source>Logo</source>
<translation>Logo</translation>
</message>
@@ -4766,12 +4786,12 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Aperçu complet</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="825"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="872"/>
<source>Clear Art</source>
<translation>Clear Art</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.ui" line="875"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.ui" line="922"/>
<source>Character Art</source>
<translation>Character Art</translation>
</message>
@@ -4780,7 +4800,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Saison %1</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="336"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="346"/>
<source>&lt;b&gt;&quot;%1&quot;&lt;/b&gt; Saved</source>
<translation>&lt;b&gt;&quot;%1&quot;&lt;/b&gt; Sauvegarder</translation>
</message>
@@ -4789,7 +4809,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Téléchargement des images d&apos;acteurset des vigenttes manquantes...</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="544"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="554"/>
<source>Downloading images...</source>
<translation>Téléchargement d&apos;images...</translation>
</message>
@@ -4798,37 +4818,95 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Genre inconnu</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="63"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="67"/>
<source>Tags</source>
<translation>Tags</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="64"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="68"/>
<source>Add Tag</source>
<translation>Ajouter Tag</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="890"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="900"/>
<source>Unknown Actor</source>
<translation>Acteur inconnu</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="891"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="901"/>
<source>Unknown Role</source>
<translation>Rôle inconnu</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1003"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1013"/>
<source>Choose Image</source>
<translation>Choisir image</translation>
</message>
<message>
- <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1003"/>
+ <location filename="../tvShows/TvShowWidgetTvShow.cpp" line="1013"/>
<source>Images (*.jpg *.jpeg)</source>
<translation>Images (*.jpg *.jpeg *.png)</translation>
</message>
</context>
<context>
+ <name>TvTunesDialog</name>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="17"/>
+ <source>TV Tunes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="57"/>
+ <source>Result</source>
+ <translation type="unfinished">Résultat</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="95"/>
+ <source>0:00 / 0:00</source>
+ <translation type="unfinished">0:00 / 0:00</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="122"/>
+ <source>Progress</source>
+ <translation type="unfinished">Progression</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="145"/>
+ <source>Download</source>
+ <translation type="unfinished">Télécharger</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="152"/>
+ <source>Cancel Download</source>
+ <translation type="unfinished">Annuler téléchargement</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.ui" line="176"/>
+ <source>Close</source>
+ <translation type="unfinished">Fermer</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="260"/>
+ <source>Download Finished</source>
+ <translation type="unfinished">Téléchargement terminé</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="265"/>
+ <source>The file %1 already exists.</source>
+ <translation type="unfinished">Le fichiers %1 existe déjà.</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="266"/>
+ <source>Do you want to overwrite it?</source>
+ <translation type="unfinished">Voulez-vous l&apos;écraser ?</translation>
+ </message>
+ <message>
+ <location filename="../tvShows/TvTunesDialog.cpp" line="280"/>
+ <source>Download Canceled</source>
+ <translation type="unfinished">Téléchargement annulé</translation>
+ </message>
+</context>
+<context>
<name>XbmcSql</name>
<message>
<source>Connection to XBMC MySQL Database failed! &quot;%1&quot;</source>
View
BIN  i18n/MediaElch_pt_BR.qm
Binary file not shown
View
63 i18n/MediaElch_pt_BR.ts
@@ -3624,6 +3624,69 @@ p, li { white-space: pre-wrap; }
<source>Extended</source>
<translation>Extendido</translation>
</message>
+ <message>
+ <source>TV Tune</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Existing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Missing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Download Theme</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TvTunesDialog</name>
+ <message>
+ <source>Result</source>
+ <translation type="unfinished">Resultado</translation>
+ </message>
+ <message>
+ <source>0:00 / 0:00</source>
+ <translation type="unfinished">0:00 / 0:00</translation>
+ </message>
+ <message>
+ <source>Progress</source>
+ <translation type="unfinished">Progresso</translation>
+ </message>
+ <message>
+ <source>Download</source>
+ <translation type="unfinished">Download</translation>
+ </message>
+ <message>
+ <source>Cancel Download</source>
+ <translation type="unfinished">Cancelar Download</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="unfinished">Fechar</translation>
+ </message>
+ <message>
+ <source>Download Finished</source>
+ <translation type="unfinished">Download Finalizado</translation>
+ </message>
+ <message>
+ <source>The file %1 already exists.</source>
+ <translation type="unfinished">O arquivo %1 já existe.</translation>
+ </message>
+ <message>
+ <source>Do you want to overwrite it?</source>
+ <translation type="unfinished">Você deseja sobrescrevê-lo?</translation>
+ </message>
+ <message>
+ <source>Download Canceled</source>
+ <translation type="unfinished">Download Cancelado</translation>
+ </message>
+ <message>
+ <source>TV Tunes</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>XbmcSync</name>
View
1  main.cpp
@@ -133,6 +133,7 @@ int main(int argc, char *argv[])
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator);
+ qDebug() << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
QTranslator editTranslator;
QString filename;
View
4 main/MainWindow.cpp
@@ -19,9 +19,10 @@
#include "main/MessageBox.h"
#include "movies/MovieMultiScrapeDialog.h"
#include "movies/MovieSearch.h"
-#include "tvShows/TvShowSearch.h"
#include "sets/MovieListDialog.h"
#include "settings/Settings.h"
+#include "tvShows/TvShowSearch.h"
+#include "tvShows/TvTunesDialog.h"
#include "xbmc/XbmcSync.h"
#ifdef Q_OS_MAC
@@ -159,6 +160,7 @@ MainWindow::MainWindow(QWidget *parent) :
ImagePreviewDialog::instance(ui->centralWidget);
ConcertSearch::instance(ui->centralWidget);
TrailerDialog::instance(ui->centralWidget);
+ TvTunesDialog::instance(ui->centralWidget);
NameFormatter::instance(this);
MovieMultiScrapeDialog::instance(ui->centralWidget);
View
3  mediaCenterPlugins/XbmcXml.cpp
@@ -1572,6 +1572,9 @@ bool XbmcXml::loadTvShow(TvShow *show, QString initialNfoContent)
}
}
+ QFileInfo fi(show->dir() + "/theme.mp3");
+ show->setHasTune(fi.isFile());
+
return true;
}
View
57 scrapers/TvTunes.cpp
@@ -0,0 +1,57 @@
+#include "TvTunes.h"
+
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QRegExp>
+#include "globals/Helper.h"
+
+TvTunes::TvTunes(QObject *parent) :
+ QObject(parent)
+{
+}
+
+void TvTunes::search(QString searchStr)
+{
+ searchStr = searchStr.replace(" ", "+");
+ searchStr = Helper::urlEncode(searchStr);
+
+ QUrl url(QString("http://www.televisiontunes.com/search.php?searWords=%1&search=").arg(searchStr));
+ QNetworkRequest request(url);
+ QNetworkReply *reply = m_qnam.get(request);
+ connect(reply, SIGNAL(finished()), this, SLOT(onSearchFinished()));
+}
+
+void TvTunes::onSearchFinished()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply*>(QObject::sender());
+ reply->deleteLater();
+ QList<ScraperSearchResult> results;
+ if (reply->error() != QNetworkReply::NoError ) {
+ qWarning() << "Network Error" << reply->errorString();
+ emit sigSearchDone(results);
+ return;
+ }
+ QString msg = QString::fromUtf8(reply->readAll());
+ results = parseSearch(msg);
+ emit sigSearchDone(results);
+}
+
+QList<ScraperSearchResult> TvTunes::parseSearch(QString html)
+{
+ QList<ScraperSearchResult> results;
+
+ QRegExp rx;
+ rx.setMinimal(true);
+
+ rx.setPattern("[0-9]*\\.&nbsp;<a href=\"http://www.televisiontunes.com/(.*).html\">(.*)</a>");
+ int pos = 0;
+ while ((pos = rx.indexIn(html, pos)) != -1) {
+ ScraperSearchResult result;
+ result.id = QString("http://www.televisiontunes.com/download.php?f=%1").arg(rx.cap(1));
+ result.name = rx.cap(2);
+ results.append(result);
+ pos += rx.matchedLength();
+ }
+
+ return results;
+}
View
26 scrapers/TvTunes.h
@@ -0,0 +1,26 @@
+#ifndef TVTUNES_H
+#define TVTUNES_H
+
+#include <QObject>
+#include <QNetworkAccessManager>
+#include "globals/Globals.h"
+
+class TvTunes : public QObject
+{
+ Q_OBJECT
+public:
+ explicit TvTunes(QObject *parent = 0);
+ void search(QString searchStr);
+
+signals:
+ void sigSearchDone(QList<ScraperSearchResult>);
+
+private slots:
+ void onSearchFinished();
+
+private:
+ QNetworkAccessManager m_qnam;
+ QList<ScraperSearchResult> parseSearch(QString html);
+};
+
+#endif // TVTUNES_H
View
20 tvShows/TvShowWidgetTvShow.cpp
@@ -13,6 +13,7 @@
#include "globals/Manager.h"
#include "main/MessageBox.h"
#include "tvShows/TvShowSearch.h"
+#include "tvShows/TvTunesDialog.h"
/**
* @brief TvShowWidgetTvShow::TvShowWidgetTvShow
@@ -55,6 +56,9 @@ TvShowWidgetTvShow::TvShowWidgetTvShow(QWidget *parent) :
#endif
ui->actorResolution->setFont(font);
+ ui->badgeTuneExisting->setBadgeType(Badge::LabelSuccess);
+ ui->badgeTuneMissing->setBadgeType(Badge::LabelWarning);
+
ui->genreCloud->setText(tr("Genres"));
ui->genreCloud->setPlaceholder(tr("Add Genre"));
connect(ui->genreCloud, SIGNAL(activated(QString)), this, SLOT(onAddGenre(QString)));
@@ -93,6 +97,7 @@ TvShowWidgetTvShow::TvShowWidgetTvShow(QWidget *parent) :
connect(ui->actors, SIGNAL(itemSelectionChanged()), this, SLOT(onActorChanged()));
connect(ui->actor, SIGNAL(clicked()), this, SLOT(onChangeActorImage()));
connect(ui->buttonRevert, SIGNAL(clicked()), this, SLOT(onRevertChanges()));
+ connect(ui->btnDownloadTune, SIGNAL(clicked()), this, SLOT(onDownloadTune()));
connect(ui->fanarts, SIGNAL(sigRemoveImage(QByteArray)), this, SLOT(onRemoveExtraFanart(QByteArray)));
connect(ui->fanarts, SIGNAL(sigRemoveImage(QString)), this, SLOT(onRemoveExtraFanart(QString)));
@@ -175,6 +180,8 @@ void TvShowWidgetTvShow::onClear()
ui->clearArt->clear();
ui->characterArt->clear();
ui->tagCloud->clear();
+ ui->badgeTuneExisting->setVisible(false);
+ ui->badgeTuneMissing->setVisible(true);
ui->buttonRevert->setVisible(false);
}
@@ -262,6 +269,9 @@ void TvShowWidgetTvShow::updateTvShowInfo()
updateImages(QList<ImageType>() << TypePoster << TypeBackdrop << TypeBanner << TypeCharacterArt << TypeClearArt << TypeLogo);
ui->fanarts->setImages(m_show->extraFanarts(Manager::instance()->mediaCenterInterfaceTvShow()));
+ ui->badgeTuneExisting->setVisible(m_show->hasTune());
+ ui->badgeTuneMissing->setVisible(!m_show->hasTune());
+
ui->certification->blockSignals(false);
ui->rating->blockSignals(false);
ui->firstAired->blockSignals(false);
@@ -1134,3 +1144,13 @@ void TvShowWidgetTvShow::onAddExtraFanart()
ui->buttonRevert->setVisible(true);
}
}
+
+void TvShowWidgetTvShow::onDownloadTune()
+{
+ TvTunesDialog::instance()->setTvShow(m_show);
+ int result = TvTunesDialog::instance()->exec();
+ if (result == QDialog::Accepted) {
+ ui->badgeTuneExisting->setVisible(true);
+ ui->badgeTuneMissing->setVisible(false);
+ }
+}
View
1  tvShows/TvShowWidgetTvShow.h
@@ -71,6 +71,7 @@ private slots:
void onRevertChanges();
void onArtPageOne();
void onArtPageTwo();
+ void onDownloadTune();
void onNameChange(QString text);
void onCertificationChange(QString text);
View
64 tvShows/TvShowWidgetTvShow.ui
@@ -186,16 +186,63 @@
<item row="5" column="1">
<widget class="QLineEdit" name="studio"/>
</item>
- <item row="6" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Overview</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<widget class="QTextEdit" name="overview"/>
</item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>TV Tune</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="Badge" name="badgeTuneExisting">
+ <property name="text">
+ <string>Existing</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Badge" name="badgeTuneMissing">
+ <property name="text">
+ <string>Missing</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="btnDownloadTune">
+ <property name="cursor">
+ <cursorShape>PointingHandCursor</cursorShape>
+ </property>
+ <property name="toolTip">
+ <string>Download Theme</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">QToolButton {
+ border: 0;
+}</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../MediaElch.qrc">
+ <normaloff>:/img/inbox.png</normaloff>:/img/inbox.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
</layout>
@@ -939,6 +986,12 @@ QPushButton::hover {
</widget>
<customwidgets>
<customwidget>
+ <class>SlidingStackedWidget</class>
+ <extends>QStackedWidget</extends>
+ <header>smallWidgets/SlidingStackedWidget.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
<class>MyLabel</class>
<extends>QLabel</extends>
<header>smallWidgets/MyLabel.h</header>
@@ -950,10 +1003,9 @@ QPushButton::hover {
<container>1</container>
</customwidget>
<customwidget>
- <class>SlidingStackedWidget</class>
- <extends>QStackedWidget</extends>
- <header>smallWidgets/SlidingStackedWidget.h</header>
- <container>1</container>
+ <class>Badge</class>
+ <extends>QLabel</extends>
+ <header>smallWidgets/Badge.h</header>
</customwidget>
<customwidget>
<class>ImageGallery</class>
View
307 tvShows/TvTunesDialog.cpp
@@ -0,0 +1,307 @@
+#include "TvTunesDialog.h"
+#include "ui_TvTunesDialog.h"
+
+#include <QMessageBox>
+#include "phonon/AudioOutput"
+
+#include "globals/Manager.h"
+
+TvTunesDialog::TvTunesDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::TvTunesDialog)
+{
+ ui->setupUi(this);
+
+ m_totalTime = 0;
+
+#if QT_VERSION >= 0x050000
+ ui->results->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+#else
+ ui->results->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
+#endif
+ ui->searchString->setType(MyLineEdit::TypeLoading);
+
+#ifdef Q_OS_MAC
+ setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Sheet);
+#else
+ setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Dialog);
+#endif
+
+#ifdef Q_OS_MAC
+ QFont font = ui->time->font();
+ font.setPointSize(font.pointSize()-1);
+ ui->time->setFont(font);
+#endif
+
+ m_qnam = new QNetworkAccessManager(this);
+
+ connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(onClose()));
+ connect(ui->searchString, SIGNAL(returnPressed()), this, SLOT(onSearch()));
+ connect(ui->results, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(onResultClicked(QTableWidgetItem*)));
+ connect(ui->buttonDownload, SIGNAL(clicked()), this, SLOT(startDownload()));
+ connect(ui->buttonCancelDownload, SIGNAL(clicked()), this, SLOT(cancelDownload()));
+ connect(Manager::instance()->tvTunes(), SIGNAL(sigSearchDone(QList<ScraperSearchResult>)), this, SLOT(onShowResults(QList<ScraperSearchResult>)));
+
+ m_mediaObject = new Phonon::MediaObject(this);
+ m_mediaObject->setTickInterval(1000);
+ Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
+ Phonon::createPath(m_mediaObject, audioOutput);
+ ui->seekSlider->setMediaObject(m_mediaObject);
+
+ connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(onStateChanged(Phonon::State)));
+ connect(m_mediaObject, SIGNAL(totalTimeChanged(qint64)), this, SLOT(onNewTotalTime(qint64)));
+ connect(m_mediaObject, SIGNAL(tick(qint64)), this, SLOT(onTick(qint64)));
+ connect(ui->btnPlayPause, SIGNAL(clicked()), this, SLOT(onPlayPause()));
+}
+
+TvTunesDialog::~TvTunesDialog()
+{
+ delete ui;
+}
+
+TvTunesDialog *TvTunesDialog::instance(QWidget *parent)
+{
+ static TvTunesDialog *m_instance = 0;
+ if (!m_instance)
+ m_instance = new TvTunesDialog(parent);
+ return m_instance;
+}
+
+void TvTunesDialog::clear()
+{
+ m_mediaObject->stop();
+ ui->btnPlayPause->setEnabled(false);
+ ui->buttonDownload->setEnabled(false);
+ ui->results->clearContents();
+ ui->results->setRowCount(0);
+}
+
+void TvTunesDialog::setTvShow(TvShow *show)
+{
+ m_show = show;
+}
+
+int TvTunesDialog::exec()
+{
+ adjustSize();
+ ui->buttonCancelDownload->setVisible(false);
+ ui->buttonDownload->setVisible(true);
+ ui->progress->clear();
+ ui->progressBar->setVisible(false);
+ ui->progressBar->setValue(0);
+ m_downloadInProgress = false;
+ m_fileDownloaded = false;
+ ui->searchString->setText(m_show->name());
+ onSearch();
+ return QDialog::exec();
+}
+
+void TvTunesDialog::onSearch()
+{
+ clear();
+ ui->searchString->setLoading(true);
+ Manager::instance()->tvTunes()->search(ui->searchString->text());
+}
+
+void TvTunesDialog::onShowResults(QList<ScraperSearchResult> results)
+{
+ ui->searchString->setLoading(false);
+ ui->searchString->setFocus();
+ foreach (const ScraperSearchResult &result, results) {
+ QTableWidgetItem *item = new QTableWidgetItem(QString("%1").arg(result.name));
+ item->setData(Qt::UserRole, result.id);
+ int row = ui->results->rowCount();
+ ui->results->insertRow(row);
+ ui->results->setItem(row, 0, item);
+ }
+}
+
+void TvTunesDialog::onResultClicked(QTableWidgetItem *item)
+{
+ m_mediaObject->stop();
+ QString url = item->data(Qt::UserRole).toString();
+ m_themeUrl = url;
+ Phonon::MediaSource source(url);
+ m_mediaObject->setCurrentSource(source);
+ m_mediaObject->play();
+ ui->btnPlayPause->setEnabled(true);
+ ui->buttonDownload->setEnabled(true);
+}
+
+void TvTunesDialog::onNewTotalTime(qint64 totalTime)
+{
+ m_totalTime = totalTime;
+ updateTime(m_mediaObject->currentTime());
+}
+
+void TvTunesDialog::onTick(qint64 time)
+{
+ updateTime(time);
+}
+
+void TvTunesDialog::updateTime(qint64 currentTime)
+{
+ QString tTime = QString("%1:%2").arg(m_totalTime/1000/60).arg((m_totalTime/1000)%60, 2, 10, QChar('0'));
+ QString cTime = QString("%1:%2").arg(currentTime/1000/60).arg((currentTime/1000)%60, 2, 10, QChar('0'));
+ ui->time->setText(QString("%1 / %2").arg(cTime).arg(tTime));
+}
+
+void TvTunesDialog::onStateChanged(Phonon::State newState)
+{
+ switch (newState) {
+ case Phonon::PlayingState:
+ case Phonon::LoadingState:
+ case Phonon::BufferingState:
+ ui->btnPlayPause->setIcon(QIcon(":/img/video_pause_64.png"));
+ break;
+ case Phonon::StoppedState:
+ case Phonon::PausedState:
+ case Phonon::ErrorState:
+ ui->btnPlayPause->setIcon(QIcon(":/img/video_play_64.png"));
+ break;
+ }
+}
+
+void TvTunesDialog::onPlayPause()
+{
+ switch (m_mediaObject->state()) {
+ case Phonon::PlayingState:
+ case Phonon::LoadingState:
+ case Phonon::BufferingState:
+ m_mediaObject->pause();
+ break;
+ case Phonon::StoppedState:
+ case Phonon::PausedState:
+ case Phonon::ErrorState:
+ m_mediaObject->play();
+ break;
+ }
+}
+
+void TvTunesDialog::startDownload()
+{
+ if (m_show->dir().isEmpty())
+ return;
+
+ m_output.setFileName(m_show->dir() + "/theme.mp3.download");
+
+ if (!m_output.open(QIODevice::WriteOnly)) {
+ return;
+ }
+
+ ui->buttonDownload->setVisible(false);
+ ui->buttonCancelDownload->setVisible(true);
+ ui->btnClose->setEnabled(false);
+ ui->progressBar->setVisible(true);
+ ui->searchString->setEnabled(false);
+ ui->progress->clear();
+
+ m_downloadInProgress = true;
+ m_downloadReply = m_qnam->get(QNetworkRequest(m_themeUrl));
+ connect(m_downloadReply, SIGNAL(finished()), this, SLOT(downloadFinished()));
+ connect(m_downloadReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64)));
+ connect(m_downloadReply, SIGNAL(readyRead()), SLOT(downloadReadyRead()));
+ m_downloadTime.start();
+}
+
+void TvTunesDialog::cancelDownload()
+{
+ ui->buttonDownload->setVisible(true);
+ ui->buttonCancelDownload->setVisible(false);
+ ui->btnClose->setEnabled(true);
+ ui->progressBar->setVisible(false);
+ ui->progressBar->setValue(0);
+ ui->progress->clear();
+ ui->searchString->setEnabled(true);
+
+ m_downloadReply->abort();
+ m_downloadReply->deleteLater();
+
+ m_output.close();
+ m_downloadInProgress = false;
+}
+
+void TvTunesDialog::downloadProgress(qint64 received, qint64 total)
+{
+ ui->progressBar->setRange(0, total);
+ ui->progressBar->setValue(received);
+
+ double speed = received * 1000.0 / m_downloadTime.elapsed();
+ QString unit;
+ if (speed < 1024) {
+ unit = "bytes/sec";
+ } else if (speed < 1024*1024) {
+ speed /= 1024;
+ unit = "kB/s";
+ } else {
+ speed /= 1024*1024;
+ unit = "MB/s";
+ }
+ ui->progress->setText(QString("%1 %2").arg(speed, 3, 'f', 1).arg(unit));
+}
+
+void TvTunesDialog::downloadFinished()
+{
+ if (m_downloadReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 302 ||
+ m_downloadReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 301) {
+ qDebug() << "Got redirect" << m_downloadReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
+ m_downloadReply = m_qnam->get(QNetworkRequest(m_downloadReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl()));
+ connect(m_downloadReply, SIGNAL(finished()), this, SLOT(downloadFinished()));
+ connect(m_downloadReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64)));
+ connect(m_downloadReply, SIGNAL(readyRead()), SLOT(downloadReadyRead()));
+ return;
+ }
+
+ m_downloadInProgress = false;
+ m_output.close();
+
+ QFile file(m_show->dir() + "/theme.mp3.download");
+ if (m_downloadReply->error() == QNetworkReply::NoError) {
+ ui->progress->setText(tr("Download Finished"));
+ QString newFileName = m_show->dir() + "/theme.mp3";
+ QFileInfo fi(newFileName);
+ if (fi.exists()) {
+ QMessageBox msgBox;
+ msgBox.setText(tr("The file %1 already exists.").arg(fi.fileName()));
+ msgBox.setInformativeText(tr("Do you want to overwrite it?"));
+ msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
+ msgBox.setDefaultButton(QMessageBox::Yes);
+ if (msgBox.exec() == QMessageBox::Yes) {
+ QFile oldFile(newFileName);
+ oldFile.remove();
+ file.rename(newFileName);
+ m_fileDownloaded = true;
+ }
+ } else {
+ file.rename(newFileName);
+ m_fileDownloaded = true;
+ }
+ } else {
+ ui->progress->setText(tr("Download Canceled"));
+ file.remove();
+ }
+
+ ui->buttonDownload->setVisible(true);
+ ui->buttonCancelDownload->setVisible(false);
+ ui->progressBar->setVisible(false);
+ ui->btnClose->setEnabled(true);
+ ui->searchString->setEnabled(true);
+
+ m_downloadReply->deleteLater();
+}
+
+void TvTunesDialog::downloadReadyRead()
+{
+ m_output.write(m_downloadReply->readAll());
+}
+
+void TvTunesDialog::onClose()
+{
+ m_mediaObject->stop();
+ if (m_downloadInProgress)
+ cancelDownload();
+ if (m_fileDownloaded)
+ QDialog::accept();
+ else
+ QDialog::reject();
+}
View
63 tvShows/TvTunesDialog.h
@@ -0,0 +1,63 @@
+#ifndef TVTUNESDIALOG_H
+#define TVTUNESDIALOG_H
+
+#include <QDialog>
+#include <QFile>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+#include <QTableWidgetItem>
+#include "phonon/MediaObject"
+#include "phonon/VideoWidget"
+
+#include "data/TvShow.h"
+
+namespace Ui {
+class TvTunesDialog;
+}
+
+class TvTunesDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit TvTunesDialog(QWidget *parent = 0);
+ ~TvTunesDialog();
+ static TvTunesDialog* instance(QWidget *parent = 0);
+ void setTvShow(TvShow *show);
+
+public slots:
+ int exec();
+
+private slots:
+ void onSearch();
+ void onShowResults(QList<ScraperSearchResult> results);
+ void onTick(qint64 time);
+ void onNewTotalTime(qint64 totalTime);
+ void onStateChanged(Phonon::State newState);
+ void onPlayPause();
+ void onResultClicked(QTableWidgetItem *item);
+ void startDownload();
+ void cancelDownload();
+ void downloadProgress(qint64 received, qint64 total);
+ void downloadFinished();
+ void downloadReadyRead();
+ void onClose();
+
+private:
+ Ui::TvTunesDialog *ui;
+ TvShow *m_show;
+ Phonon::MediaObject *m_mediaObject;
+ Phonon::VideoWidget *m_videoWidget;
+ qint64 m_totalTime;
+ QNetworkAccessManager *m_qnam;
+ QNetworkReply *m_downloadReply;
+ QTime m_downloadTime;
+ QFile m_output;
+ QUrl m_themeUrl;
+ bool m_downloadInProgress;
+ bool m_fileDownloaded;
+ void updateTime(qint64 currentTime);
+ void clear();
+};
+
+#endif // TVTUNESDIALOG_H
View
203 tvShows/TvTunesDialog.ui
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TvTunesDialog</class>
+ <widget class="QDialog" name="TvTunesDialog">
+ <property name="windowModality">
+ <enum>Qt::WindowModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>580</width>
+ <height>487</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>TV Tunes</string>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="MyLineEdit" name="searchString"/>
+ </item>
+ <item>
+ <widget class="QTableWidget" name="results">
+ <property name="styleSheet">
+ <string notr="true">alternate-background-color: rgb(243, 246, 250);</string>
+ </property>
+ <property name="editTriggers">
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="showGrid">
+ <bool>false</bool>
+ </property>
+ <attribute name="horizontalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
+ <column>
+ <property name="text">
+ <string>Result</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="QToolButton" name="btnPlayPause">
+ <property name="cursor">
+ <cursorShape>PointingHandCursor</cursorShape>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">QToolButton {
+ border: 0;
+}</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../MediaElch.qrc">
+ <normaloff>:/img/video_play_64.png</normaloff>:/img/video_play_64.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Phonon::SeekSlider" name="seekSlider"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="time">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>0:00 / 0:00</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QProgressBar" name="progressBar">
+ <property name="value">
+ <number>24</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="progress">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Progress</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonDownload">
+ <property name="text">
+ <string>Download</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonCancelDownload">
+ <property name="text">
+ <string>Cancel Download</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnClose">
+ <property name="text">
+ <string>Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Phonon::SeekSlider</class>
+ <extends>QWidget</extends>
+ <header location="global">phonon/seekslider.h</header>
+ </customwidget>
+ <customwidget>
+ <class>MyLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>smallWidgets/MyLineEdit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="../MediaElch.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Please sign in to comment.
Something went wrong with that request. Please try again.