1 /***************************************************************************
2 * Copyright (C) 2006 by Mark Kretschmann <markey@web.de> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
21 #include "amarokconfig.h"
24 #include <qapplication.h>
28 Amarok::icon( const QString
& name
) //declared in amarok.h
30 bool isRTL
= QApplication::isRightToLeft();
32 // We map our Amarok icon theme names to system icons, instead of using the same
33 // naming scheme. This has two advantages:
34 // 1. Our icons can have simpler and more meaningful names
35 // 2. We can map several of our icons to one system icon, if necessary
36 static QMap
<QString
, QString
> iconMap
;
38 if( iconMap
.empty() ) {
39 iconMap
["add_lyrics"] = "list-add";
40 iconMap
["add_playlist"] = "list-add";
41 iconMap
["album"] = "media-album";
42 iconMap
["artist"] = "view-media-artist";
43 iconMap
["audioscrobbler"] = "audioscrobbler";
44 iconMap
["love"] = "love";
45 iconMap
["back"] = "media-skip-backward";
46 iconMap
["burn"] = "tools-media-optical-burn";
47 iconMap
["change_language"] = "preferences-desktop-locale";
48 iconMap
["clock"] = "view-history";
49 iconMap
["collection"] = "collection";
50 iconMap
["configure"] = "configure";
51 iconMap
["covermanager"] = "covermanager";
52 iconMap
["device"] = "multimedia-player-apple-ipod";
53 iconMap
["download"] = "get-hot-new-stuff";
54 iconMap
["dynamic"] = "dynamic";
55 iconMap
["edit"] = "object-edit";
56 iconMap
["editcopy"] = "edit-copy";
57 iconMap
["equalizer"] = "view-media-equalizer";
58 iconMap
["external"] = "system-run";
59 iconMap
["fastforward"] = "media-seek-forward";
60 iconMap
["favourite_genres"] = "system-file-manager";
61 iconMap
["files"] = "folder";
62 iconMap
["files2"] = "folder-red";
63 iconMap
["info"] = "document-properties";
64 iconMap
["lyrics"] = "view-media-lyrics";
65 iconMap
["magnatune"] = "services";
66 iconMap
["mostplayed"] = "favorites";
67 iconMap
["music"] = "media-podcast";
68 iconMap
["next"] = "media-skip-forward";
69 iconMap
["pause"] = "media-playback-pause";
70 iconMap
["play"] = "media-playback-start";
71 iconMap
["playlist"] = "media-playlist";
72 iconMap
["playlist_clear"] = "edit-clear-list";
73 iconMap
["playlist_refresh"] = "view-refresh";
74 iconMap
["queue"] = "go-bottom";
75 iconMap
["queue_track"] = isRTL
? "go-previous" : "go-next";
76 iconMap
["dequeue_track"] = isRTL
? "go-next" : "go-previous";
77 iconMap
["random"] = "media-playlist-shuffle";
78 iconMap
["random_album"] = "media-album-shuffle";
79 iconMap
["random_no"] = "go-next";
80 iconMap
["random_track"] = "media-playlist-shuffle";
81 iconMap
["redo"] = "edit-redo";
82 iconMap
["refresh"] = "view-refresh";
83 iconMap
["remove"] = "edit-delete";
84 iconMap
["remove_from_playlist"] = "list-remove";
85 iconMap
["repeat_album"] = "media-album-repeat";
86 iconMap
["repeat_no"] = "go-down";
87 iconMap
["repeat_playlist"] = "media-playlist-repeat";
88 iconMap
["repeat_track"] = "media-track-repeat";
89 iconMap
["rescan"] = "view-refresh";
90 iconMap
["rewind"] = "media-seek-backward";
91 iconMap
["save"] = "document-save";
92 iconMap
["scripts"] = "signature";
93 iconMap
["search"] = "edit-find";
94 iconMap
["settings_engine"] = "amarok";
95 iconMap
["settings_general"] = "preferences-other";
96 iconMap
["settings_indicator"] = "preferences-desktop-display";
97 iconMap
["settings_playback"] = "preferences-desktop-sound";
98 iconMap
["settings_view"] = "edit-find";
99 iconMap
["stop"] = "media-playback-stop";
100 iconMap
["podcast"] = "media-podcast";
101 iconMap
["podcast2"] = "media-podcast-new";
102 iconMap
["track"] = "audio-x-generic";
103 iconMap
["undo"] = "edit-undo";
104 iconMap
["visualizations"] = "view-media-visualization";
105 iconMap
["zoom"] = "zoom-in";
108 static QMap
<QString
, QString
> amarokMap
;
109 if( amarokMap
.empty() ) {
110 amarokMap
["queue_track"] = "fastforward";
111 amarokMap
["dequeue_track"] = "rewind";
114 if( iconMap
.contains( name
) )
116 if( AmarokConfig::useCustomIconTheme() )
118 if( amarokMap
.contains( name
) )
119 return QString( "amarok_" ) + amarokMap
[name
];
120 return QString( "amarok_" ) + name
;
123 return iconMap
[name
];