Commit b6d87bc1 authored by Scott Wheeler's avatar Scott Wheeler

Got inline editing mostly done.

svn path=/trunk/kdemultimedia/juk/; revision=202984
parent 1a4439ce
......@@ -98,9 +98,9 @@ void JuK::setupActions()
KStdAction::quit(this, SLOT(close()), actionCollection());
// edit menu
KStdAction::cut(splitter, SLOT(clearSelectedItems()), actionCollection());
KStdAction::copy(this, SLOT(copy()), actionCollection());
KStdAction::paste(this, SLOT(paste()), actionCollection());
KStdAction::cut(this, SLOT(cut()), actionCollection());
KStdAction::copy(splitter, SLOT(copy()), actionCollection());
KStdAction::paste(splitter, SLOT(paste()), actionCollection());
KStdAction::selectAll(splitter, SLOT(selectAll()), actionCollection());
// view menu
......
......@@ -68,8 +68,7 @@ private slots:
void updatePlaylistInfo();
// edit menu
void copy() {};
void paste() {};
void cut() { splitter->copy(); splitter->clear(); }
// player menu
void playFile();
......
......@@ -151,7 +151,7 @@ void Playlist::saveAs()
playlistFileName = KFileDialog::getSaveFileName(QString::null,
splitter->extensionsString(splitter->playlistExtensions(),
i18n("Playlists")));
i18n("Playlists")));
playlistFileName = playlistFileName.stripWhiteSpace();
internalFile = false;
......@@ -441,7 +441,9 @@ void Playlist::setup()
setRenameable(PlaylistItem::TrackColumn, true);
setRenameable(PlaylistItem::ArtistColumn, true);
setRenameable(PlaylistItem::AlbumColumn, true);
setRenameable(PlaylistItem::TrackNumberColumn, true);
setRenameable(PlaylistItem::GenreColumn, true);
setRenameable(PlaylistItem::YearColumn, true);
setAllColumnsShowFocus(true);
setSelectionMode(QListView::Extended);
......@@ -494,7 +496,9 @@ void Playlist::showRMBMenu(QListViewItem *item, const QPoint &point, int column)
(column == PlaylistItem::TrackColumn) ||
(column == PlaylistItem::ArtistColumn) ||
(column == PlaylistItem::AlbumColumn) ||
(column == PlaylistItem::GenreColumn);
(column == PlaylistItem::TrackNumberColumn) ||
(column == PlaylistItem::GenreColumn) ||
(column == PlaylistItem::YearColumn);
rmbMenu->setItemVisible(rmbEditID, showEdit);
......@@ -549,9 +553,25 @@ void Playlist::applyTags(QListViewItem *item, const QString &text, int column)
case PlaylistItem::AlbumColumn:
i->tag()->setAlbum(text);
break;
case PlaylistItem::TrackNumberColumn:
{
bool ok;
int value = text.toInt(&ok);
if(ok)
i->tag()->setTrackNumber(value);
break;
}
case PlaylistItem::GenreColumn:
i->tag()->setGenre(text);
break;
case PlaylistItem::YearColumn:
{
bool ok;
int value = text.toInt(&ok);
if(ok)
i->tag()->setYear(value);
break;
}
}
i->tag()->save();
......
......@@ -156,6 +156,12 @@ public slots:
*/
void save() { editor->save(); }
// Edit slots
void copy() {}
void paste() {}
void clear() { clearSelectedItems(); }
// Playlist slots
/**
......
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