Add a source column to the playlist view with appropriate icons.

This commit is contained in:
John Maguire 2012-01-04 11:50:19 +00:00
parent 7e60907578
commit bcf9475f2b
19 changed files with 233 additions and 135 deletions

View File

@ -552,6 +552,14 @@ void Player::UnregisterUrlHandler(UrlHandler* handler) {
this, SLOT(HandleLoadResult(UrlHandler::LoadResult)));
}
const UrlHandler* Player::HandlerForUrl(const QUrl& url) const {
QMap<QString, UrlHandler*>::const_iterator it = url_handlers_.constFind(url.scheme());
if (it == url_handlers_.constEnd()) {
return NULL;
}
return *it;
}
void Player::UrlHandlerDestroyed(QObject* object) {
UrlHandler* handler = static_cast<UrlHandler*>(object);
const QString scheme = url_handlers_.key(handler);

View File

@ -123,6 +123,8 @@ public:
void RegisterUrlHandler(UrlHandler* handler);
void UnregisterUrlHandler(UrlHandler* handler);
const UrlHandler* HandlerForUrl(const QUrl& url) const;
public slots:
void ReloadSettings();

View File

@ -27,3 +27,7 @@ UrlHandler::UrlHandler(QObject* parent)
: QObject(parent)
{
}
QIcon UrlHandler::icon() const {
return QIcon();
}

View File

@ -18,6 +18,7 @@
#ifndef URLHANDLER_H
#define URLHANDLER_H
#include <QIcon>
#include <QObject>
#include <QUrl>
@ -29,6 +30,7 @@ public:
// The URL scheme that this handler handles.
virtual QString scheme() const = 0;
virtual QIcon icon() const;
// Returned by StartLoading() and LoadNext(), indicates what the player
// should do when it wants to load a URL.

View File

@ -28,6 +28,7 @@ public:
DigitallyImportedUrlHandler(DigitallyImportedServiceBase* service);
QString scheme() const;
QIcon icon() const { return QIcon(":providers/digitallyimported.png"); }
LoadResult StartLoading(const QUrl& url);
void CancelTask();

View File

@ -29,6 +29,7 @@ public:
GroovesharkUrlHandler(GroovesharkService* service, QObject* parent);
QString scheme() const { return "grooveshark"; }
QIcon icon() const { return QIcon(":providers/grooveshark.png"); }
LoadResult StartLoading(const QUrl& url);
void TrackAboutToEnd();
void TrackSkipped();

View File

@ -30,6 +30,7 @@ public:
LastFMUrlHandler(LastFMService* service, QObject* parent);
QString scheme() const { return "lastfm"; }
QIcon icon() const { return QIcon(":last.fm/as.png"); }
LoadResult StartLoading(const QUrl& url);
LoadResult LoadNext(const QUrl& url);

View File

@ -28,6 +28,7 @@ public:
MagnatuneUrlHandler(MagnatuneService* service, QObject* parent);
QString scheme() const { return "magnatune"; }
QIcon icon() const { return QIcon(":providers/magnatune.png"); }
LoadResult StartLoading(const QUrl& url);
private:

View File

@ -30,6 +30,7 @@ public:
SomaFMUrlHandler(SomaFMService* service, QObject* parent);
QString scheme() const { return "somafm"; }
QIcon icon() const { return QIcon(":providers/somafm.png"); }
LoadResult StartLoading(const QUrl& url);
private slots:

View File

@ -25,6 +25,7 @@
#include <QFileInfo>
#include <QMenu>
#include <QMessageBox>
#include <QMimeData>
#include <QProcess>
#include <QSettings>
#include <QVariant>
@ -611,6 +612,10 @@ void SpotifyService::ItemDoubleClicked(QStandardItem* item) {
}
}
void SpotifyService::DropMimeData(const QMimeData* data, const QModelIndex& index) {
qLog(Debug) << Q_FUNC_INFO << data->urls();
}
void SpotifyService::LoadImage(const QString& id) {
EnsureServerCreated();
server_->LoadImage(id);

View File

@ -54,6 +54,7 @@ public:
void LazyPopulate(QStandardItem* parent);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
void ItemDoubleClicked(QStandardItem* item);
void DropMimeData(const QMimeData* data, const QModelIndex& index);
PlaylistItem::Options playlistitem_options() const;
void Logout();

View File

@ -280,6 +280,9 @@ QVariant Playlist::data(const QModelIndex& index, int role) const {
if (role == Qt::DisplayRole)
return song.comment().simplified();
return song.comment();
case Column_Source:
return item->Url();
}
}
@ -1094,6 +1097,7 @@ bool Playlist::CompareItems(int column, Qt::SortOrder order,
case Column_DateCreated: cmp(ctime);
case Column_Comment: strcmp(comment);
case Column_Source: cmp(url);
}
#undef cmp
@ -1132,6 +1136,7 @@ QString Playlist::column_name(Column column) {
case Column_DateCreated: return tr("Date created");
case Column_Comment: return tr("Comment");
case Column_Source: return tr("Source");
default: return QString();
}
return "";

View File

@ -109,6 +109,8 @@ class Playlist : public QAbstractListModel {
Column_Comment,
Column_Source,
ColumnCount
};

View File

@ -18,6 +18,7 @@
#include "playlistdelegates.h"
#include "queue.h"
#include "core/logging.h"
#include "core/player.h"
#include "core/utilities.h"
#include "library/librarybackend.h"
#include "widgets/trackslider.h"
@ -433,3 +434,39 @@ QString NativeSeparatorsDelegate::displayText(const QVariant& value, const QLoca
}
return QDir::toNativeSeparators(text);
}
SongSourceDelegate::SongSourceDelegate(QObject* parent, Player* player)
: PlaylistDelegateBase(parent),
player_(player) {
}
QString SongSourceDelegate::displayText(const QVariant& value, const QLocale&) const {
return "";
}
void SongSourceDelegate::paint(
QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
PlaylistDelegateBase::paint(painter, option, index);
QStyleOptionViewItem option_copy(option);
initStyleOption(&option_copy, index);
QIcon icon;
const QUrl& url = index.data().toUrl();
const UrlHandler* handler = player_->HandlerForUrl(url);
if (handler) {
icon = handler->icon();
} else {
if (url.scheme() == "spotify") {
icon = IconLoader::Load("spotify");
} else if (url.scheme() == "file") {
icon = IconLoader::Load("folder-sound");
}
}
QPixmap pixmap = icon.pixmap(option_copy.decorationSize.height());
const int margin = (option_copy.rect.width() - pixmap.width()) / 2;
QRect draw_rect(
margin + option_copy.rect.x(),
option_copy.rect.y(),
option_copy.decorationSize.width(),
option_copy.decorationSize.height());
painter->drawPixmap(draw_rect, pixmap);
}

View File

@ -22,10 +22,12 @@
#include "library/library.h"
#include "widgets/ratingwidget.h"
#include <QCompleter>
#include <QStringListModel>
#include <QStyledItemDelegate>
#include <QTreeView>
#include <QStringListModel>
#include <QCompleter>
class Player;
class QueuedItemDelegate : public QStyledItemDelegate {
public:
@ -169,9 +171,19 @@ class TagCompletionItemDelegate : public PlaylistDelegateBase {
};
class NativeSeparatorsDelegate : public PlaylistDelegateBase {
public:
public:
NativeSeparatorsDelegate(QObject* parent) : PlaylistDelegateBase(parent) {}
QString displayText(const QVariant& value, const QLocale& locale) const;
};
class SongSourceDelegate : public PlaylistDelegateBase {
public:
SongSourceDelegate(QObject* parent, Player* player);
QString displayText(const QVariant& value, const QLocale& locale) const;
void paint(QPainter* paint, const QStyleOptionViewItem& option, const QModelIndex& index) const;
private:
Player* player_;
};
#endif // PLAYLISTDELEGATES_H

View File

@ -102,7 +102,8 @@ PlaylistView::PlaylistView(QWidget *parent)
cached_current_row_row_(-1),
drop_indicator_row_(-1),
drag_over_(false),
dynamic_controls_(new DynamicPlaylistControls(this))
dynamic_controls_(new DynamicPlaylistControls(this)),
player_(NULL)
{
setHeader(header_);
header_->setMovable(true);
@ -139,6 +140,7 @@ PlaylistView::PlaylistView(QWidget *parent)
}
void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
Q_ASSERT(player_);
rating_delegate_ = new RatingItemDelegate(this);
setItemDelegate(new PlaylistDelegateBase(this));
@ -164,6 +166,7 @@ void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this));
setItemDelegateForColumn(Playlist::Column_Rating, rating_delegate_);
setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this));
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, player_));
}
void PlaylistView::SetPlaylist(Playlist* playlist) {

View File

@ -30,6 +30,7 @@ class QCleanlooksStyle;
class DynamicPlaylistControls;
class LibraryBackend;
class Player;
class PlaylistHeader;
class RadioLoadingIndicator;
class RatingItemDelegate;
@ -72,6 +73,7 @@ class PlaylistView : public QTreeView {
void RemoveSelected();
void SetReadOnlySettings(bool read_only) { read_only_settings_ = read_only; }
void SetPlayer(Player* player) { player_ = player; }
Playlist* playlist() const { return playlist_; }
bool background_enabled() const { return background_enabled_; }
@ -201,6 +203,7 @@ class PlaylistView : public QTreeView {
DynamicPlaylistControls* dynamic_controls_;
ColumnAlignmentMap column_alignment_;
Player* player_;
};
#endif // PLAYLISTVIEW_H

View File

@ -349,7 +349,7 @@ msgstr "加入其它的網路串流"
msgid "Add directory..."
msgstr "匯入目錄..."
#: ui/mainwindow.cpp:1569
#: ui/mainwindow.cpp:1570
msgid "Add file"
msgstr ""
@ -361,7 +361,7 @@ msgstr "匯入檔案..."
msgid "Add files to transcode"
msgstr "匯入檔案以便轉碼"
#: ui/mainwindow.cpp:1594
#: ui/mainwindow.cpp:1595
msgid "Add folder"
msgstr "匯入資料夾"
@ -429,15 +429,15 @@ msgstr ""
msgid "Add stream..."
msgstr "加入網路串流..."
#: internet/groovesharkservice.cpp:1002
#: internet/groovesharkservice.cpp:1013
msgid "Add to Grooveshark favorites"
msgstr ""
#: internet/groovesharkservice.cpp:1008
#: internet/groovesharkservice.cpp:1019
msgid "Add to Grooveshark playlists"
msgstr ""
#: ui/mainwindow.cpp:1398
#: ui/mainwindow.cpp:1399
msgid "Add to another playlist"
msgstr "加入到其他播放清單"
@ -479,7 +479,7 @@ msgstr "今天加入"
msgid "Added within three months"
msgstr "在三個月內加入"
#: internet/groovesharkservice.cpp:1253
#: internet/groovesharkservice.cpp:1265
msgid "Adding song to favorites"
msgstr ""
@ -491,7 +491,7 @@ msgstr "進階歸類..."
msgid "After copying..."
msgstr "複製後 ..."
#: playlist/playlist.cpp:1109 ui/organisedialog.cpp:52
#: playlist/playlist.cpp:1113 ui/organisedialog.cpp:52
#: ui/qtsystemtrayicon.cpp:252 ../bin/src/ui_groupbydialog.h:129
#: ../bin/src/ui_groupbydialog.h:142 ../bin/src/ui_groupbydialog.h:155
#: ../bin/src/ui_albumcoversearcher.h:110
@ -504,7 +504,7 @@ msgstr "專輯"
msgid "Album (ideal loudness for all tracks)"
msgstr "專輯 (為所有歌曲取得理想音量)"
#: playlist/playlist.cpp:1115 ui/organisedialog.cpp:55
#: playlist/playlist.cpp:1119 ui/organisedialog.cpp:55
#: ../bin/src/ui_edittagdialog.h:658
msgid "Album artist"
msgstr "專輯演出者"
@ -638,7 +638,7 @@ msgstr "使用壓縮,以防止截波失真"
msgid "Are you sure you want to delete the \"%1\" preset?"
msgstr ""
#: internet/groovesharkservice.cpp:1177
#: internet/groovesharkservice.cpp:1188
msgid "Are you sure you want to delete this playlist?"
msgstr ""
@ -646,7 +646,7 @@ msgstr ""
msgid "Are you sure you want to reset this song's statistics?"
msgstr ""
#: playlist/playlist.cpp:1108 ui/organisedialog.cpp:53
#: playlist/playlist.cpp:1112 ui/organisedialog.cpp:53
#: ui/qtsystemtrayicon.cpp:250 ../bin/src/ui_groupbydialog.h:130
#: ../bin/src/ui_groupbydialog.h:143 ../bin/src/ui_groupbydialog.h:156
#: ../bin/src/ui_albumcoversearcher.h:106
@ -714,7 +714,7 @@ msgstr ""
msgid "Average image size"
msgstr ""
#: playlist/playlist.cpp:1124 ui/organisedialog.cpp:59
#: playlist/playlist.cpp:1128 ui/organisedialog.cpp:59
#: ../bin/src/ui_edittagdialog.h:638
msgid "BPM"
msgstr ""
@ -760,7 +760,7 @@ msgstr ""
msgid "Biography from %1"
msgstr ""
#: playlist/playlist.cpp:1125 ../bin/src/ui_edittagdialog.h:640
#: playlist/playlist.cpp:1129 ../bin/src/ui_edittagdialog.h:640
msgid "Bit rate"
msgstr "位元率"
@ -839,7 +839,7 @@ msgstr ""
msgid "Change the language"
msgstr "變更語言"
#: ui/mainwindow.cpp:596
#: ui/mainwindow.cpp:597
msgid "Check for updates..."
msgstr "檢查更新..."
@ -980,7 +980,7 @@ msgstr ""
msgid "Comma separated list of class:level, level is 0-3"
msgstr ""
#: playlist/playlist.cpp:1134 smartplaylists/searchterm.cpp:279
#: playlist/playlist.cpp:1138 smartplaylists/searchterm.cpp:279
#: ui/organisedialog.cpp:62 ../bin/src/ui_edittagdialog.h:661
msgid "Comment"
msgstr "評論"
@ -993,13 +993,13 @@ msgstr ""
msgid "Complete tags automatically..."
msgstr ""
#: playlist/playlist.cpp:1116 ui/organisedialog.cpp:56
#: playlist/playlist.cpp:1120 ui/organisedialog.cpp:56
#: ../bin/src/ui_groupbydialog.h:132 ../bin/src/ui_groupbydialog.h:145
#: ../bin/src/ui_groupbydialog.h:158 ../bin/src/ui_edittagdialog.h:659
msgid "Composer"
msgstr "作曲家"
#: internet/groovesharkservice.cpp:504
#: internet/groovesharkservice.cpp:510
msgid "Configure Grooveshark..."
msgstr ""
@ -1007,7 +1007,7 @@ msgstr ""
msgid "Configure Last.fm..."
msgstr "配置 Last.fm..."
#: internet/magnatuneservice.cpp:275
#: internet/magnatuneservice.cpp:277
msgid "Configure Magnatune..."
msgstr "配置 Magnatune ..."
@ -1015,11 +1015,11 @@ msgstr "配置 Magnatune ..."
msgid "Configure Shortcuts"
msgstr "設定快速鍵"
#: internet/spotifyservice.cpp:491
#: internet/spotifyservice.cpp:492
msgid "Configure Spotify..."
msgstr ""
#: ui/mainwindow.cpp:490
#: ui/mainwindow.cpp:491
msgid "Configure library..."
msgstr "設定音樂庫"
@ -1036,7 +1036,7 @@ msgstr "連結 Wii 遙控器可以使用作用 /取消作用功能"
msgid "Connect device"
msgstr ""
#: internet/spotifyservice.cpp:246
#: internet/spotifyservice.cpp:247
msgid "Connecting to Spotify"
msgstr ""
@ -1052,16 +1052,16 @@ msgstr ""
msgid "Convert any music that the device can't play"
msgstr ""
#: internet/groovesharkservice.cpp:1055
#: internet/groovesharkservice.cpp:1066
msgid "Copy to clipboard"
msgstr ""
#: library/libraryview.cpp:265 ui/mainwindow.cpp:523
#: library/libraryview.cpp:265 ui/mainwindow.cpp:524
#: widgets/fileviewlist.cpp:43
msgid "Copy to device..."
msgstr "複製到裝置..."
#: devices/deviceview.cpp:223 ui/mainwindow.cpp:520
#: devices/deviceview.cpp:223 ui/mainwindow.cpp:521
#: widgets/fileviewlist.cpp:38
msgid "Copy to library..."
msgstr "複製到音樂庫"
@ -1132,7 +1132,7 @@ msgstr ""
msgid "Covers from %1"
msgstr ""
#: internet/groovesharkservice.cpp:485 internet/groovesharkservice.cpp:1128
#: internet/groovesharkservice.cpp:489 internet/groovesharkservice.cpp:1139
msgid "Create a new Grooveshark playlist"
msgstr ""
@ -1240,11 +1240,11 @@ msgstr ""
msgid "Dance"
msgstr "舞蹈"
#: playlist/playlist.cpp:1132 ../bin/src/ui_edittagdialog.h:649
#: playlist/playlist.cpp:1136 ../bin/src/ui_edittagdialog.h:649
msgid "Date created"
msgstr "創建的日期"
#: playlist/playlist.cpp:1131 ../bin/src/ui_edittagdialog.h:648
#: playlist/playlist.cpp:1135 ../bin/src/ui_edittagdialog.h:648
msgid "Date modified"
msgstr "修改的日期"
@ -1272,12 +1272,12 @@ msgstr "預設"
msgid "Delay between visualizations"
msgstr "在兩個視覺化效果間延遲切換"
#: internet/groovesharkservice.cpp:488 internet/groovesharkservice.cpp:1176
#: internet/groovesharkservice.cpp:492 internet/groovesharkservice.cpp:1187
msgid "Delete Grooveshark playlist"
msgstr ""
#: devices/deviceview.cpp:393 library/libraryview.cpp:460
#: ui/mainwindow.cpp:1829 widgets/fileview.cpp:185
#: ui/mainwindow.cpp:1830 widgets/fileview.cpp:185
msgid "Delete files"
msgstr ""
@ -1285,7 +1285,7 @@ msgstr ""
msgid "Delete from device..."
msgstr ""
#: library/libraryview.cpp:267 ui/mainwindow.cpp:524
#: library/libraryview.cpp:267 ui/mainwindow.cpp:525
#: widgets/fileviewlist.cpp:44
msgid "Delete from disk..."
msgstr "從硬碟中刪除 ..."
@ -1306,11 +1306,11 @@ msgstr "刪除原本的檔案"
msgid "Deleting files"
msgstr ""
#: ui/mainwindow.cpp:1334
#: ui/mainwindow.cpp:1335
msgid "Dequeue selected tracks"
msgstr "將選取的歌曲移出佇列中"
#: ui/mainwindow.cpp:1332
#: ui/mainwindow.cpp:1333
msgid "Dequeue track"
msgstr "將歌曲移出佇列中"
@ -1375,7 +1375,7 @@ msgstr ""
msgid "Disabled"
msgstr "停用"
#: playlist/playlist.cpp:1112 ui/organisedialog.cpp:58
#: playlist/playlist.cpp:1116 ui/organisedialog.cpp:58
#: ../bin/src/ui_edittagdialog.h:655
msgid "Disc"
msgstr "唱片"
@ -1433,7 +1433,7 @@ msgstr "下載目錄"
msgid "Download membership"
msgstr "下載會員"
#: internet/magnatuneservice.cpp:271
#: internet/magnatuneservice.cpp:273
msgid "Download this album"
msgstr "下載此專輯"
@ -1485,7 +1485,7 @@ msgstr ""
msgid "Edit smart playlist..."
msgstr "編輯智慧型播放清單..."
#: ui/mainwindow.cpp:1367
#: ui/mainwindow.cpp:1368
#, qt-format
msgid "Edit tag \"%1\"..."
msgstr "編輯標籤 \"%1\"..."
@ -1591,10 +1591,10 @@ msgstr ""
msgid "Equivalent to --log-levels *:3"
msgstr ""
#: internet/groovesharkservice.cpp:938
#: internet/groovesharkservice.cpp:949
#: internet/magnatunedownloaddialog.cpp:225 library/libraryview.cpp:454
#: ui/edittagdialog.cpp:732 ui/mainwindow.cpp:1797 ui/mainwindow.cpp:1902
#: ui/mainwindow.cpp:2121
#: ui/edittagdialog.cpp:732 ui/mainwindow.cpp:1798 ui/mainwindow.cpp:1903
#: ui/mainwindow.cpp:2122
msgid "Error"
msgstr ""
@ -1697,7 +1697,7 @@ msgstr "淡出持續時間"
msgid "Fast"
msgstr ""
#: internet/groovesharkservice.cpp:557
#: internet/groovesharkservice.cpp:568
msgid "Favorites"
msgstr ""
@ -1729,19 +1729,19 @@ msgstr "副檔名"
msgid "File formats"
msgstr ""
#: playlist/playlist.cpp:1127 ../bin/src/ui_edittagdialog.h:650
#: playlist/playlist.cpp:1131 ../bin/src/ui_edittagdialog.h:650
msgid "File name"
msgstr "檔案名稱"
#: playlist/playlist.cpp:1128
#: playlist/playlist.cpp:1132
msgid "File name (without path)"
msgstr "檔案名稱(不含路徑)"
#: playlist/playlist.cpp:1129 ../bin/src/ui_edittagdialog.h:644
#: playlist/playlist.cpp:1133 ../bin/src/ui_edittagdialog.h:644
msgid "File size"
msgstr "檔案大小"
#: playlist/playlist.cpp:1130 ../bin/src/ui_groupbydialog.h:133
#: playlist/playlist.cpp:1134 ../bin/src/ui_groupbydialog.h:133
#: ../bin/src/ui_groupbydialog.h:146 ../bin/src/ui_groupbydialog.h:159
#: ../bin/src/ui_edittagdialog.h:646
msgid "File type"
@ -1874,17 +1874,17 @@ msgstr ""
msgid "General settings"
msgstr "一般設定"
#: playlist/playlist.cpp:1114 ui/organisedialog.cpp:61
#: playlist/playlist.cpp:1118 ui/organisedialog.cpp:61
#: ../bin/src/ui_groupbydialog.h:134 ../bin/src/ui_groupbydialog.h:147
#: ../bin/src/ui_groupbydialog.h:160 ../bin/src/ui_edittagdialog.h:660
msgid "Genre"
msgstr "風格"
#: internet/groovesharkservice.cpp:1019
#: internet/groovesharkservice.cpp:1030
msgid "Get an URL to share this Grooveshark song"
msgstr ""
#: internet/groovesharkservice.cpp:706
#: internet/groovesharkservice.cpp:717
msgid "Getting Grooveshark popular songs"
msgstr ""
@ -1934,11 +1934,11 @@ msgstr ""
msgid "Grooveshark login error"
msgstr ""
#: internet/groovesharkservice.cpp:548
#: internet/groovesharkservice.cpp:559
msgid "Grooveshark radio"
msgstr ""
#: internet/groovesharkservice.cpp:1051
#: internet/groovesharkservice.cpp:1062
msgid "Grooveshark song's URL"
msgstr ""
@ -2061,7 +2061,7 @@ msgid ""
"time a song finishes."
msgstr ""
#: internet/spotifyservice.cpp:347
#: internet/spotifyservice.cpp:348
msgid "Inbox"
msgstr ""
@ -2085,7 +2085,7 @@ msgstr "增加音量4"
msgid "Increase volume"
msgstr "提高音量"
#: wiimotedev/wiimotesettingspage.cpp:124 ../bin/src/ui_deviceproperties.h:373
#: ../bin/src/ui_deviceproperties.h:373 wiimotedev/wiimotesettingspage.cpp:124
msgid "Information"
msgstr ""
@ -2170,9 +2170,9 @@ msgstr "跳轉到目前播放的歌曲"
msgid "Keep buttons for %1 second..."
msgstr "按住按鈕 %1 秒..."
#: ../bin/src/ui_wiimoteshortcutgrabber.h:127
#: wiimotedev/wiimoteshortcutgrabber.cpp:73
#: wiimotedev/wiimoteshortcutgrabber.cpp:117
#: ../bin/src/ui_wiimoteshortcutgrabber.h:127
#, qt-format
msgid "Keep buttons for %1 seconds..."
msgstr "按住按鈕 %1 秒..."
@ -2209,7 +2209,7 @@ msgstr "大專輯封面"
msgid "Large sidebar"
msgstr "大的邊欄"
#: library/library.cpp:66 playlist/playlist.cpp:1121
#: library/library.cpp:66 playlist/playlist.cpp:1125
#: ../bin/src/ui_edittagdialog.h:641
msgid "Last played"
msgstr ""
@ -2288,7 +2288,7 @@ msgstr ""
msgid "Leave blank for the default. Examples: \"/dev/dsp\", \"front\", etc."
msgstr ""
#: playlist/playlist.cpp:1110 ui/organisedialog.cpp:63
#: playlist/playlist.cpp:1114 ui/organisedialog.cpp:63
#: ui/qtsystemtrayicon.cpp:255 ../bin/src/ui_edittagdialog.h:636
msgid "Length"
msgstr "長度"
@ -2301,7 +2301,7 @@ msgstr "音樂庫"
msgid "Library advanced grouping"
msgstr "音樂庫進階的歸類"
#: ui/mainwindow.cpp:2022
#: ui/mainwindow.cpp:2023
msgid "Library rescan notice"
msgstr ""
@ -2475,7 +2475,7 @@ msgstr "Magnatune下載完成"
msgid "Main profile (MAIN)"
msgstr ""
#: internet/spotifyservice.cpp:496
#: internet/spotifyservice.cpp:497
msgid "Make playlist available offline"
msgstr ""
@ -2557,7 +2557,7 @@ msgstr ""
msgid "Move down"
msgstr "下移"
#: ui/mainwindow.cpp:521 widgets/fileviewlist.cpp:40
#: ui/mainwindow.cpp:522 widgets/fileviewlist.cpp:40
msgid "Move to library..."
msgstr "移到音樂庫..."
@ -2574,8 +2574,8 @@ msgstr "音樂 (*.mp3 *.ogg *.flac *.mpc *.m4a *.aac *.wma *.mp4 *.spx *.wav)"
msgid "Music Library"
msgstr "音樂庫"
#: core/globalshortcuts.cpp:54 wiimotedev/wiimotesettingspage.cpp:105
#: ../bin/src/ui_mainwindow.h:692
#: core/globalshortcuts.cpp:54 ../bin/src/ui_mainwindow.h:692
#: wiimotedev/wiimotesettingspage.cpp:105
msgid "Mute"
msgstr "静音"
@ -2611,7 +2611,7 @@ msgstr "我的廣播站"
msgid "My Recommendations"
msgstr "我推薦的電台"
#: internet/groovesharkservice.cpp:1129 internet/groovesharkservice.cpp:1221
#: internet/groovesharkservice.cpp:1140 internet/groovesharkservice.cpp:1232
#: ui/equalizer.cpp:172 ../bin/src/ui_deviceproperties.h:369
#: ../bin/src/ui_magnatunedownloaddialog.h:135
#: ../bin/src/ui_wizardfinishpage.h:84
@ -2639,7 +2639,7 @@ msgstr "網路"
msgid "Network Proxy"
msgstr "網路代理伺服器"
#: playlist/playlistdelegates.cpp:296 ui/edittagdialog.cpp:444
#: playlist/playlistdelegates.cpp:297 ui/edittagdialog.cpp:444
msgid "Never"
msgstr ""
@ -2652,7 +2652,7 @@ msgstr ""
msgid "Never start playing"
msgstr "永不開始播放"
#: ui/mainwindow.cpp:1415 ../bin/src/ui_mainwindow.h:680
#: ui/mainwindow.cpp:1416 ../bin/src/ui_mainwindow.h:680
msgid "New playlist"
msgstr "新增播放清單"
@ -2676,8 +2676,8 @@ msgstr "最新歌曲"
msgid "Next"
msgstr ""
#: core/globalshortcuts.cpp:50 wiimotedev/wiimotesettingspage.cpp:99
#: ../bin/src/ui_mainwindow.h:635
#: core/globalshortcuts.cpp:50 ../bin/src/ui_mainwindow.h:635
#: wiimotedev/wiimotesettingspage.cpp:99
msgid "Next track"
msgstr "下一首歌曲"
@ -2703,7 +2703,7 @@ msgstr ""
msgid "None"
msgstr "沒有"
#: library/libraryview.cpp:455 ui/mainwindow.cpp:1798 ui/mainwindow.cpp:1903
#: library/libraryview.cpp:455 ui/mainwindow.cpp:1799 ui/mainwindow.cpp:1904
msgid "None of the selected songs were suitable for copying to a device"
msgstr ""
@ -2781,8 +2781,8 @@ msgid "Only show the first"
msgstr ""
#: internet/digitallyimportedservicebase.cpp:178
#: internet/groovesharkservice.cpp:503 internet/icecastservice.cpp:299
#: internet/jamendoservice.cpp:415 internet/magnatuneservice.cpp:273
#: internet/groovesharkservice.cpp:507 internet/icecastservice.cpp:299
#: internet/jamendoservice.cpp:415 internet/magnatuneservice.cpp:275
#: internet/somafmservice.cpp:84
#, qt-format
msgid "Open %1 in browser"
@ -2831,7 +2831,7 @@ msgstr ""
msgid "Organise Files"
msgstr "整理檔案"
#: library/libraryview.cpp:263 ui/mainwindow.cpp:522
#: library/libraryview.cpp:263 ui/mainwindow.cpp:523
msgid "Organise files..."
msgstr ""
@ -2882,7 +2882,7 @@ msgstr "密碼"
msgid "Password Protected"
msgstr "密碼保護"
#: core/globalshortcuts.cpp:46 ui/mainwindow.cpp:871 ui/mainwindow.cpp:1257
#: core/globalshortcuts.cpp:46 ui/mainwindow.cpp:872 ui/mainwindow.cpp:1258
#: ui/qtsystemtrayicon.cpp:178 wiimotedev/wiimotesettingspage.cpp:106
msgid "Pause"
msgstr "暫停"
@ -2899,10 +2899,10 @@ msgstr "已暫停"
msgid "Plain sidebar"
msgstr "樸素的邊欄"
#: core/globalshortcuts.cpp:45 ui/mainwindow.cpp:505 ui/mainwindow.cpp:839
#: ui/mainwindow.cpp:858 ui/mainwindow.cpp:1260 ui/qtsystemtrayicon.cpp:166
#: ui/qtsystemtrayicon.cpp:192 wiimotedev/wiimotesettingspage.cpp:101
#: ../bin/src/ui_mainwindow.h:631
#: core/globalshortcuts.cpp:45 ui/mainwindow.cpp:506 ui/mainwindow.cpp:840
#: ui/mainwindow.cpp:859 ui/mainwindow.cpp:1261 ui/qtsystemtrayicon.cpp:166
#: ui/qtsystemtrayicon.cpp:192 ../bin/src/ui_mainwindow.h:631
#: wiimotedev/wiimotesettingspage.cpp:101
msgid "Play"
msgstr "播放"
@ -2914,7 +2914,7 @@ msgstr ""
msgid "Play artist radio..."
msgstr ""
#: playlist/playlist.cpp:1119 ../bin/src/ui_edittagdialog.h:637
#: playlist/playlist.cpp:1123 ../bin/src/ui_edittagdialog.h:637
msgid "Play count"
msgstr ""
@ -2976,7 +2976,7 @@ msgstr "播放清單搜尋"
msgid "Playlist type"
msgstr ""
#: internet/groovesharkservice.cpp:553
#: internet/groovesharkservice.cpp:564
msgid "Playlists"
msgstr ""
@ -2988,15 +2988,15 @@ msgstr ""
msgid "Pop"
msgstr "流行音樂"
#: internet/groovesharkservice.cpp:521
#: internet/groovesharkservice.cpp:532
msgid "Popular songs"
msgstr ""
#: internet/groovesharkservice.cpp:525
#: internet/groovesharkservice.cpp:536
msgid "Popular songs of the Month"
msgstr ""
#: internet/groovesharkservice.cpp:532
#: internet/groovesharkservice.cpp:543
msgid "Popular songs today"
msgstr ""
@ -3074,8 +3074,8 @@ msgstr "試聽"
msgid "Previous"
msgstr ""
#: core/globalshortcuts.cpp:51 wiimotedev/wiimotesettingspage.cpp:100
#: ../bin/src/ui_mainwindow.h:629
#: core/globalshortcuts.cpp:51 ../bin/src/ui_mainwindow.h:629
#: wiimotedev/wiimotesettingspage.cpp:100
msgid "Previous track"
msgstr "上一首歌曲"
@ -3092,8 +3092,8 @@ msgstr ""
msgid "Progress"
msgstr "進展"
#: wiimotedev/wiimotesettingspage.cpp:227
#: ../bin/src/ui_wiimoteshortcutgrabber.h:125
#: wiimotedev/wiimotesettingspage.cpp:227
msgid "Push Wiiremote button"
msgstr ""
@ -3117,12 +3117,12 @@ msgstr ""
msgid "Queue Manager"
msgstr "佇列管理員"
#: ui/mainwindow.cpp:1338
#: ui/mainwindow.cpp:1339
msgid "Queue selected tracks"
msgstr "將選取的歌曲加入佇列中"
#: globalsearch/globalsearchwidget.cpp:105 library/libraryview.cpp:251
#: ui/mainwindow.cpp:1336
#: ui/mainwindow.cpp:1337
msgid "Queue track"
msgstr "將歌曲加入佇列中"
@ -3130,7 +3130,7 @@ msgstr "將歌曲加入佇列中"
msgid "Radio (equal loudness for all tracks)"
msgstr "廣播 (為所有歌曲取得相同音量)"
#: internet/groovesharkservice.cpp:539
#: internet/groovesharkservice.cpp:550
msgid "Radios"
msgstr ""
@ -3166,7 +3166,7 @@ msgstr ""
msgid "Rate the current song 5 stars"
msgstr ""
#: playlist/playlist.cpp:1118 ../bin/src/ui_edittagdialog.h:645
#: playlist/playlist.cpp:1122 ../bin/src/ui_edittagdialog.h:645
msgid "Rating"
msgstr ""
@ -3174,7 +3174,11 @@ msgstr ""
msgid "Really cancel?"
msgstr "真的要取消?"
#: internet/jamendoservice.cpp:416 internet/magnatuneservice.cpp:274
#: internet/groovesharkservice.cpp:508
msgid "Refresh"
msgstr ""
#: internet/jamendoservice.cpp:416 internet/magnatuneservice.cpp:276
msgid "Refresh catalogue"
msgstr "刷新目錄"
@ -3224,11 +3228,11 @@ msgstr "刪除功能"
msgid "Remove folder"
msgstr "移除檔案夾"
#: internet/groovesharkservice.cpp:498
#: internet/groovesharkservice.cpp:502
msgid "Remove from favorites"
msgstr ""
#: internet/groovesharkservice.cpp:495 ../bin/src/ui_mainwindow.h:674
#: internet/groovesharkservice.cpp:499 ../bin/src/ui_mainwindow.h:674
msgid "Remove from playlist"
msgstr "從撥放清單移除"
@ -3236,16 +3240,16 @@ msgstr "從撥放清單移除"
msgid "Remove playlist"
msgstr "移除撥放清單"
#: internet/groovesharkservice.cpp:1311
#: internet/groovesharkservice.cpp:1323
msgid "Removing song from favorites"
msgstr ""
#: internet/groovesharkservice.cpp:1220
#: internet/groovesharkservice.cpp:1231
#, qt-format
msgid "Rename \"%1\" playlist"
msgstr ""
#: internet/groovesharkservice.cpp:491
#: internet/groovesharkservice.cpp:495
msgid "Rename Grooveshark playlist"
msgstr ""
@ -3323,11 +3327,11 @@ msgstr "限制為 ASCII字符"
msgid "Results"
msgstr ""
#: internet/groovesharkservice.cpp:677
#: internet/groovesharkservice.cpp:688
msgid "Retrieving Grooveshark favorites songs"
msgstr ""
#: internet/groovesharkservice.cpp:600
#: internet/groovesharkservice.cpp:611
msgid "Retrieving Grooveshark playlists"
msgstr ""
@ -3347,7 +3351,7 @@ msgstr ""
msgid "Safely remove the device after copying"
msgstr "在複製之後,安全的移除裝置"
#: playlist/playlist.cpp:1126 ../bin/src/ui_edittagdialog.h:642
#: playlist/playlist.cpp:1130 ../bin/src/ui_edittagdialog.h:642
msgid "Sample rate"
msgstr "取樣頻率"
@ -3391,7 +3395,7 @@ msgstr ""
msgid "Scalable sampling rate profile (SSR)"
msgstr ""
#: playlist/playlist.cpp:1122 ../bin/src/ui_edittagdialog.h:643
#: playlist/playlist.cpp:1126 ../bin/src/ui_edittagdialog.h:643
msgid "Score"
msgstr ""
@ -3405,11 +3409,11 @@ msgid "Search"
msgstr "搜尋"
#: internet/groovesharksearchplaylisttype.cpp:32
#: internet/groovesharkservice.cpp:916
#: internet/groovesharkservice.cpp:927
msgid "Search Grooveshark"
msgstr ""
#: internet/groovesharkservice.cpp:501 internet/groovesharkservice.cpp:515
#: internet/groovesharkservice.cpp:505 internet/groovesharkservice.cpp:526
msgid "Search Grooveshark (opens a new tab)"
msgstr ""
@ -3421,19 +3425,19 @@ msgstr ""
msgid "Search Jamendo"
msgstr ""
#: internet/magnatuneservice.cpp:280
#: internet/magnatuneservice.cpp:282
msgid "Search Magnatune"
msgstr "搜尋 Magnatune"
#: internet/spotifysearchplaylisttype.cpp:32 internet/spotifyservice.cpp:604
#: internet/spotifysearchplaylisttype.cpp:32 internet/spotifyservice.cpp:605
msgid "Search Spotify"
msgstr ""
#: internet/spotifyservice.cpp:338
#: internet/spotifyservice.cpp:339
msgid "Search Spotify (opens a new tab)"
msgstr ""
#: internet/spotifyservice.cpp:489
#: internet/spotifyservice.cpp:490
msgid "Search Spotify (opens a new tab)..."
msgstr ""
@ -3513,7 +3517,7 @@ msgstr ""
msgid "Service offline"
msgstr "服務離線"
#: ui/mainwindow.cpp:1365
#: ui/mainwindow.cpp:1366
#, qt-format
msgid "Set %1 to \"%2\"..."
msgstr ""
@ -3585,7 +3589,7 @@ msgstr ""
msgid "Show above status bar"
msgstr "顯示在狀態欄上方"
#: ui/mainwindow.cpp:478
#: ui/mainwindow.cpp:479
msgid "Show all songs"
msgstr ""
@ -3605,7 +3609,7 @@ msgstr ""
msgid "Show fullsize..."
msgstr "全螢幕..."
#: library/libraryview.cpp:275 ui/mainwindow.cpp:525
#: library/libraryview.cpp:275 ui/mainwindow.cpp:526
msgid "Show in file browser..."
msgstr ""
@ -3613,11 +3617,11 @@ msgstr ""
msgid "Show in various artists"
msgstr "顯示各演唱者"
#: ui/mainwindow.cpp:479
#: ui/mainwindow.cpp:480
msgid "Show only duplicates"
msgstr ""
#: ui/mainwindow.cpp:480
#: ui/mainwindow.cpp:481
msgid "Show only untagged"
msgstr ""
@ -3681,7 +3685,7 @@ msgstr "強節奏流行音樂"
msgid "Skip backwards in playlist"
msgstr "跳至播放清單開頭"
#: playlist/playlist.cpp:1120 ../bin/src/ui_edittagdialog.h:639
#: playlist/playlist.cpp:1124 ../bin/src/ui_edittagdialog.h:639
msgid "Skip count"
msgstr ""
@ -3749,6 +3753,10 @@ msgstr ""
msgid "Sorting"
msgstr ""
#: playlist/playlist.cpp:1139
msgid "Source"
msgstr ""
#: ../bin/src/ui_globalsearchsettingspage.h:169
msgid "Sources"
msgstr ""
@ -3761,7 +3769,7 @@ msgstr ""
msgid "Spotify"
msgstr ""
#: internet/spotifyservice.cpp:179
#: internet/spotifyservice.cpp:180
msgid "Spotify login error"
msgstr ""
@ -3777,7 +3785,7 @@ msgstr ""
msgid "Standard"
msgstr ""
#: internet/spotifyservice.cpp:343
#: internet/spotifyservice.cpp:344
msgid "Starred"
msgstr ""
@ -3804,12 +3812,12 @@ msgstr ""
msgid "Starting..."
msgstr "開啟..."
#: internet/groovesharkservice.cpp:543
#: internet/groovesharkservice.cpp:554
msgid "Stations"
msgstr ""
#: core/globalshortcuts.cpp:48 wiimotedev/wiimotesettingspage.cpp:102
#: ../bin/src/ui_mainwindow.h:633
#: core/globalshortcuts.cpp:48 ../bin/src/ui_mainwindow.h:633
#: wiimotedev/wiimotesettingspage.cpp:102
msgid "Stop"
msgstr "停止"
@ -3817,7 +3825,7 @@ msgstr "停止"
msgid "Stop after"
msgstr ""
#: ui/mainwindow.cpp:507 ../bin/src/ui_mainwindow.h:639
#: ui/mainwindow.cpp:508 ../bin/src/ui_mainwindow.h:639
msgid "Stop after this track"
msgstr "在這首歌之後停止"
@ -3841,7 +3849,7 @@ msgstr "串流"
msgid "Streaming membership"
msgstr "串流成員"
#: internet/groovesharkservice.cpp:566
#: internet/groovesharkservice.cpp:577
msgid "Subscribed playlists"
msgstr ""
@ -3876,15 +3884,15 @@ msgstr ""
msgid "Switch provider"
msgstr ""
#: internet/spotifyservice.cpp:515
#: internet/spotifyservice.cpp:516
msgid "Syncing Spotify inbox"
msgstr ""
#: internet/spotifyservice.cpp:510
#: internet/spotifyservice.cpp:511
msgid "Syncing Spotify playlist"
msgstr ""
#: internet/spotifyservice.cpp:519
#: internet/spotifyservice.cpp:520
msgid "Syncing Spotify starred tracks"
msgstr ""
@ -3947,7 +3955,7 @@ msgstr ""
msgid "The site you requested is not an image!"
msgstr ""
#: ui/mainwindow.cpp:2015
#: ui/mainwindow.cpp:2016
msgid ""
"The version of Clementine you've just updated to requires a full library "
"rescan because of the new features listed below:"
@ -3969,7 +3977,7 @@ msgid ""
"deleted:"
msgstr ""
#: library/libraryview.cpp:461 ui/mainwindow.cpp:1830 widgets/fileview.cpp:186
#: library/libraryview.cpp:461 ui/mainwindow.cpp:1831 widgets/fileview.cpp:186
msgid ""
"These files will be deleted from disk, are you sure you want to continue?"
msgstr ""
@ -4056,13 +4064,13 @@ msgstr ""
msgid "Timezone"
msgstr ""
#: playlist/playlist.cpp:1107 ui/organisedialog.cpp:51
#: playlist/playlist.cpp:1111 ui/organisedialog.cpp:51
#: ui/qtsystemtrayicon.cpp:248 ../bin/src/ui_about.h:142
#: ../bin/src/ui_edittagdialog.h:652 ../bin/src/ui_trackselectiondialog.h:211
msgid "Title"
msgstr "標題"
#: internet/groovesharkservice.cpp:939
#: internet/groovesharkservice.cpp:950
msgid ""
"To start Grooveshark radio, you should first listen to a few other "
"Grooveshark songs"
@ -4080,7 +4088,7 @@ msgstr ""
msgid "Toggle fullscreen"
msgstr "切換全螢幕模式"
#: ui/mainwindow.cpp:1340
#: ui/mainwindow.cpp:1341
msgid "Toggle queue status"
msgstr "切換佇列狀態"
@ -4100,7 +4108,7 @@ msgstr ""
msgid "Total network requests made"
msgstr ""
#: playlist/playlist.cpp:1111 ui/organisedialog.cpp:57
#: playlist/playlist.cpp:1115 ui/organisedialog.cpp:57
#: ../bin/src/ui_edittagdialog.h:653 ../bin/src/ui_trackselectiondialog.h:212
msgid "Track"
msgstr "歌曲"
@ -4158,7 +4166,7 @@ msgstr ""
#: core/song.cpp:402 globalsearch/globalsearchitemdelegate.cpp:166
#: globalsearch/globalsearchitemdelegate.cpp:173 library/librarymodel.cpp:297
#: library/librarymodel.cpp:302 library/librarymodel.cpp:926
#: playlist/playlistdelegates.cpp:306 playlist/playlistmanager.cpp:381
#: playlist/playlistdelegates.cpp:307 playlist/playlistmanager.cpp:381
#: playlist/playlistmanager.cpp:384 ui/albumcoverchoicecontroller.cpp:111
msgid "Unknown"
msgstr "未知的"
@ -4171,7 +4179,7 @@ msgstr "不明的錯誤"
msgid "Unset cover"
msgstr "未設置覆蓋"
#: internet/groovesharkservice.cpp:1083
#: internet/groovesharkservice.cpp:1094
msgid "Update Grooveshark playlist"
msgstr ""
@ -4300,7 +4308,7 @@ msgstr "檢視"
msgid "Visualization mode"
msgstr "視覺化模式"
#: ui/dbusscreensaver.cpp:35 ../bin/src/ui_mainwindow.h:689
#: ../bin/src/ui_mainwindow.h:689 ui/dbusscreensaver.cpp:35
msgid "Visualizations"
msgstr "視覺化"
@ -4410,11 +4418,11 @@ msgstr ""
msgid "Windows Media audio"
msgstr ""
#: ui/mainwindow.cpp:2020
#: ui/mainwindow.cpp:2021
msgid "Would you like to run a full rescan right now?"
msgstr ""
#: playlist/playlist.cpp:1113 ui/organisedialog.cpp:60
#: playlist/playlist.cpp:1117 ui/organisedialog.cpp:60
#: ../bin/src/ui_groupbydialog.h:135 ../bin/src/ui_groupbydialog.h:148
#: ../bin/src/ui_groupbydialog.h:161 ../bin/src/ui_edittagdialog.h:657
msgid "Year"
@ -4492,7 +4500,7 @@ msgstr ""
msgid "You do not have a Spotify Premium account."
msgstr ""
#: internet/spotifyservice.cpp:165
#: internet/spotifyservice.cpp:166
msgid ""
"You have been logged out of Spotify, please re-enter your password in the "
"Settings dialog."
@ -4540,7 +4548,7 @@ msgstr ""
msgid "Your Magnatune credentials were incorrect"
msgstr ""
#: ui/edittagdialog.cpp:732 ui/mainwindow.cpp:2121
#: ui/edittagdialog.cpp:732 ui/mainwindow.cpp:2122
msgid ""
"Your gstreamer installation is missing the 'ofa' plugin. This is required "
"for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' "
@ -4606,7 +4614,7 @@ msgstr ""
msgid "biggest first"
msgstr ""
#: playlist/playlistview.cpp:161 ui/edittagdialog.cpp:420
#: playlist/playlistview.cpp:163 ui/edittagdialog.cpp:420
msgid "bpm"
msgstr "bpm"
@ -4649,7 +4657,7 @@ msgstr ""
msgid "in the last"
msgstr ""
#: playlist/playlistview.cpp:163 ui/edittagdialog.cpp:422
#: playlist/playlistview.cpp:165 ui/edittagdialog.cpp:422
#: internet/spotifysettingspage.cpp:59 internet/spotifysettingspage.cpp:60
#: internet/spotifysettingspage.cpp:61
msgid "kbps"
@ -4716,7 +4724,7 @@ msgstr ""
msgid "starts with"
msgstr ""
#: playlist/playlistdelegates.cpp:177
#: playlist/playlistdelegates.cpp:178
msgid "stop"
msgstr ""

View File

@ -278,6 +278,7 @@ MainWindow::MainWindow(
connect(ui_->playlist, SIGNAL(ViewSelectionModelChanged()), SLOT(PlaylistViewSelectionModelChanged()));
ui_->playlist->SetManager(playlists_);
ui_->playlist->view()->SetPlayer(player);
library_view_->view()->setModel(library_sort_model_);
library_view_->view()->SetLibrary(library_->model());