Make LyricWiki URL configurable

This commit is contained in:
Martchus 2019-04-16 23:08:54 +02:00
parent 784f2c8a3a
commit b1be64fe1d
3 changed files with 20 additions and 10 deletions

View File

@ -194,6 +194,7 @@ void restore()
v.dbQuery.override = settings.value(QStringLiteral("override"), true).toBool();
v.dbQuery.fields.restore(settings, QStringLiteral("fields"));
v.dbQuery.musicBrainzUrl = settings.value(QStringLiteral("musicbrainzurl")).toString();
v.dbQuery.lyricsWikiaUrl = settings.value(QStringLiteral("lyricwikiurl")).toString();
v.dbQuery.coverArtArchiveUrl = settings.value(QStringLiteral("coverartarchiveurl")).toString();
settings.endGroup();
@ -281,6 +282,7 @@ void save()
settings.setValue(QStringLiteral("override"), v.dbQuery.override);
v.dbQuery.fields.save(settings, QStringLiteral("fields"));
settings.setValue(QStringLiteral("musicbrainzurl"), v.dbQuery.musicBrainzUrl);
settings.setValue(QStringLiteral("lyricwikiurl"), v.dbQuery.lyricsWikiaUrl);
settings.setValue(QStringLiteral("coverartarchiveurl"), v.dbQuery.coverArtArchiveUrl);
settings.endGroup();

View File

@ -2,14 +2,6 @@
<ui version="4.0">
<class>QtGui::EditorDbQueryOptionsPage</class>
<widget class="QWidget" name="QtGui::EditorDbQueryOptionsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>74</height>
</rect>
</property>
<property name="windowTitle">
<string>MusicBrainz</string>
</property>
@ -31,20 +23,34 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="coverArtArchiveUrlLabel">
<property name="text">
<string>Cover Art Archive URL</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="Widgets::ClearLineEdit" name="coverArtArchiveUrlLineEdit">
<property name="placeholderText">
<string>http://coverartarchive.org</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lyricWikiUrlLabel">
<property name="text">
<string>LyricWiki URL</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lyricWikiUrlLineEdit">
<property name="placeholderText">
<string>https://lyrics.fandom.com</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View File

@ -264,6 +264,7 @@ bool EditorDbQueryOptionsPage::apply()
if (hasBeenShown()) {
auto &settings = values().dbQuery;
settings.musicBrainzUrl = ui()->musicBrainzUrlLineEdit->text();
settings.lyricsWikiaUrl = ui()->lyricWikiUrlLineEdit->text();
settings.coverArtArchiveUrl = ui()->coverArtArchiveUrlLineEdit->text();
}
return true;
@ -274,6 +275,7 @@ void EditorDbQueryOptionsPage::reset()
if (hasBeenShown()) {
const auto &settings = values().dbQuery;
ui()->musicBrainzUrlLineEdit->setText(settings.musicBrainzUrl);
ui()->lyricWikiUrlLineEdit->setText(settings.lyricsWikiaUrl);
ui()->coverArtArchiveUrlLineEdit->setText(settings.coverArtArchiveUrl);
}
}