clementine/clementine-1.3-metalarchives.patch
Andrey Bondrov ccae5ea2d5 New version 1.3
Swicth to GStreamer 1.0 API
Update BuildRequires and files
Use internal vreen library by default (because of very unstable API)
2016-04-17 01:48:38 +10:00

215 lines
8 KiB
Diff

diff -urN Clementine-1.3/src/translations/ru.po Clementine-1.3-patched/src/translations/ru.po
--- Clementine-1.3/src/translations/ru.po 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/translations/ru.po 2016-04-17 00:17:01.988044677 +1000
@@ -430,6 +430,10 @@
msgid "Abort"
msgstr "Прервать"
+#: widgets/nowplayingwidget.cpp:122
+msgid "Search on metal-archives.com"
+msgstr "Искать на metal-archives.com"
+
#: ui/about.cpp:30
#, qt-format
msgid "About %1"
diff -urN Clementine-1.3/src/ui/mainwindow.cpp Clementine-1.3-patched/src/ui/mainwindow.cpp
--- Clementine-1.3/src/ui/mainwindow.cpp 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/ui/mainwindow.cpp 2016-04-17 00:19:31.945051501 +1000
@@ -36,6 +36,7 @@
#include <QtDebug>
#include <QTimer>
#include <QUndoStack>
+#include <QDesktopServices>
#ifdef Q_OS_WIN32
#include <qtsparkle/Updater>
@@ -419,6 +420,8 @@
connect(ui_->action_edit_value, SIGNAL(triggered()), SLOT(EditValue()));
connect(ui_->action_auto_complete_tags, SIGNAL(triggered()),
SLOT(AutoCompleteTags()));
+ connect(ui_->action_open_metalarchives, SIGNAL(triggered()), SLOT(SearchMA()));
+ ui_->action_open_metalarchives->setVisible(false);
connect(ui_->action_configure, SIGNAL(triggered()),
SLOT(OpenSettingsDialog()));
connect(ui_->action_about, SIGNAL(triggered()), SLOT(ShowAboutDialog()));
@@ -665,6 +668,7 @@
playlist_menu_->addAction(ui_->action_selection_set_value);
playlist_menu_->addAction(ui_->action_auto_complete_tags);
playlist_menu_->addAction(ui_->action_add_files_to_transcoder);
+ playlist_menu_->addAction(ui_->action_open_metalarchives);
playlist_menu_->addSeparator();
playlist_copy_to_library_ = playlist_menu_->addAction(
IconLoader::Load("edit-copy", IconLoader::Base), tr("Copy to library..."),
@@ -884,6 +888,9 @@
SLOT(EnableKittens(bool)));
connect(ui_->action_kittens, SIGNAL(toggled(bool)), app_->network_remote(),
SLOT(EnableKittens(bool)));
+ connect(ui_->action_metalarchives, SIGNAL(toggled(bool)), ui_->now_playing, SLOT(EnableMA(bool)));
+ // and also Encyclopaedia Metallum for main playlist
+ connect(ui_->action_metalarchives, SIGNAL(toggled(bool)), SLOT(EnableMA(bool)));
// Hide the console
// connect(ui_->action_console, SIGNAL(triggered()), SLOT(ShowConsole()));
NowPlayingWidgetPositionChanged(ui_->now_playing->show_above_status_bar());
@@ -2695,6 +2702,28 @@
ui_->playlist->view()->update();
}
+void MainWindow::EnableMA(bool metalarchives) {
+ ui_->action_open_metalarchives->setVisible(metalarchives);
+}
+
+void MainWindow::SearchMA() {
+ QStringList albums;
+ foreach (const QModelIndex& index,
+ ui_->playlist->view()->selectionModel()->selection().indexes()) {
+ if (index.column() != 0)
+ continue;
+ int row = app_->playlist_manager()->current()->proxy()->mapToSource(index).row();
+ PlaylistItemPtr item(app_->playlist_manager()->current()->item_at(row));
+ QString album = item->Metadata().artist() + "/" + item->Metadata().album();
+ if (!albums.contains(album))
+ {
+ QDesktopServices::openUrl(QUrl("http://www.metal-archives.com/albums/" + Qt::escape(album)));
+ albums << album;
+ }
+ }
+
+}
+
QPixmap MainWindow::CreateOverlayedIcon(int position, int scrobble_point) {
QPixmap normal_icon =
IconLoader::Load("as_light", IconLoader::Lastfm).pixmap(16);
diff -urN Clementine-1.3/src/ui/mainwindow.h Clementine-1.3-patched/src/ui/mainwindow.h
--- Clementine-1.3/src/ui/mainwindow.h 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/ui/mainwindow.h 2016-04-17 00:11:20.241029125 +1000
@@ -173,6 +173,9 @@
void PlaylistUndoRedoChanged(QAction* undo, QAction* redo);
void AddFilesToTranscoder();
+ void EnableMA(bool metalarchives);
+ void SearchMA();
+
void PlaylistCopyToLibrary();
void PlaylistMoveToLibrary();
void PlaylistCopyToDevice();
diff -urN Clementine-1.3/src/ui/mainwindow.ui Clementine-1.3-patched/src/ui/mainwindow.ui
--- Clementine-1.3/src/ui/mainwindow.ui 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/ui/mainwindow.ui 2016-04-17 00:17:41.462046473 +1000
@@ -461,6 +461,7 @@
<addaction name="action_hypnotoad"/>
<addaction name="action_enterprise"/>
<addaction name="action_kittens"/>
+ <addaction name="action_metalarchives"/>
<addaction name="separator"/>
</widget>
<widget class="QMenu" name="menu_tools">
@@ -680,6 +681,14 @@
<string comment="Label for buton to enable/disable kittens in the now playing widget">Kittens</string>
</property>
</action>
+ <action name="action_metalarchives">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string comment="Label for buton to enable/disable search on metal-archives.com in the now playing widget menu">Encyclopaedia Metallum</string>
+ </property>
+ </action>
<action name="action_console">
<property name="text">
<string>Console</string>
@@ -808,6 +817,11 @@
<string notr="true">Ctrl+T</string>
</property>
</action>
+ <action name="action_open_metalarchives">
+ <property name="text">
+ <string>Search on metal-archives.com</string>
+ </property>
+ </action>
<action name="action_toggle_scrobbling">
<property name="text">
<string>Toggle scrobbling</string>
diff -urN Clementine-1.3/src/widgets/nowplayingwidget.cpp Clementine-1.3-patched/src/widgets/nowplayingwidget.cpp
--- Clementine-1.3/src/widgets/nowplayingwidget.cpp 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/widgets/nowplayingwidget.cpp 2016-04-17 00:15:49.599041383 +1000
@@ -37,6 +37,7 @@
#include <QTextDocument>
#include <QTimeLine>
#include <QtDebug>
+#include <QDesktopServices>
const char* NowPlayingWidget::kSettingsGroup = "NowPlayingWidget";
@@ -66,6 +67,7 @@
menu_(new QMenu(this)),
above_statusbar_action_(nullptr),
fit_cover_width_action_(nullptr),
+ metalarchives_action_(NULL),
visible_(false),
small_ideal_height_(0),
fit_width_(false),
@@ -145,6 +147,11 @@
above_statusbar_action_->setChecked(
s.value("above_status_bar", false).toBool());
+ menu_->addSeparator();
+ metalarchives_action_ = menu_->addAction(tr("Search on metal-archives.com"));
+ metalarchives_action_->setVisible(false);
+ connect(metalarchives_action_, SIGNAL(triggered()), SLOT(SearchMA()));
+
bask_in_his_glory_action_ =
menu_->addAction(tr("ALL GLORY TO THE HYPNOTOAD"));
bask_in_his_glory_action_->setVisible(false);
@@ -618,6 +625,11 @@
aww_ = aww;
}
+void NowPlayingWidget::EnableMA(bool metalarchives) {
+ metalarchives_action_->setVisible(metalarchives);
+}
+
+
void NowPlayingWidget::LoadCoverFromFile() {
album_cover_choice_controller_->LoadCoverFromFile(&metadata_);
}
@@ -653,6 +665,10 @@
GetCoverAutomatically();
}
+void NowPlayingWidget::SearchMA() {
+ QDesktopServices::openUrl(QUrl("http://www.metal-archives.com/albums/" + Qt::escape(metadata_.artist()) + "/" + Qt::escape(metadata_.album())));
+}
+
void NowPlayingWidget::Bask() {
QDesktopWidget desktop;
int current_screen = desktop.screenNumber(this);
diff -urN Clementine-1.3/src/widgets/nowplayingwidget.h Clementine-1.3-patched/src/widgets/nowplayingwidget.h
--- Clementine-1.3/src/widgets/nowplayingwidget.h 2016-04-15 23:26:04.000000000 +1000
+++ Clementine-1.3-patched/src/widgets/nowplayingwidget.h 2016-04-17 00:11:20.243029125 +1000
@@ -75,6 +75,7 @@
void Stopped();
void AllHail(bool hypnotoad);
void EnableKittens(bool aww);
+ void EnableMA(bool metalarchives);
protected:
void paintEvent(QPaintEvent* e);
@@ -106,6 +107,8 @@
void ShowCover();
void SearchCoverAutomatically();
+ void SearchMA();
+
void Bask();
void AutomaticCoverSearchDone();
@@ -131,6 +134,8 @@
QAction* above_statusbar_action_;
QAction* fit_cover_width_action_;
+ QAction* metalarchives_action_;
+
bool visible_;
int small_ideal_height_;
AlbumCoverLoaderOptions cover_loader_options_;