Combine lyrics and wiki settings
This commit is contained in:
committed by
craig.p.drummond
parent
9e3a2f6deb
commit
082e63d61d
@@ -104,7 +104,7 @@ SET( CANTATA_SRCS gui/application.cpp gui/main.cpp gui/initialsettingswizard.cpp
|
||||
devices/deviceoptions.cpp
|
||||
context/lyricsettings.cpp context/ultimatelyricsprovider.cpp context/ultimatelyrics.cpp context/lyricsdialog.cpp
|
||||
context/contextpage.cpp context/view.cpp context/artistview.cpp context/albumview.cpp context/songview.cpp context/contextengine.cpp
|
||||
context/wikipediaengine.cpp context/wikipediasettings.cpp)
|
||||
context/wikipediaengine.cpp context/wikipediasettings.cpp context/contextsettings.cpp)
|
||||
SET( CANTATA_MOC_HDRS
|
||||
gui/initialsettingswizard.h gui/mainwindow.h gui/settings.h gui/covers.h gui/folderpage.h gui/librarypage.h gui/albumspage.h
|
||||
gui/playlistspage.h gui/serverplaybacksettings.h gui/serversettings.h gui/preferencesdialog.h gui/filesettings.h
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "contextengine.h"
|
||||
#include "wikipediaengine.h"
|
||||
#include "wikipediasettings.h"
|
||||
#include <QNetworkReply>
|
||||
|
||||
ContextEngine * ContextEngine::create(QObject *parent)
|
||||
@@ -31,11 +30,6 @@ ContextEngine * ContextEngine::create(QObject *parent)
|
||||
return new WikipediaEngine(parent);
|
||||
}
|
||||
|
||||
ContextSettings * ContextEngine::settings(QWidget *parent)
|
||||
{
|
||||
return new WikipediaSettings(parent);
|
||||
}
|
||||
|
||||
ContextEngine::ContextEngine(QObject *p)
|
||||
: QObject(p)
|
||||
, job(0)
|
||||
|
||||
@@ -26,18 +26,9 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
class ContextSettings : public QWidget {
|
||||
public:
|
||||
ContextSettings(QWidget *p=0) : QWidget(p) { }
|
||||
virtual ~ContextSettings() { }
|
||||
virtual void load()=0;
|
||||
virtual void save()=0;
|
||||
};
|
||||
|
||||
class ContextEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -51,7 +42,6 @@ public:
|
||||
static void setPreferedLangs(const QStringList &l);
|
||||
static const QStringList & getPreferedLangs() { return preferredLangs; }
|
||||
static ContextEngine * create(QObject *parent);
|
||||
static ContextSettings * settings(QWidget *parent);
|
||||
|
||||
ContextEngine(QObject *p);
|
||||
virtual ~ContextEngine();
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
||||
@@ -42,7 +42,7 @@ static QString localeFile() {
|
||||
}
|
||||
|
||||
WikipediaSettings::WikipediaSettings(QWidget *p)
|
||||
: ContextSettings(p)
|
||||
: QWidget(p)
|
||||
, loaded(false)
|
||||
, job(0)
|
||||
, spinner(0)
|
||||
|
||||
@@ -31,7 +31,7 @@ class QNetworkReply;
|
||||
class QShowEvent;
|
||||
class Spinner;
|
||||
|
||||
class WikipediaSettings : public ContextSettings, private Ui::WikipediaSettings
|
||||
class WikipediaSettings : public QWidget, private Ui::WikipediaSettings
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
#ifdef TAGLIB_FOUND
|
||||
#include "httpserversettings.h"
|
||||
#endif
|
||||
#include "contextengine.h"
|
||||
#include "lyricsettings.h"
|
||||
#include "contextsettings.h"
|
||||
#include "cachesettings.h"
|
||||
#include "localize.h"
|
||||
#include "mpdconnection.h"
|
||||
@@ -67,15 +66,14 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
|
||||
playback = new PlaybackSettings(widget);
|
||||
files = new FileSettings(widget);
|
||||
interface = new InterfaceSettings(widget);
|
||||
context = ContextEngine::settings(widget);
|
||||
lyrics = new LyricSettings(widget);
|
||||
context = new ContextSettings(widget);
|
||||
cache = new CacheSettings(widget);
|
||||
server->load();
|
||||
serverplayback->load();
|
||||
playback->load();
|
||||
files->load();
|
||||
interface->load();
|
||||
lyrics->load();
|
||||
context->load();
|
||||
widget->addPage(server, i18n("Connection"), Icons::libraryIcon, i18n("Connection Settings"));
|
||||
widget->addPage(serverplayback, i18n("Output"), Icons::speakerIcon, i18n("Output Settings"));
|
||||
widget->addPage(playback, i18n("Playback"), Icon("media-playback-start"), i18n("Playback Settings"));
|
||||
@@ -92,8 +90,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
|
||||
}
|
||||
#endif
|
||||
widget->addPage(context, i18n("Context"), Icons::contextIcon, i18n("Context View Settings"));
|
||||
context->load();
|
||||
widget->addPage(lyrics, i18n("Lyrics"), Icons::lyricsIcon, i18n("Lyrics Settings"));
|
||||
#if defined CDDB_FOUND || defined MUSICBRAINZ5_FOUND
|
||||
audiocd = new AudioCdSettings(widget);
|
||||
audiocd->load();
|
||||
@@ -145,7 +141,6 @@ void PreferencesDialog::writeSettings()
|
||||
audiocd->save();
|
||||
#endif
|
||||
context->save();
|
||||
lyrics->save();
|
||||
Settings::self()->save();
|
||||
emit settingsSaved();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ class PlaybackSettings;
|
||||
class FileSettings;
|
||||
class InterfaceSettings;
|
||||
class ContextSettings;
|
||||
class LyricSettings;
|
||||
#ifdef TAGLIB_FOUND
|
||||
class HttpServerSettings;
|
||||
#endif
|
||||
@@ -75,7 +74,6 @@ private:
|
||||
FileSettings *files;
|
||||
InterfaceSettings *interface;
|
||||
ContextSettings *context;
|
||||
LyricSettings *lyrics;
|
||||
#ifdef TAGLIB_FOUND
|
||||
HttpServerSettings *http;
|
||||
#endif
|
||||
|
||||
@@ -332,7 +332,6 @@ Icon Icons::streamsIcon;
|
||||
Icon Icons::onlineIcon;
|
||||
#endif
|
||||
Icon Icons::contextIcon;
|
||||
Icon Icons::lyricsIcon;
|
||||
Icon Icons::infoIcon;
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
Icon Icons::devicesIcon;
|
||||
@@ -438,10 +437,6 @@ void Icons::init()
|
||||
filesIcon=Icon("document-multiple");
|
||||
cancelIcon=Icon("dialog-cancel");
|
||||
importIcon=Icon("document-import");
|
||||
lyricsIcon=Icon("view-media-lyrics");
|
||||
if (lyricsIcon.isNull()) {
|
||||
lyricsIcon=Icon("text-x-generic");
|
||||
}
|
||||
if (editIcon.isNull()) {
|
||||
editIcon=Icon("text-editor");
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace Icons
|
||||
extern Icon onlineIcon;
|
||||
#endif
|
||||
extern Icon contextIcon;
|
||||
extern Icon lyricsIcon;
|
||||
extern Icon infoIcon;
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
extern Icon devicesIcon;
|
||||
|
||||
Reference in New Issue
Block a user