mirror of
https://abf.rosa.ru/djam/clementine.git
synced 2025-02-23 15:02:55 +00:00
230 lines
9 KiB
Diff
230 lines
9 KiB
Diff
diff -rupN clementine-20180812.old/src/translations/it.po clementine-20180812/src/translations/it.po
|
|
--- clementine-20180812.old/src/translations/it.po 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/translations/it.po 2018-08-17 17:34:09.298830443 +0200
|
|
@@ -424,6 +424,10 @@ msgstr "GLORIA ALL'IPNOROSPO"
|
|
msgid "Abort"
|
|
msgstr "Interrompi"
|
|
|
|
+#: widgets/nowplayingwidget.cpp:122
|
|
+msgid "Search on metal-archives.com"
|
|
+msgstr "Ricerca su metal-archives.com"
|
|
+
|
|
#: ui/about.cpp:30
|
|
#, qt-format
|
|
msgid "About %1"
|
|
diff -rupN clementine-20180812.old/src/translations/ru.po clementine-20180812/src/translations/ru.po
|
|
--- clementine-20180812.old/src/translations/ru.po 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/translations/ru.po 2018-08-17 17:33:11.622530369 +0200
|
|
@@ -447,6 +447,10 @@ msgstr "СЛАВА ГИПНОЖАБЕ"
|
|
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 -rupN clementine-20180812.old/src/ui/mainwindow.cpp clementine-20180812/src/ui/mainwindow.cpp
|
|
--- clementine-20180812.old/src/ui/mainwindow.cpp 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/ui/mainwindow.cpp 2018-08-17 17:31:03.914294193 +0200
|
|
@@ -36,6 +36,7 @@
|
|
#include <QTimer>
|
|
#include <QUndoStack>
|
|
#include <QtDebug>
|
|
+#include <QDesktopServices>
|
|
|
|
#ifdef Q_OS_WIN32
|
|
#include <qtsparkle/Updater>
|
|
@@ -441,6 +442,8 @@ MainWindow::MainWindow(Application* app,
|
|
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()));
|
|
@@ -704,6 +707,7 @@ MainWindow::MainWindow(Application* app,
|
|
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..."),
|
|
@@ -925,6 +929,9 @@ MainWindow::MainWindow(Application* app,
|
|
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());
|
|
@@ -2836,6 +2843,28 @@ void MainWindow::AutoCompleteTagsAccepte
|
|
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 -rupN clementine-20180812.old/src/ui/mainwindow.h clementine-20180812/src/ui/mainwindow.h
|
|
--- clementine-20180812.old/src/ui/mainwindow.h 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/ui/mainwindow.h 2018-08-17 17:31:53.919820460 +0200
|
|
@@ -178,6 +178,9 @@ signals:
|
|
void PlaylistUndoRedoChanged(QAction* undo, QAction* redo);
|
|
void AddFilesToTranscoder();
|
|
|
|
+ void EnableMA(bool metalarchives);
|
|
+ void SearchMA();
|
|
+
|
|
void SearchForArtist();
|
|
void SearchForAlbum();
|
|
|
|
diff -rupN clementine-20180812.old/src/ui/mainwindow.ui clementine-20180812/src/ui/mainwindow.ui
|
|
--- clementine-20180812.old/src/ui/mainwindow.ui 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/ui/mainwindow.ui 2018-08-17 17:37:36.195731988 +0200
|
|
@@ -536,6 +536,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">
|
|
@@ -754,7 +755,15 @@
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="text">
|
|
- <string comment="Label for buton to enable/disable kittens in the now playing widget">Kittens</string>
|
|
+ <string comment="Label for button 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 button to enable/disable search on metal-archives.com in the now playing widget menu">Encyclopaedia Metallum</string>
|
|
</property>
|
|
</action>
|
|
<action name="action_console">
|
|
@@ -885,6 +894,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 -rupN clementine-20180812.old/src/widgets/nowplayingwidget.cpp clementine-20180812/src/widgets/nowplayingwidget.cpp
|
|
--- clementine-20180812.old/src/widgets/nowplayingwidget.cpp 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/widgets/nowplayingwidget.cpp 2018-08-17 17:40:14.116076702 +0200
|
|
@@ -27,6 +27,7 @@
|
|
#include <QTextDocument>
|
|
#include <QTimeLine>
|
|
#include <QtDebug>
|
|
+#include <QDesktopServices>
|
|
|
|
#include "fullscreenhypnotoad.h"
|
|
#include "core/application.h"
|
|
@@ -68,6 +69,7 @@ NowPlayingWidget::NowPlayingWidget(QWidg
|
|
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),
|
|
@@ -147,6 +149,11 @@ NowPlayingWidget::NowPlayingWidget(QWidg
|
|
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);
|
|
@@ -620,6 +627,10 @@ void NowPlayingWidget::EnableKittens(boo
|
|
aww_ = aww;
|
|
}
|
|
|
|
+void NowPlayingWidget::EnableMA(bool metalarchives) {
|
|
+ metalarchives_action_->setVisible(metalarchives);
|
|
+}
|
|
+
|
|
void NowPlayingWidget::LoadCoverFromFile() {
|
|
album_cover_choice_controller_->LoadCoverFromFile(&metadata_);
|
|
}
|
|
@@ -655,6 +666,10 @@ void NowPlayingWidget::SearchCoverAutoma
|
|
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 -rupN clementine-20180812.old/src/widgets/nowplayingwidget.h clementine-20180812/src/widgets/nowplayingwidget.h
|
|
--- clementine-20180812.old/src/widgets/nowplayingwidget.h 2018-08-14 18:09:55.000000000 +0200
|
|
+++ clementine-20180812/src/widgets/nowplayingwidget.h 2018-08-17 17:41:25.882960988 +0200
|
|
@@ -75,6 +75,7 @@ signals:
|
|
void Stopped();
|
|
void AllHail(bool hypnotoad);
|
|
void EnableKittens(bool aww);
|
|
+ void EnableMA(bool metalarchives);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent* e);
|
|
@@ -105,6 +106,8 @@ signals:
|
|
void UnsetCover();
|
|
void ShowCover();
|
|
void SearchCoverAutomatically();
|
|
+
|
|
+ void SearchMA();
|
|
|
|
void Bask();
|
|
|
|
@@ -130,6 +133,8 @@ signals:
|
|
|
|
QAction* above_statusbar_action_;
|
|
QAction* fit_cover_width_action_;
|
|
+
|
|
+ QAction* metalarchives_action_;
|
|
|
|
bool visible_;
|
|
int small_ideal_height_;
|