From ad93adc50b21179c082da72c63812a2316587277 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 15 Sep 2018 22:45:20 +0000 Subject: prepare for cover editor implementation git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8295 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/CMakeLists.txt | 2 + src/qmmpui/covereditor.cpp | 27 ++++++++++++ src/qmmpui/covereditor_p.h | 44 +++++++++++++++++++ src/qmmpui/detailsdialog.cpp | 12 ++++-- src/qmmpui/forms/covereditor.ui | 94 +++++++++++++++++++++++++++++++++++++++++ src/qmmpui/qmmpui.pro | 9 ++-- 6 files changed, 181 insertions(+), 7 deletions(-) create mode 100644 src/qmmpui/covereditor.cpp create mode 100644 src/qmmpui/covereditor_p.h create mode 100644 src/qmmpui/forms/covereditor.ui (limited to 'src/qmmpui') diff --git a/src/qmmpui/CMakeLists.txt b/src/qmmpui/CMakeLists.txt index 501f6deb8..87e2d5b9a 100644 --- a/src/qmmpui/CMakeLists.txt +++ b/src/qmmpui/CMakeLists.txt @@ -56,6 +56,7 @@ SET(libqmmpui_SRCS columneditor.cpp metadatahelper.cpp coverviewer.cpp + covereditor.cpp ) SET(libqmmpui_HDRS @@ -122,6 +123,7 @@ SET(libqmmpui_UIS forms/aboutdialog.ui forms/addurldialog.ui forms/columneditor.ui + forms/covereditor.ui ) QT5_WRAP_UI(libqmmpui_UIS_H ${libqmmpui_UIS}) diff --git a/src/qmmpui/covereditor.cpp b/src/qmmpui/covereditor.cpp new file mode 100644 index 000000000..c6f59acea --- /dev/null +++ b/src/qmmpui/covereditor.cpp @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2018 by Ilya Kotov * + * forkotov02@ya.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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "covereditor_p.h" + +CoverEditor::CoverEditor(QWidget *parent) : + QWidget(parent) +{ + m_ui.setupUi(this); +} diff --git a/src/qmmpui/covereditor_p.h b/src/qmmpui/covereditor_p.h new file mode 100644 index 000000000..5ccbc25ae --- /dev/null +++ b/src/qmmpui/covereditor_p.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2018 by Ilya Kotov * + * forkotov02@ya.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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef COVEREDITOR_P_H +#define COVEREDITOR_P_H + +#include +#include "ui_covereditor.h" + +/** + @internal + @author Ilya Kotov +*/ + +class CoverEditor : public QWidget +{ + Q_OBJECT +public: + explicit CoverEditor(QWidget *parent = 0); + + +private: + Ui::CoverEditor m_ui; + +}; + +#endif // COVEREDITOR_P_H diff --git a/src/qmmpui/detailsdialog.cpp b/src/qmmpui/detailsdialog.cpp index ce91b49b3..c9cacd6a9 100644 --- a/src/qmmpui/detailsdialog.cpp +++ b/src/qmmpui/detailsdialog.cpp @@ -31,7 +31,7 @@ #include "metadataformatter.h" #include "playlisttrack.h" #include "tageditor_p.h" -#include "coverviewer_p.h" +#include "covereditor_p.h" #include "detailsdialog.h" DetailsDialog::DetailsDialog(QList tracks, QWidget *parent) @@ -170,13 +170,17 @@ void DetailsDialog::updatePage() qDeleteAll(infoList); infoList.clear(); - QPixmap cover = MetaDataManager::instance()->getCover(m_info.path()); - if(!cover.isNull()) + //QPixmap cover = MetaDataManager::instance()->getCover(m_info.path()); + /*if(!cover.isNull()) { CoverViewer *coverViewer = new CoverViewer(this); coverViewer->setPixmap(cover); m_ui->tabWidget->addTab(coverViewer, tr("Cover")); - } + }*/ + + CoverEditor *coverEditor = new CoverEditor(this); + m_ui->tabWidget->addTab(coverEditor, tr("Cover")); + if(m_info.path().contains("://")) //URL { diff --git a/src/qmmpui/forms/covereditor.ui b/src/qmmpui/forms/covereditor.ui new file mode 100644 index 000000000..8282a9e1d --- /dev/null +++ b/src/qmmpui/forms/covereditor.ui @@ -0,0 +1,94 @@ + + + CoverEditor + + + + 0 + 0 + 451 + 382 + + + + Cover Editor + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Source + + + + + + File + + + + + + + Tag + + + + + + + + + + Load + + + + + + + Delete + + + + + + + Save as... + + + + + + + Qt::Vertical + + + + 20 + 150 + + + + + + + + + diff --git a/src/qmmpui/qmmpui.pro b/src/qmmpui/qmmpui.pro index 018654cab..f8b44d392 100644 --- a/src/qmmpui/qmmpui.pro +++ b/src/qmmpui/qmmpui.pro @@ -73,7 +73,8 @@ HEADERS += general.h \ metadatahelper_p.h \ coverviewer_p.h \ metadataformattermenu.h \ - qmmpui_export.h + qmmpui_export.h \ + covereditor_p.h SOURCES += general.cpp \ playlistparser.cpp \ @@ -112,7 +113,8 @@ SOURCES += general.cpp \ playlistheadermodel.cpp \ metadatahelper.cpp \ coverviewer.cpp \ - metadataformattermenu.cpp + metadataformattermenu.cpp \ + covereditor.cpp FORMS += forms/detailsdialog.ui \ forms/tageditor.ui \ @@ -121,7 +123,8 @@ FORMS += forms/detailsdialog.ui \ forms/configdialog.ui \ forms/aboutdialog.ui \ forms/addurldialog.ui \ - forms/columneditor.ui + forms/columneditor.ui \ + forms/covereditor.ui unix:DESTDIR = . RESOURCES += translations/libqmmpui_locales.qrc \ -- cgit v1.2.3-13-gbd6f