Commit 4bc46db7 authored by Frerich Raabe's avatar Frerich Raabe

- Made the move up / down buttons do something

svn path=/trunk/kdemultimedia/juk/; revision=214446
parent eab7a760
......@@ -38,6 +38,8 @@ TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
this, SLOT(slotCurrentChanged(QListViewItem *)));
connect(m_child->lvSchemes, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)),
this, SLOT(slotRenameItem(QListViewItem *, const QPoint &, int)));
connect(m_child->bMoveUp, SIGNAL(clicked()), this, SLOT(slotMoveUpClicked()));
connect(m_child->bMoveDown, SIGNAL(clicked()), this, SLOT(slotMoveDownClicked()));
connect(m_child->bAdd, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
connect(m_child->bModify, SIGNAL(clicked()), this, SLOT(slotModifyClicked()));
connect(m_child->bRemove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
......@@ -67,6 +69,25 @@ void TagGuesserConfigDlg::slotRenameItem(QListViewItem *item, const QPoint &, in
m_child->lvSchemes->rename(item, c);
}
void TagGuesserConfigDlg::slotMoveUpClicked()
{
QListViewItem *item = m_child->lvSchemes->currentItem();
if(item->itemAbove() == m_child->lvSchemes->firstChild())
item->itemAbove()->moveItem(item);
else
item->moveItem(item->itemAbove()->itemAbove());
m_child->lvSchemes->ensureItemVisible(item);
slotCurrentChanged(item);
}
void TagGuesserConfigDlg::slotMoveDownClicked()
{
QListViewItem *item = m_child->lvSchemes->currentItem();
item->moveItem(item->itemBelow());
m_child->lvSchemes->ensureItemVisible(item);
slotCurrentChanged(item);
}
void TagGuesserConfigDlg::slotAddClicked()
{
KListViewItem *item = new KListViewItem(m_child->lvSchemes);
......
......@@ -26,6 +26,8 @@ class TagGuesserConfigDlg : public KDialogBase
private slots:
void slotCurrentChanged(QListViewItem *item);
void slotRenameItem(QListViewItem *item, const QPoint &p, int c);
void slotMoveUpClicked();
void slotMoveDownClicked();
void slotAddClicked();
void slotModifyClicked();
void slotRemoveClicked();
......
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