summaryrefslogtreecommitdiffstats
path: root/amarok/src/iconloader.cpp
blob: 3030516528c050d5a852bd5f63be6261c26daaba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/***************************************************************************
 *   Copyright (C) 2006 by Mark Kretschmann <markey@web.de>                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA  02110-1301, USA.          *
 ***************************************************************************/

#include "amarok.h"
#include "amarokconfig.h"

#include <tqmap.h>


TQString
Amarok::icon( const TQString& name ) //declared in amarok.h
{
    // We map our Amarok icon theme names to system icons, instead of using the same
    // naming scheme. This has two advantages:
    // 1. Our icons can have simpler and more meaningful names
    // 2. We can map several of our icons to one system icon, if necessary
    static TQMap<TQString, TQString> iconMap;

    if( iconMap.empty() ) {
        iconMap["add_lyrics"]           = "edit_add";
        iconMap["add_playlist"]         = "1downarrow";
        iconMap["album"]                = "media-optical-cdrom-unmounted";
        iconMap["artist"]               = "preferences-desktop-personal";
        iconMap["audioscrobbler"]       = "audioscrobbler";
        iconMap["love"]                 = "bookmark";
        iconMap["back"]                 = "media-skip-backward";
        iconMap["burn"]                 = "media-optical-cdrom-unmounted";
        iconMap["change_language"]      = "configure";
        iconMap["clock"]                = "history";
        iconMap["collection"]           = "collection";
        iconMap["configure"]            = "configure";
        iconMap["covermanager"]         = "covermanager";
        iconMap["device"]               = "media-flash-usb-unmounted";
        iconMap["download"]             = "tdehtml_kget";
        iconMap["dynamic"]              = "dynamic";
        iconMap["edit"]                 = "edit";
        iconMap["edit-copy"]             = "edit-copy";
        iconMap["equalizer"]            = "equalizer";
        iconMap["external"]             = "application-x-executable";
        iconMap["fastforward"]          = "2rightarrow";
        iconMap["favourite_genres"]     = "kfm";
        iconMap["files"]                = "folder";
        iconMap["files2"]               = "folder_red";
        iconMap["info"]                 = "application-vnd.tde.info";
        iconMap["lyrics"]               = "text-x-generic";
        iconMap["magnatune"]            = "cd";
        iconMap["mostplayed"]           = "favorites";
        iconMap["music"]                = "today";
        iconMap["next"]                 = "media-skip-forward";
        iconMap["pause"]                = "media-playback-pause";
        iconMap["play"]                 = "media-playback-start";
        iconMap["playlist"]             = "player_playlist_2";
        iconMap["playlist_clear"]       = "view_remove";
        iconMap["playlist_refresh"]     = "rebuild";
        iconMap["queue"]                = "goto";
        iconMap["queue_track"]          = "2rightarrow";
        iconMap["dequeue_track"]        = "2leftarrow";
        iconMap["random"]               = "random";
        iconMap["random_album"]         = "cd";
        iconMap["random_no"]            = "forward";
        iconMap["random_track"]         = "random";
        iconMap["redo"]                 = "edit-redo";
        iconMap["refresh"]              = "reload";
        iconMap["remove"]               = "edit-delete";
        iconMap["remove_from_playlist"] = "remove";
        iconMap["repeat_album"]         = "media-optical-cdrom-unmounted";
        iconMap["repeat_no"]            = "go-bottom";
        iconMap["repeat_playlist"]      = "repeat_playlist";
        iconMap["repeat_track"]         = "repeat_track";
        iconMap["rescan"]               = "reload";
        iconMap["rewind"]               = "2leftarrow";
        iconMap["save"]                 = "document-save";
        iconMap["scripts"]              = "pencil";
        iconMap["search"]               = "edit-find";
        iconMap["settings_engine"]      = "amarok";
        iconMap["settings_general"]     = "misc";
        iconMap["settings_indicator"]   = "tv";
        iconMap["settings_playback"]    = "kmix";
        iconMap["settings_view"]        = "colors";
        iconMap["stop"]                 = "media-playback-stop";
        iconMap["podcast"]              = "podcast";
        iconMap["podcast2"]             = "podcast_new";
        iconMap["track"]                = "audio-x-generic";
        iconMap["undo"]                 = "edit-undo";
        iconMap["visualizations"]       = "visualizations";
        iconMap["zoom"]                 = "edit-find";
    }

    static TQMap<TQString, TQString> amarokMap;
    if( amarokMap.empty() ) {
        amarokMap["queue_track"]          = "fastforward";
        amarokMap["dequeue_track"]        = "rewind";
    }

    if( iconMap.contains( name ) )
    {
        if( AmarokConfig::useCustomIconTheme() )
        {
            if( amarokMap.contains( name ) )
                return TQString( "amarok_" ) + amarokMap[name];
            return TQString( "amarok_" ) + name;
        }
        else
            return iconMap[name];
    }

    return name;
}