if (!musicTable->cellWidget(row, 3))
{
- QToolBar* bar = new QToolBar;
- QLabel* up = new QLabel;
- up->setText(QString::fromUtf8("<b><a href='up'>▲</a></b>"));
- up->setStyleSheet("padding-right:3px;");
- up->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- bar->addWidget(up);
- QLabel* down = new QLabel;
- down->setText(QString::fromUtf8("<b><a href='down'>▼</a></b>"));
- down->setStyleSheet("padding-right:3px;");
- bar->addWidget(down);
- QLabel* del = new QLabel;
- del->setText(QString::fromUtf8("<b><a href='del'>╳</a></b>"));
- del->setStyleSheet("padding-right:3px;");
- bar->addWidget(del);
- down->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- bar->setProperty("row", row);
- musicTable->setCellWidget(row, 3, bar);
- connect (up, SIGNAL (linkActivated (const QString&)), this, SLOT (buttonUp ()));
- connect (down, SIGNAL (linkActivated (const QString&)), this, SLOT (buttonDown ()));
- connect (del, SIGNAL (linkActivated (const QString&)), this, SLOT (buttonDel ()));
+ QLabel* label = new QLabel;
+ label->setText(QString::fromUtf8("<b><a style='text-decoration:none' href='up'>▲</a> <a style='text-decoration:none' href='down'>▼</a> <a style='text-decoration:none' href='del'>╳</a> <a style='text-decoration:none' href='info'>i</a></b>"));
+ label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ label->setProperty("row", row);
+ musicTable->setCellWidget(row, 3, label);
+ connect (label, SIGNAL (linkActivated (const QString&)), this, SLOT (playlistControl (const QString&)));
+/* connect (down, SIGNAL (linkActivated (const QString&)), this, SLOT (buttonDown ()));
+ connect (del, SIGNAL (linkActivated (const QString&)), this, SLOT (buttonDel ()));*/
}
}
-void MainWindow::buttonUp()
+void MainWindow::playlistControl (const QString& con)
{
- int i = sender()->parent()->property("row").toInt();
+ int i = sender ()->property("row").toInt();
+ qDebug () << "Playlist control: " << con << " on " << i;
+ if (con == "up")
+ buttonUp(i);
+ else if (con == "down")
+ buttonDown(i);
+ else if (con == "del")
+ buttonDel (i);
+ else
+ QMessageBox::information(this, tr ("Coming up..."), tr ("This feature is not implemented yet."));
+}
+
+
+void MainWindow::buttonUp(int i)
+{
+ //int i = sender()->parent()->property("row").toInt();
qDebug () << "Presses up on " << i;
if (i)
{
}
}
-void MainWindow::buttonDown()
+void MainWindow::buttonDown(int i)
{
- int i = sender()->parent()->property("row").toInt();
qDebug () << "Presses down on " << i;
if (i < plman.size() - 1)
{
}
}
-void MainWindow::buttonDel()
+void MainWindow::buttonDel(int i)
{
- int i = sender()->parent()->property("row").toInt();
qDebug () << "Presses del on " << i;
if (i < plman.size())
{
void removeAllButSelectedItem ();
void highlightRow (int i);
void unhighlightRow (int i);
- void buttonUp ();
- void buttonDown ();
- void buttonDel ();
+
void itemRemoved (int i);
void showOptions ();
+ void playlistControl (const QString&);
protected:
void contextMenuEvent (QContextMenuEvent*e);
void setupUi();
void setupShuffleList();
void setRowFromItem (int row, const PlaylistItem& item);
+ void buttonUp (int i);
+ void buttonDown (int i);
+ void buttonDel (int i);
Phonon::SeekSlider *seekSlider;
Phonon::MediaObject *mediaObject;