/[soft]/rpmdrake/trunk/Rpmdrake/icon.pm
ViewVC logotype

Contents of /rpmdrake/trunk/Rpmdrake/icon.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7439 - (show annotations) (download)
Fri Mar 1 10:20:36 2013 UTC (8 years, 6 months ago) by malo
File size: 12026 byte(s)
fix some icon categories
1 package Rpmdrake::icon;
2 #*****************************************************************************
3 #
4 # Copyright (c) 2002 Guillaume Cottenceau
5 # Copyright (c) 2002-2007 Thierry Vignaud <tvignaud@mandriva.com>
6 # Copyright (c) 2003, 2004, 2005 MandrakeSoft SA
7 # Copyright (c) 2005-2007 Mandriva SA
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2, as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #
22 #*****************************************************************************
23 #
24 # $Id: icon.pm 237459 2008-02-26 14:20:47Z tv $
25
26 use strict;
27 our @ISA = qw(Exporter);
28 use lib qw(/usr/lib/libDrakX);
29 use common;
30 use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk2 one
31
32 our @EXPORT = qw(get_icon);
33 #- /usr/share/rpmlint/config (duplicates are normal, so that we are not too far away from .py)
34 my %group_icons = (
35 N("All") => 'system_section',
36 N("Accessibility") => 'accessibility_section',
37 N("Archiving") => 'archiving_section',
38 join('|', N("Archiving"), N("Backup")) => 'backup_section',
39 join('|', N("Archiving"), N("Cd burning")) => 'cd_burning_section',
40 join('|', N("Archiving"), N("Compression")) => 'compression_section',
41 join('|', N("Archiving"), N("Other")) => 'other_archiving',
42 N("Communications") => 'communications_section',
43 join('|', N("Communications"), N("Bluetooth")) => 'communications_bluetooth_section',
44 join('|', N("Communications"), N("Dial-Up")) => 'communications_dialup_section',
45 join('|', N("Communications"), N("Fax")) => 'communications_fax_section',
46 join('|', N("Communications"), N("Mobile")) => 'communications_mobile_section',
47 join('|', N("Communications"), N("Radio")) => 'communications_radio_section',
48 join('|', N("Communications"), N("Serial")) => 'communications_serial_section',
49 join('|', N("Communications"), N("Telephony")) => 'communications_phone_section',
50 N("Databases") => 'databases_section',
51 N("Development") => 'development_section',
52 join('|', N("Development"), N("Basic")) => '',
53 join('|', N("Development"), N("C")) => '',
54 join('|', N("Development"), N("C++")) => '',
55 join('|', N("Development"), N("C#")) => '',
56 join('|', N("Development"), N("Databases")) => 'databases_section',
57 join('|', N("Development"), N("Debug")) => '',
58 join('|', N("Development"), N("Erlang")) => '',
59 join('|', N("Development"), N("GNOME and GTK+")) => 'gnome_section',
60 join('|', N("Development"), N("Java")) => '',
61 join('|', N("Development"), N("KDE and Qt")) => 'kde_section',
62 join('|', N("Development"), N("Kernel")) => '',
63 join('|', N("Development"), N("OCaml")) => '',
64 join('|', N("Development"), N("Other")) => '',
65 join('|', N("Development"), N("Perl")) => '',
66 join('|', N("Development"), N("PHP")) => '',
67 join('|', N("Development"), N("Python")) => '',
68 join('|', N("Development"), N("Tools")) => 'development_tools_section',
69 join('|', N("Development"), N("X11")) => '',
70 N("Documentation") => 'documentation_section',
71 N("Editors") => 'editors_section',
72 N("Education") => 'education_section',
73 N("Emulators") => 'emulators_section',
74 N("File tools") => 'file_tools_section',
75 N("Games") => 'amusement_section',
76 join('|', N("Games"), N("Adventure")) => 'adventure_section',
77 join('|', N("Games"), N("Arcade")) => 'arcade_section',
78 join('|', N("Games"), N("Boards")) => 'boards_section',
79 join('|', N("Games"), N("Cards")) => 'cards_section',
80 join('|', N("Games"), N("Other")) => 'other_amusement',
81 join('|', N("Games"), N("Puzzles")) => 'puzzle_section',
82 join('|', N("Games"), N("Shooter")) => 'shooter_section',
83 join('|', N("Games"), N("Simulation")) => 'simulation_section',
84 join('|', N("Games"), N("Sports")) => 'sport_section',
85 join('|', N("Games"), N("Strategy")) => 'strategy_section',
86 N("Geography") => 'geography_section',
87 N("Graphical desktop") => 'graphical_desktop_section',
88 join('|', N("Graphical desktop"),
89 #-PO: This is a package/product name. Only translate it if needed:
90 N("Enlightenment")) => 'enlightment_section',
91 join('|', N("Graphical desktop"),
92 #-PO: This is a package/product name. Only translate it if needed:
93 N("GNOME")) => 'gnome_section',
94 join('|', N("Graphical desktop"),
95 #-PO: This is a package/product name. Only translate it if needed:
96 N("Icewm")) => 'icewm_section',
97 join('|', N("Graphical desktop"),
98 #-PO: This is a package/product name. Only translate it if needed:
99 N("KDE")) => 'kde_section',
100 join('|', N("Graphical desktop"), N("Other")) => 'more_applications_other_section',
101 join('|', N("Graphical desktop"),
102 #-PO: This is a package/product name. Only translate it if needed:
103 N("WindowMaker")) => 'windowmaker_section',
104 join('|', N("Graphical desktop"),
105 #-PO: This is a package/product name. Only translate it if needed:
106 N("Xfce")) => 'xfce_section',
107 N("Graphics") => 'graphics_section',
108 join('|', N("Graphics"), N("3D")) => 'graphics_3d_section',
109 join('|', N("Graphics"), N("Editors and Converters")) => 'graphics_editors_section',
110 join('|', N("Graphics"), N("Utilities")) => 'graphics_utilities_section',
111 join('|', N("Graphics"), N("Photography")) => 'graphics_photography_section',
112 join('|', N("Graphics"), N("Scanning")) => 'graphics_scanning_section',
113 join('|', N("Graphics"), N("Viewers")) => 'graphics_viewers_section',
114 N("Monitoring") => 'monitoring_section',
115 N("Networking") => 'networking_section',
116 join('|', N("Networking"), N("File transfer")) => 'file_transfer_section',
117 join('|', N("Networking"), N("IRC")) => 'irc_section',
118 join('|', N("Networking"), N("Instant messaging")) => 'instant_messaging_section',
119 join('|', N("Networking"), N("Mail")) => 'mail_section',
120 join('|', N("Networking"), N("News")) => 'news_section',
121 join('|', N("Networking"), N("Other")) => 'other_networking',
122 join('|', N("Networking"), N("Remote access")) => 'remote_access_section',
123 join('|', N("Networking"), N("WWW")) => 'networking_www_section',
124 N("Office") => 'office_section',
125 join('|', N("Office"), N("Dictionary")) => 'office_dictionary_section',
126 join('|', N("Office"), N("Finance")) => 'finances_section',
127 join('|', N("Office"), N("Management")) => 'timemanagement_section',
128 join('|', N("Office"), N("Organizer")) => 'timemanagement_section',
129 join('|', N("Office"), N("Utilities")) => 'office_accessories_section',
130 join('|', N("Office"), N("Spreadsheet")) => 'spreadsheet_section',
131 join('|', N("Office"), N("Suite")) => 'office_suite',
132 join('|', N("Office"), N("Word processor")) => 'wordprocessor_section',
133 N("Publishing") => 'publishing_section',
134 N("Sciences") => 'sciences_section',
135 join('|', N("Sciences"), N("Astronomy")) => 'astronomy_section',
136 join('|', N("Sciences"), N("Biology")) => 'biology_section',
137 join('|', N("Sciences"), N("Chemistry")) => 'chemistry_section',
138 join('|', N("Sciences"), N("Computer science")) => 'computer_science_section',
139 join('|', N("Sciences"), N("Geosciences")) => 'geosciences_section',
140 join('|', N("Sciences"), N("Mathematics")) => 'mathematics_section',
141 join('|', N("Sciences"), N("Other")) => 'other_sciences',
142 join('|', N("Sciences"), N("Physics")) => 'physics_section',
143 N("Security") => 'security_section',
144 N("Shells") => 'shells_section',
145 N("Sound") => 'sound_section',
146 join('|', N("Sound"), N("Editors and Converters")) => 'sound_editors_section',
147 join('|', N("Sound"), N("Midi")) => 'sound_midi_section',
148 join('|', N("Sound"), N("Mixers")) => 'sound_mixers_section',
149 join('|', N("Sound"), N("Players")) => 'sound_players_section',
150 join('|', N("Sound"), N("Utilities")) => 'sound_utilities_section',
151 N("System") => 'system_section',
152 join('|', N("System"), N("Base")) => 'system_section',
153 join('|', N("System"), N("Boot and Init")) => 'boot_init_section',
154 join('|', N("System"), N("Cluster")) => 'parallel_computing_section',
155 join('|', N("System"), N("Configuration")) => 'configuration_section',
156 join('|', N("System"), N("Fonts")) => 'chinese_section',
157 join('|', N("System"), N("Fonts"), N("True type")) => '',
158 join('|', N("System"), N("Fonts"), N("Type1")) => '',
159 join('|', N("System"), N("Fonts"), N("X11 bitmap")) => '',
160 join('|', N("System"), N("Internationalization")) => 'chinese_section',
161 join('|', N("System"), N("Kernel and hardware")) => 'hardware_configuration_section',
162 join('|', N("System"), N("Libraries")) => 'system_section',
163 join('|', N("System"), N("Networking")) => 'networking_configuration_section',
164 join('|', N("System"), N("Packaging")) => 'packaging_section',
165 join('|', N("System"), N("Printing")) => 'printing_section',
166 join('|', N("System"), N("Servers")) => 'servers_section',
167 join('|', N("System"),
168 #-PO: This is a package/product name. Only translate it if needed:
169 N("X11")) => 'x11_section',
170 N("Terminals") => 'terminals_section',
171 N("Text tools") => 'text_tools_section',
172 N("Toys") => 'toys_section',
173 N("Video") => 'video_section',
174 join('|', N("Video"), N("Editors and Converters")) => 'video_editors_section',
175 join('|', N("Video"), N("Players")) => 'video_players_section',
176 join('|', N("Video"), N("Television")) => 'video_television_section',
177 join('|', N("Video"), N("Utilities")) => 'video_utilities_section',
178
179 # for Mageia Choice:
180 N("Workstation") => 'system_section',
181 join('|', N("Workstation"), N("Configuration")) => 'configuration_section',
182 join('|', N("Workstation"), N("Console Tools")) => 'interpreters_section',
183 join('|', N("Workstation"), N("Documentation")) => 'documentation_section',
184 join('|', N("Workstation"), N("Game station")) => 'amusement_section',
185 join('|', N("Workstation"), N("Internet station")) => 'networking_section',
186 join('|', N("Workstation"), N("Multimedia station")) => 'multimedia_section',
187 join('|', N("Workstation"), N("Network Computer (client)")) => 'other_networking',
188 join('|', N("Workstation"), N("Office Workstation")) => 'office_section',
189 join('|', N("Workstation"), N("Scientific Workstation")) => 'sciences_section',
190 N("Graphical Environment") => 'graphical_desktop_section',
191
192 join('|', N("Graphical Environment"), N("GNOME Workstation")) => 'gnome_section',
193 join('|', N("Graphical Environment"), N("IceWm Desktop")) => 'icewm_section',
194 join('|', N("Graphical Environment"), N("KDE Workstation")) => 'kde_section',
195 join('|', N("Graphical Environment"), N("Other Graphical Desktops")) => 'more_applications_other_section',
196 N("Development") => 'development_section',
197 join('|', N("Development"), N("Development")) => 'development_section',
198 join('|', N("Development"), N("Documentation")) => 'documentation_section',
199 N("Server") => 'servers_section',
200 join('|', N("Server"), N("DNS/NIS")) => 'networking_section',
201 join('|', N("Server"), N("Database")) => 'databases_section',
202 join('|', N("Server"), N("Firewall/Router")) => 'networking_section',
203 join('|', N("Server"), N("Mail")) => 'mail_section',
204 join('|', N("Server"), N("Mail/Groupware/News")) => 'mail_section',
205 join('|', N("Server"), N("Network Computer server")) => 'networking_section',
206 join('|', N("Server"), N("Web/FTP")) => 'networking_www_section',
207
208 );
209
210 sub get_icon {
211 my ($group, $o_parent) = @_;
212 my $pixbuf;
213 my $path = $group =~ /\|/ ? '/usr/share/icons/mini/' : '/usr/share/icons/';
214 my $create_pixbuf = sub { eval { gtknew('Pixbuf', file => join('', $path, $_[0], '.png')) } };
215 $pixbuf = $create_pixbuf->($group_icons{$group});
216 $pixbuf ||= $create_pixbuf->($group_icons{$o_parent}) if $o_parent;
217 $pixbuf ||= $create_pixbuf->('applications_section');
218 }
219
220 1;

  ViewVC Help
Powered by ViewVC 1.1.28