Commit 9b9521ca authored by Michael Pyne's avatar Michael Pyne

Port away from K* widgets in cover dialog.

parent cd5bc7a3
......@@ -33,7 +33,7 @@ using CoverUtility::CoverIconViewItem;
class AllArtistsListViewItem : public QListWidgetItem
{
public:
AllArtistsListViewItem(KListWidget *parent) :
AllArtistsListViewItem(QListWidget *parent) :
QListWidgetItem(i18n("<All Artists>"), parent)
{
}
......@@ -48,7 +48,7 @@ public:
class CaseInsensitiveItem : public QListWidgetItem
{
public:
CaseInsensitiveItem(KListWidget *parent, const QString &text) :
CaseInsensitiveItem(QListWidget *parent, const QString &text) :
QListWidgetItem(text, parent)
{
}
......@@ -64,9 +64,9 @@ CoverDialog::CoverDialog(QWidget *parent) :
{
setupUi(this);
setObjectName( QLatin1String("juk_cover_dialog" ));
setObjectName(QLatin1String("juk_cover_dialog"));
m_searchLine->setClearButtonShown(true);
m_searchLine->setClearButtonEnabled(true);
connect(m_artists, SIGNAL(itemClicked(QListWidgetItem*)),
this, SLOT(slotArtistClicked(QListWidgetItem*)));
......
......@@ -15,8 +15,8 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COVERDIALOG_H
#define COVERDIALOG_H
#ifndef JUK_COVERDIALOG_H
#define JUK_COVERDIALOG_H
#include "ui_coverdialogbase.h"
......@@ -43,6 +43,6 @@ private slots:
void removeSelectedCover();
};
#endif /* COVERDIALOG_H */
#endif /* JUK_COVERDIALOG_H */
// vim: set et sw=4 tw=0 sta:
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CoverDialogBase</class>
<widget class="QWidget" name="CoverDialogBase" >
<property name="geometry" >
<widget class="QWidget" name="CoverDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
......@@ -9,61 +10,79 @@
<height>554</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Cover Manager</string>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
<property name="topMargin">
<number>11</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="KListWidget" name="m_artists" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>7</vsizetype>
<widget class="QListWidget" name="m_artists">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>164</width>
<height>0</height>
</size>
</property>
<column>
<property name="text" >
<string>Artist</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="KLineEdit" native="1" name="m_searchLine" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<widget class="QLineEdit" name="m_searchLine">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -73,11 +92,9 @@
</layout>
</item>
<item>
<widget class="CoverIconView" native="1" name="m_covers" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<widget class="CoverIconView" name="m_covers" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -89,16 +106,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KListWidget</class>
<extends>QListWidget</extends>
<header>klistwidget.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QWidget</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>CoverIconView</class>
<extends>QWidget</extends>
......@@ -107,10 +114,8 @@
</customwidget>
</customwidgets>
<includes>
<include location="local" >klineedit.h</include>
<include location="local" >covericonview.h</include>
<include location="local">covericonview.h</include>
</includes>
<resources/>
<connections>
</connections>
<connections/>
</ui>
......@@ -20,7 +20,7 @@
using CoverUtility::CoverIconViewItem;
CoverIconViewItem::CoverIconViewItem(coverKey id, KListWidget *parent) :
CoverIconViewItem::CoverIconViewItem(coverKey id, QListWidget *parent) :
QListWidgetItem(parent), m_id(id)
{
const auto &data = CoverManager::coverInfo(id);
......@@ -29,19 +29,19 @@ CoverIconViewItem::CoverIconViewItem(coverKey id, KListWidget *parent) :
setSizeHint(QSize(140, 150));
}
CoverIconView::CoverIconView(QWidget *parent, const char *name) : KListWidget(parent)
CoverIconView::CoverIconView(QWidget *parent, const char *name) : QListWidget(parent)
{
setObjectName(QLatin1String(name));
setResizeMode(KListWidget::Adjust);
setViewMode(KListWidget::IconMode);
setIconSize(QSize(130, 140));
setMovement(KListWidget::Static);
setResizeMode(QListWidget::Adjust);
setViewMode(QListWidget::IconMode);
setIconSize(QSize(130, 140)); // FIXME: HiDPI
setMovement(QListWidget::Static);
setContextMenuPolicy(Qt::CustomContextMenu);
}
CoverIconViewItem *CoverIconView::currentItem() const
{
return static_cast<CoverIconViewItem *>(KListWidget::currentItem());
return static_cast<CoverIconViewItem *>(QListWidget::currentItem());
}
// vim: set et sw=4 tw=0 sta:
......@@ -15,10 +15,10 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COVERICONVIEW_H
#define COVERICONVIEW_H
#ifndef JUK_COVERICONVIEW_H
#define JUK_COVERICONVIEW_H
#include <klistwidget.h>
#include <QListWidget>
#include "covermanager.h"
......@@ -32,7 +32,7 @@ namespace CoverUtility
class CoverIconViewItem : public QListWidgetItem
{
public:
CoverIconViewItem(coverKey id, KListWidget *parent);
CoverIconViewItem(coverKey id, QListWidget *parent);
coverKey id() const { return m_id; }
......@@ -49,7 +49,7 @@ using CoverUtility::CoverIconViewItem;
*
* @author Michael Pyne <mpyne@kde.org>
*/
class CoverIconView : public KListWidget
class CoverIconView : public QListWidget
{
public:
explicit CoverIconView(QWidget *parent, const char *name = 0);
......@@ -60,6 +60,6 @@ protected:
// virtual Q3DragObject *dragObject();
};
#endif /* COVERICONVIEW_H */
#endif /* JUK_COVERICONVIEW_H */
// vim: set et sw=4 tw=0 sta:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment