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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
# vim: set et ts=4 sw=4:
package AdminPanel::Rpmdragora::icon;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
# Copyright (c) 2002-2007 Thierry Vignaud <tvignaud@mandriva.com>
# Copyright (c) 2003, 2004, 2005 MandrakeSoft SA
# Copyright (c) 2005-2007 Mandriva SA
# Copyright (c) 2013 - 2015 Matteo Pasotti <matteo.pasotti@gmail.com>
# Copyright (c) 2014 - 2015 Angelo Naselli <anaselli@linux.it>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#*****************************************************************************
#
# $Id: icon.pm 237459 2008-02-26 14:20:47Z tv $
use strict;
use AdminPanel::rpmdragora;
use AdminPanel::Shared::Locales;
my $loc = AdminPanel::rpmdragora::locale();
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(get_icon_path);
#- /usr/share/rpmlint/config (duplicates are normal, so that we are not too far away from .py)
my %group_icons = (
$loc->N("All") => 'system_section',
$loc->N("Accessibility") => 'accessibility_section',
$loc->N("Archiving") => 'archiving_section',
join('|', $loc->N("Archiving"), $loc->N("Backup")) => 'backup_section',
join('|', $loc->N("Archiving"), $loc->N("Cd burning")) => 'cd_burning_section',
join('|', $loc->N("Archiving"), $loc->N("Compression")) => 'compression_section',
join('|', $loc->N("Archiving"), $loc->N("Other")) => 'other_archiving',
$loc->N("Communications") => 'communications_section',
join('|', $loc->N("Communications"), $loc->N("Bluetooth")) => 'communications_bluetooth_section',
join('|', $loc->N("Communications"), $loc->N("Dial-Up")) => 'communications_dialup_section',
join('|', $loc->N("Communications"), $loc->N("Fax")) => 'communications_fax_section',
join('|', $loc->N("Communications"), $loc->N("Mobile")) => 'communications_mobile_section',
join('|', $loc->N("Communications"), $loc->N("Radio")) => 'communications_radio_section',
join('|', $loc->N("Communications"), $loc->N("Serial")) => 'communications_serial_section',
join('|', $loc->N("Communications"), $loc->N("Telephony")) => 'communications_phone_section',
$loc->N("Databases") => 'databases_section',
$loc->N("Development") => 'development_section',
join('|', $loc->N("Development"), $loc->N("Basic")) => '',
join('|', $loc->N("Development"), $loc->N("C")) => '',
join('|', $loc->N("Development"), $loc->N("C++")) => '',
join('|', $loc->N("Development"), $loc->N("C#")) => '',
join('|', $loc->N("Development"), $loc->N("Databases")) => 'databases_section',
join('|', $loc->N("Development"), $loc->N("Debug")) => '',
join('|', $loc->N("Development"), $loc->N("Erlang")) => '',
join('|', $loc->N("Development"), $loc->N("GNOME and GTK+")) => 'gnome_section',
join('|', $loc->N("Development"), $loc->N("Java")) => '',
join('|', $loc->N("Development"), $loc->N("KDE and Qt")) => 'kde_section',
join('|', $loc->N("Development"), $loc->N("Kernel")) => '',
join('|', $loc->N("Development"), $loc->N("OCaml")) => '',
join('|', $loc->N("Development"), $loc->N("Other")) => '',
join('|', $loc->N("Development"), $loc->N("Perl")) => '',
join('|', $loc->N("Development"), $loc->N("PHP")) => '',
join('|', $loc->N("Development"), $loc->N("Python")) => '',
join('|', $loc->N("Development"), $loc->N("Tools")) => 'development_tools_section',
join('|', $loc->N("Development"), $loc->N("X11")) => '',
$loc->N("Documentation") => 'documentation_section',
$loc->N("Editors") => 'editors_section',
$loc->N("Education") => 'education_section',
$loc->N("Emulators") => 'emulators_section',
$loc->N("File tools") => 'file_tools_section',
$loc->N("Games") => 'amusement_section',
join('|', $loc->N("Games"), $loc->N("Adventure")) => 'adventure_section',
join('|', $loc->N("Games"), $loc->N("Arcade")) => 'arcade_section',
join('|', $loc->N("Games"), $loc->N("Boards")) => 'boards_section',
join('|', $loc->N("Games"), $loc->N("Cards")) => 'cards_section',
join('|', $loc->N("Games"), $loc->N("Other")) => 'other_amusement',
join('|', $loc->N("Games"), $loc->N("Puzzles")) => 'puzzle_section',
join('|', $loc->N("Games"), $loc->N("Shooter")) => 'shooter_section',
join('|', $loc->N("Games"), $loc->N("Simulation")) => 'simulation_section',
join('|', $loc->N("Games"), $loc->N("Sports")) => 'sport_section',
join('|', $loc->N("Games"), $loc->N("Strategy")) => 'strategy_section',
$loc->N("Geography") => 'geography_section',
$loc->N("Graphical desktop") => 'graphical_desktop_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("Enlightenment")) => 'enlightment_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("GNOME")) => 'gnome_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("Icewm")) => 'icewm_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("KDE")) => 'kde_section',
join('|', $loc->N("Graphical desktop"), $loc->N("Other")) => 'more_applications_other_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("WindowMaker")) => 'windowmaker_section',
join('|', $loc->N("Graphical desktop"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("Xfce")) => 'xfce_section',
$loc->N("Graphics") => 'graphics_section',
join('|', $loc->N("Graphics"), $loc->N("3D")) => 'graphics_3d_section',
join('|', $loc->N("Graphics"), $loc->N("Editors and Converters")) => 'graphics_editors_section',
join('|', $loc->N("Graphics"), $loc->N("Utilities")) => 'graphics_utilities_section',
join('|', $loc->N("Graphics"), $loc->N("Photography")) => 'graphics_photography_section',
join('|', $loc->N("Graphics"), $loc->N("Scanning")) => 'graphics_scanning_section',
join('|', $loc->N("Graphics"), $loc->N("Viewers")) => 'graphics_viewers_section',
$loc->N("Monitoring") => 'monitoring_section',
$loc->N("Networking") => 'networking_section',
join('|', $loc->N("Networking"), $loc->N("File transfer")) => 'file_transfer_section',
join('|', $loc->N("Networking"), $loc->N("IRC")) => 'irc_section',
join('|', $loc->N("Networking"), $loc->N("Instant messaging")) => 'instant_messaging_section',
join('|', $loc->N("Networking"), $loc->N("Mail")) => 'mail_section',
join('|', $loc->N("Networking"), $loc->N("News")) => 'news_section',
join('|', $loc->N("Networking"), $loc->N("Other")) => 'other_networking',
join('|', $loc->N("Networking"), $loc->N("Remote access")) => 'remote_access_section',
join('|', $loc->N("Networking"), $loc->N("WWW")) => 'networking_www_section',
$loc->N("Office") => 'office_section',
join('|', $loc->N("Office"), $loc->N("Dictionary")) => 'office_dictionary_section',
join('|', $loc->N("Office"), $loc->N("Finance")) => 'finances_section',
join('|', $loc->N("Office"), $loc->N("Management")) => 'timemanagement_section',
join('|', $loc->N("Office"), $loc->N("Organizer")) => 'timemanagement_section',
join('|', $loc->N("Office"), $loc->N("Utilities")) => 'office_accessories_section',
join('|', $loc->N("Office"), $loc->N("Spreadsheet")) => 'spreadsheet_section',
join('|', $loc->N("Office"), $loc->N("Suite")) => 'office_suite',
join('|', $loc->N("Office"), $loc->N("Word processor")) => 'wordprocessor_section',
$loc->N("Publishing") => 'publishing_section',
$loc->N("Sciences") => 'sciences_section',
join('|', $loc->N("Sciences"), $loc->N("Astronomy")) => 'astronomy_section',
join('|', $loc->N("Sciences"), $loc->N("Biology")) => 'biology_section',
join('|', $loc->N("Sciences"), $loc->N("Chemistry")) => 'chemistry_section',
join('|', $loc->N("Sciences"), $loc->N("Computer science")) => 'computer_science_section',
join('|', $loc->N("Sciences"), $loc->N("Geosciences")) => 'geosciences_section',
join('|', $loc->N("Sciences"), $loc->N("Mathematics")) => 'mathematics_section',
join('|', $loc->N("Sciences"), $loc->N("Other")) => 'other_sciences',
join('|', $loc->N("Sciences"), $loc->N("Physics")) => 'physics_section',
$loc->N("Security") => 'security_section',
$loc->N("Shells") => 'shells_section',
$loc->N("Sound") => 'sound_section',
join('|', $loc->N("Sound"), $loc->N("Editors and Converters")) => 'sound_editors_section',
join('|', $loc->N("Sound"), $loc->N("Midi")) => 'sound_midi_section',
join('|', $loc->N("Sound"), $loc->N("Mixers")) => 'sound_mixers_section',
join('|', $loc->N("Sound"), $loc->N("Players")) => 'sound_players_section',
join('|', $loc->N("Sound"), $loc->N("Utilities")) => 'sound_utilities_section',
$loc->N("System") => 'system_section',
join('|', $loc->N("System"), $loc->N("Base")) => 'system_section',
join('|', $loc->N("System"), $loc->N("Boot and Init")) => 'boot_init_section',
join('|', $loc->N("System"), $loc->N("Cluster")) => 'parallel_computing_section',
join('|', $loc->N("System"), $loc->N("Configuration")) => 'configuration_section',
join('|', $loc->N("System"), $loc->N("Fonts")) => 'chinese_section',
join('|', $loc->N("System"), $loc->N("Fonts"), $loc->N("True type")) => '',
join('|', $loc->N("System"), $loc->N("Fonts"), $loc->N("Type1")) => '',
join('|', $loc->N("System"), $loc->N("Fonts"), $loc->N("X11 bitmap")) => '',
join('|', $loc->N("System"), $loc->N("Internationalization")) => 'chinese_section',
join('|', $loc->N("System"), $loc->N("Kernel and hardware")) => 'hardware_configuration_section',
join('|', $loc->N("System"), $loc->N("Libraries")) => 'system_section',
join('|', $loc->N("System"), $loc->N("Networking")) => 'networking_configuration_section',
join('|', $loc->N("System"), $loc->N("Packaging")) => 'packaging_section',
join('|', $loc->N("System"), $loc->N("Printing")) => 'printing_section',
join('|', $loc->N("System"), $loc->N("Servers")) => 'servers_section',
join('|', $loc->N("System"),
#-PO: This is a package/product name. Only translate it if needed:
$loc->N("X11")) => 'x11_section',
$loc->N("Terminals") => 'terminals_section',
$loc->N("Text tools") => 'text_tools_section',
$loc->N("Toys") => 'toys_section',
$loc->N("Video") => 'video_section',
join('|', $loc->N("Video"), $loc->N("Editors and Converters")) => 'video_editors_section',
join('|', $loc->N("Video"), $loc->N("Players")) => 'video_players_section',
join('|', $loc->N("Video"), $loc->N("Television")) => 'video_television_section',
join('|', $loc->N("Video"), $loc->N("Utilities")) => 'video_utilities_section',
# for Mageia Choice:
$loc->N("Workstation") => 'system_section',
join('|', $loc->N("Workstation"), $loc->N("Configuration")) => 'configuration_section',
join('|', $loc->N("Workstation"), $loc->N("Console Tools")) => 'interpreters_section',
join('|', $loc->N("Workstation"), $loc->N("Documentation")) => 'documentation_section',
join('|', $loc->N("Workstation"), $loc->N("Game station")) => 'amusement_section',
join('|', $loc->N("Workstation"), $loc->N("Internet station")) => 'networking_section',
join('|', $loc->N("Workstation"), $loc->N("Multimedia station")) => 'multimedia_section',
join('|', $loc->N("Workstation"), $loc->N("Network Computer (client)")) => 'other_networking',
join('|', $loc->N("Workstation"), $loc->N("Office Workstation")) => 'office_section',
join('|', $loc->N("Workstation"), $loc->N("Scientific Workstation")) => 'sciences_section',
$loc->N("Graphical Environment") => 'graphical_desktop_section',
join('|', $loc->N("Graphical Environment"), $loc->N("GNOME Workstation")) => 'gnome_section',
join('|', $loc->N("Graphical Environment"), $loc->N("IceWm Desktop")) => 'icewm_section',
join('|', $loc->N("Graphical Environment"), $loc->N("KDE Workstation")) => 'kde_section',
join('|', $loc->N("Graphical Environment"), $loc->N("Other Graphical Desktops")) => 'more_applications_other_section',
$loc->N("Development") => 'development_section',
join('|', $loc->N("Development"), $loc->N("Development")) => 'development_section',
join('|', $loc->N("Development"), $loc->N("Documentation")) => 'documentation_section',
$loc->N("Server") => 'servers_section',
join('|', $loc->N("Server"), $loc->N("DNS/NIS")) => 'networking_section',
join('|', $loc->N("Server"), $loc->N("Database")) => 'databases_section',
join('|', $loc->N("Server"), $loc->N("Firewall/Router")) => 'networking_section',
join('|', $loc->N("Server"), $loc->N("Mail")) => 'mail_section',
join('|', $loc->N("Server"), $loc->N("Mail/Groupware/News")) => 'mail_section',
join('|', $loc->N("Server"), $loc->N("Network Computer server")) => 'networking_section',
join('|', $loc->N("Server"), $loc->N("Web/FTP")) => 'networking_www_section',
);
sub get_icon_path {
my ($group, $parent) = @_;
my $path = $parent ? '/usr/share/icons/mini/' : '/usr/share/icons/';
my $icon_path = "";
if(defined($group_icons{$group})){
$icon_path = join('', $path, $group_icons{$group}, '.png');
}elsif(defined($group_icons{$parent."\|".$group})){
$icon_path = join('', $path, $group_icons{$parent."\|".$group}, '.png');
}else{
$icon_path = join('', $path, 'applications_section', '.png');
}
unless(-e $icon_path){
$icon_path = join('', $path, 'applications_section', '.png');
}
return $icon_path;
}
1;
|