diff options
| -rw-r--r-- | src/plugins/General/covermanager/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/covermanager.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/covermanager.pro | 28 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/coverwidget.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/coverwindow.cpp | 34 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/coverwindow.h | 39 | ||||
| -rw-r--r-- | src/plugins/General/covermanager/coverwindow.ui | 230 |
7 files changed, 24 insertions, 327 deletions
diff --git a/src/plugins/General/covermanager/CMakeLists.txt b/src/plugins/General/covermanager/CMakeLists.txt index 1b32f03c2..5c7d7e2de 100644 --- a/src/plugins/General/covermanager/CMakeLists.txt +++ b/src/plugins/General/covermanager/CMakeLists.txt @@ -32,14 +32,12 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libcovermanager_SRCS coverwidget.cpp covermanager.cpp - coverwindow.cpp covermanagerfactory.cpp ) SET(libcovermanager_MOC_HDRS coverwidget.h covermanager.h - coverwindow.h covermanagerfactory.h ) @@ -53,7 +51,6 @@ QT4_WRAP_CPP(libcovermanager_MOC_SRCS ${libcovermanager_MOC_HDRS}) SET(libcovermanager_UIS - coverwindow.ui ) QT4_WRAP_UI(libcovermanager_UIS_H ${libcovermanager_UIS}) diff --git a/src/plugins/General/covermanager/covermanager.cpp b/src/plugins/General/covermanager/covermanager.cpp index ab4303c8e..b5d149cbf 100644 --- a/src/plugins/General/covermanager/covermanager.cpp +++ b/src/plugins/General/covermanager/covermanager.cpp @@ -19,12 +19,14 @@ ***************************************************************************/ #include <QAction> +#include <QApplication> #include <qmmpui/generalhandler.h> #include <qmmpui/playlistmodel.h> #include <qmmpui/playlistitem.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/generalhandler.h> -#include "coverwindow.h" +#include <qmmp/metadatamanager.h> +#include "coverwidget.h" #include "covermanager.h" CoverManager::CoverManager(QObject *parent) : General(parent) @@ -40,9 +42,11 @@ void CoverManager::showWindow() QList <PlayListItem *> items = MediaPlayer::instance()->playListManager()->selectedPlayList()->getSelectedItems(); if (!items.isEmpty()) { - if (items.at(0)->url().contains("://")) - return; - CoverWindow *w = new CoverWindow(items.at(0), qApp->activeWindow ()); + CoverWidget *w = new CoverWidget(qApp->activeWindow ()); + w->setFixedSize(400,400); + QPixmap pix = MetaDataManager::instance()->getCover(items.at(0)->url()); + w->setPixmap(pix); + w->setWindowTitle(items.at(0)->artist() + " - " + items.at(0)->album()); w->show(); } } diff --git a/src/plugins/General/covermanager/covermanager.pro b/src/plugins/General/covermanager/covermanager.pro index d084eaada..e618330c0 100644 --- a/src/plugins/General/covermanager/covermanager.pro +++ b/src/plugins/General/covermanager/covermanager.pro @@ -7,18 +7,16 @@ unix:QMAKE_LIBDIR += ../../../../lib win32:QMAKE_LIBDIR += ../../../../bin TARGET = $$PLUGINS_PREFIX/General/covermanager unix:QMAKE_CLEAN = $$PLUGINS_PREFIX/General/libcovermanager.so - TRANSLATIONS = translations/covermanager_plugin_cs.ts \ -translations/covermanager_plugin_de.ts \ -translations/covermanager_plugin_zh_CN.ts \ -translations/covermanager_plugin_zh_TW.ts \ -translations/covermanager_plugin_ru.ts \ -translations/covermanager_plugin_pl.ts \ -translations/covermanager_plugin_uk_UA.ts \ -translations/covermanager_plugin_it.ts \ -translations/covermanager_plugin_tr.ts \ -translations/covermanager_plugin_lt.ts - + translations/covermanager_plugin_de.ts \ + translations/covermanager_plugin_zh_CN.ts \ + translations/covermanager_plugin_zh_TW.ts \ + translations/covermanager_plugin_ru.ts \ + translations/covermanager_plugin_pl.ts \ + translations/covermanager_plugin_uk_UA.ts \ + translations/covermanager_plugin_it.ts \ + translations/covermanager_plugin_tr.ts \ + translations/covermanager_plugin_lt.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib @@ -27,17 +25,15 @@ unix { } HEADERS += covermanagerfactory.h \ coverwidget.h \ - covermanager.h \ - coverwindow.h + covermanager.h win32:HEADERS += ../../../../src/qmmpui/general.h SOURCES += covermanagerfactory.cpp \ coverwidget.cpp \ - covermanager.cpp \ - coverwindow.cpp + covermanager.cpp QT += network INCLUDEPATH += ../../../ unix:LIBS += -lqmmpui \ -lqmmp win32:LIBS += -lqmmpui0 \ -lqmmp0 -FORMS += coverwindow.ui +FORMS += diff --git a/src/plugins/General/covermanager/coverwidget.cpp b/src/plugins/General/covermanager/coverwidget.cpp index 28e4e8b91..56f2b0436 100644 --- a/src/plugins/General/covermanager/coverwidget.cpp +++ b/src/plugins/General/covermanager/coverwidget.cpp @@ -25,7 +25,10 @@ CoverWidget::CoverWidget(QWidget *parent) : QWidget(parent) -{} +{ + setWindowFlags(Qt::Window); + setAttribute(Qt::WA_DeleteOnClose, TRUE); +} CoverWidget::~CoverWidget() {} diff --git a/src/plugins/General/covermanager/coverwindow.cpp b/src/plugins/General/covermanager/coverwindow.cpp deleted file mode 100644 index 5bec3c497..000000000 --- a/src/plugins/General/covermanager/coverwindow.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include <qmmp/metadatamanager.h> -#include <qmmpui/playlistitem.h> -#include "coverwindow.h" - -CoverWindow::CoverWindow(PlayListItem *item, QWidget *parent) : QDialog(parent) -{ - ui.setupUi(this); - setWindowFlags(Qt::Dialog); - setAttribute(Qt::WA_DeleteOnClose); - setAttribute(Qt::WA_QuitOnClose, FALSE); - ui.coverWidget->setPixmap(MetaDataManager::instance()->getCover(item->url())); - ui.albumEdit->setText(item->album()); - ui.artistEdit->setText(item->artist()); -} diff --git a/src/plugins/General/covermanager/coverwindow.h b/src/plugins/General/covermanager/coverwindow.h deleted file mode 100644 index 98bef1806..000000000 --- a/src/plugins/General/covermanager/coverwindow.h +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef COVERWINDOW_H -#define COVERWINDOW_H - -#include <QDialog> -#include "ui_coverwindow.h" - -class PlayListItem; - -class CoverWindow : public QDialog -{ -Q_OBJECT -public: - CoverWindow(PlayListItem *item, QWidget *parent); - -private: - Ui::CoverWindow ui; -}; - -#endif // COVERWINDOW_H diff --git a/src/plugins/General/covermanager/coverwindow.ui b/src/plugins/General/covermanager/coverwindow.ui deleted file mode 100644 index 90987e647..000000000 --- a/src/plugins/General/covermanager/coverwindow.ui +++ /dev/null @@ -1,230 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>CoverWindow</class> - <widget class="QDialog" name="CoverWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>356</width> - <height>389</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Cover Manager</string> - </property> - <property name="sizeGripEnabled"> - <bool>false</bool> - </property> - <property name="modal"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> - </property> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <item row="0" column="0" colspan="2"> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Album:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="albumEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Artist:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="artistEdit"/> - </item> - </layout> - </item> - <item row="1" column="0" colspan="2"> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0" rowspan="7"> - <widget class="QGroupBox" name="groupBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Preview</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="CoverWidget" name="coverWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>1</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>250</width> - <height>250</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>250</width> - <height>250</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>220</width> - <height>220</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="openButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Open</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QPushButton" name="downloadButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Download</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QPushButton" name="removeButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Remove</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="1"> - <spacer name="horizontalSpacer_2"> - <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 row="2" column="1"> - <widget class="QPushButton" name="saveAsButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Save as...</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>128</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="1"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Close|QDialogButtonBox::Save</set> - </property> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>CoverWidget</class> - <extends>QWidget</extends> - <header>coverwidget.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>CoverWindow</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>349</x> - <y>382</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> |
