From b4d973f837a7713e7681157d4bfb20bd42559169 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 1 Aug 2009 09:27:32 +0000 Subject: added form of the unified details dialog git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1099 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/forms/coverwidget.cpp | 46 ++++++ src/qmmp/forms/coverwidget.h | 50 ++++++ src/qmmp/forms/detailsdialog.ui | 356 ++++++++++++++++++++++++++++++++++++++++ src/ui/playlist.cpp | 3 +- 4 files changed, 453 insertions(+), 2 deletions(-) create mode 100644 src/qmmp/forms/coverwidget.cpp create mode 100644 src/qmmp/forms/coverwidget.h create mode 100644 src/qmmp/forms/detailsdialog.ui (limited to 'src') diff --git a/src/qmmp/forms/coverwidget.cpp b/src/qmmp/forms/coverwidget.cpp new file mode 100644 index 000000000..88379ad50 --- /dev/null +++ b/src/qmmp/forms/coverwidget.cpp @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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 +#include +#include + +#include "coverwidget.h" + +CoverWidget::CoverWidget(QWidget *parent) + : QWidget(parent) +{} + + +CoverWidget::~CoverWidget() +{} + +void CoverWidget::setPixmap(const QPixmap &pixmap) +{ + m_pixmap = pixmap; + update(); +} + +void CoverWidget::paintEvent (QPaintEvent *p) +{ + QPainter paint(this); + if(!m_pixmap.isNull()) + paint.drawPixmap(0,0, m_pixmap.scaled(p->rect().size())); +} + diff --git a/src/qmmp/forms/coverwidget.h b/src/qmmp/forms/coverwidget.h new file mode 100644 index 000000000..b06e66f7e --- /dev/null +++ b/src/qmmp/forms/coverwidget.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * 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 PIXMAPWIDGET_H +#define PIXMAPWIDGET_H + +#include +#include + +/** + @author Ilya Kotov +*/ + +class CoverWidget : public QWidget +{ +Q_OBJECT +public: + CoverWidget(QWidget *parent = 0); + + ~CoverWidget(); + + virtual void setPixmap(const QPixmap&); + +protected: + void paintEvent (QPaintEvent *event); + +private: + QPixmap m_pixmap; + + + +}; + +#endif diff --git a/src/qmmp/forms/detailsdialog.ui b/src/qmmp/forms/detailsdialog.ui new file mode 100644 index 000000000..6e04cb615 --- /dev/null +++ b/src/qmmp/forms/detailsdialog.ui @@ -0,0 +1,356 @@ + + + DetailsDialog + + + + 0 + 0 + 608 + 362 + + + + Dialog + + + + + + + + + + 0 + 0 + + + + + 110 + 110 + + + + + 110 + 110 + + + + + + + + Metadata + + + + + + + 0 + 0 + + + + Title: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Artist: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Album: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Disc number: + + + + + + + ? + + + + + + + + + Composer: + + + + + + + + + + + 0 + 0 + + + + Genre: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Track: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + 0 + 0 + + + + ? + + + + + + + + 0 + 0 + + + + Year: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + ? + + + + + + 2012 + + + + + + + + + + 0 + 0 + + + + Comment: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Audio Properties + + + + + + - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + Qt::Horizontal + + + + 192 + 23 + + + + + + + + QDialogButtonBox::Close|QDialogButtonBox::Save + + + + + + + + CoverWidget + QWidget +
coverwidget.h
+ 1 +
+
+ + +
diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp index 46853d8fb..9bbb493dd 100644 --- a/src/ui/playlist.cpp +++ b/src/ui/playlist.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * + * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -502,7 +502,6 @@ void PlayList::updateList() m_titleBar->showCurrent(); } - PlayListItem *PlayList::currentItem() { return m_playListModel ? m_playListModel->currentItem() : 0; -- cgit v1.2.3-13-gbd6f