diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-01-12 12:26:56 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-01-12 12:26:56 +0000 |
commit | 7012331dc9b3846e57d1c2a59ac4142f2fbeb44e (patch) | |
tree | e6b23239f0c48d1bb02c7a336c06964eb467fa6c | |
parent | d488f42bb89836f65cb19c64d920382209ed7e7b (diff) | |
download | control-center-7012331dc9b3846e57d1c2a59ac4142f2fbeb44e.tar control-center-7012331dc9b3846e57d1c2a59ac4142f2fbeb44e.tar.gz control-center-7012331dc9b3846e57d1c2a59ac4142f2fbeb44e.tar.bz2 control-center-7012331dc9b3846e57d1c2a59ac4142f2fbeb44e.tar.xz control-center-7012331dc9b3846e57d1c2a59ac4142f2fbeb44e.zip |
move icon definition from tree definition into new data structure (thus
achieving data centralization regarding right icons)
-rwxr-xr-x | control-center | 168 |
1 files changed, 110 insertions, 58 deletions
diff --git a/control-center b/control-center index c04c3194..7be84b58 100755 --- a/control-center +++ b/control-center @@ -131,6 +131,7 @@ my $exec_hash = description => #-PO: this message is already translated in drakx domain from which MCC will searchs it: N("Authentication"), + icon => 'wizard-mdk', }, @@ -139,6 +140,7 @@ my $exec_hash = binary => "$sbindir/drakautoinst", embedded => 1, description => N("Auto Install floppy"), + icon => 'drakautoinst-mdk', }, @@ -147,6 +149,7 @@ my $exec_hash = binary => "$sbindir/drakboot", embedded => 1, description => N("Autologin"), + icon => 'autologin-mdk', }, @@ -155,6 +158,7 @@ my $exec_hash = binary => "$sbindir/drakbackup", embedded => 1, description => N("Backups"), + icon => 'backup-mdk', }, @@ -163,6 +167,7 @@ my $exec_hash = binary => "$sbindir/drakboot --boot", embedded => 1, description => N("Boot loader"), + icon => 'drakboot-mdk', }, @@ -171,6 +176,7 @@ my $exec_hash = binary => "$sbindir/drakboot --splash", embedded => 1, description => N("Boot theme"), + icon => 'boot-theme-mdk', }, @@ -179,6 +185,7 @@ my $exec_hash = binary => "$sbindir/drakfloppy", embedded => 1, description => N("Boot floppy"), + icon => 'drakfloppy-mdk', }, @@ -187,6 +194,7 @@ my $exec_hash = binary => "$sbindir/drakgw", embedded => 1, description => N("Internet connection sharing"), + icon => 'drakgw-mdk', }, @@ -195,6 +203,7 @@ my $exec_hash = binary => "$sbindir/drakconnect --wizard", embedded => 1, description => N("New connection"), + icon => 'new-connection-mdk', }, @@ -203,6 +212,7 @@ my $exec_hash = binary => "$sbindir/drakconnect --internet", embedded => 1, description => N("Internet access"), + icon => 'internet-access-mdk', }, @@ -211,6 +221,7 @@ my $exec_hash = binary => "$sbindir/drakconsole", embedded => 1, description => N("Console"), + icon => 'console-mdk', }, @@ -220,6 +231,7 @@ my $exec_hash = embedded => 1, description => N("Date and time"), #The Console will help you to solve issues + icon => 'time-mdk', }, @@ -228,6 +240,7 @@ my $exec_hash = binary => "$sbindir/drakedm", embedded => 1, description => N("Display manager"), + icon => 'drakedm-mdk', }, @@ -236,6 +249,7 @@ my $exec_hash = binary => "$sbindir/drakfax_server", embedded => 1, description => N("Fax"), + icon => 'drakfax-mdk', }, @@ -244,6 +258,7 @@ my $exec_hash = binary => "$sbindir/drakfirewall", embedded => 1, description => N("Firewall"), + icon => 'firewall-mdk', }, @@ -252,6 +267,7 @@ my $exec_hash = binary => "$sbindir/drakfont", embedded => 1, description => N("Fonts"), + icon => 'drakfont-mdk', }, @@ -260,6 +276,7 @@ my $exec_hash = binary => "$sbindir/XFdrake", embedded => 1, description => N("Graphical server"), + icon => 'XFdrake-mdk' }, @@ -268,6 +285,7 @@ my $exec_hash = binary => "$sbindir/diskdrake --hd", embedded => 1, description => N("Partitions"), + icon => 'diskdrake_hd', }, @@ -276,6 +294,7 @@ my $exec_hash = binary => "$sbindir/harddrake2", embedded => 1, description => N("Hardware"), + icon => 'harddrake-mdk', }, @@ -284,6 +303,7 @@ my $exec_hash = binary => "$sbindir/rpmdrake", embedded => 1, description => N("Install"), + icon => 'rpmdrake', }, @@ -292,6 +312,7 @@ my $exec_hash = binary => "$sbindir/rpmdrake-remove", embedded => 1, description => N("Installed Softwares"), + icon => 'rpmdrake-remove', }, @@ -300,6 +321,7 @@ my $exec_hash = binary => "$sbindir/keyboarddrake", embedded => 1, description => N("Keyboard"), + icon => 'keyboard-mdk', }, @@ -328,6 +350,7 @@ my $exec_hash = binary => "$sbindir/logdrake", embedded => 1, description => N("Logs"), + icon => 'logdrake-mdk', }, @@ -336,6 +359,7 @@ my $exec_hash = binary => "$sbindir/drakconnect --skip-wizard", embedded => 1, description => N("Manage connections"), + icon => 'manage-connections-mdk', }, @@ -344,6 +368,7 @@ my $exec_hash = binary => "$sbindir/park-rpmdrake", embedded => 1, description => N("Manage computer group"), + icon => 'drakpark-mdk', }, @@ -352,6 +377,7 @@ my $exec_hash = binary => "$sbindir/MandrakeUpdate", embedded => 1, description => N("Updates"), + icon => 'MandrakeUpdate', }, @@ -360,6 +386,7 @@ my $exec_hash = binary => "$bindir/menudrake", embedded => -1, description => N("Menus"), + icon => 'menudrake-mdk', }, @@ -368,6 +395,7 @@ my $exec_hash = binary => "$sbindir/XFdrake monitor", embedded => 1, description => N("Monitor"), + icon => 'configure-monitor-mdk', }, @@ -376,6 +404,7 @@ my $exec_hash = binary => "$sbindir/net_monitor", embedded => 1, description => N("Monitor connections"), + icon => 'net_monitor-mdk', }, @@ -384,6 +413,7 @@ my $exec_hash = binary => "$sbindir/mousedrake", embedded => 1, description => N("Mouse"), + icon => 'mousedrake-mdk', }, @@ -392,6 +422,7 @@ my $exec_hash = binary => "$sbindir/diskdrake --nfs", embedded => 1, description => N("NFS mount points"), + icon => 'diskdrake_nfs', }, @@ -400,6 +431,7 @@ my $exec_hash = binary => "$sbindir/diskdrake --fileshare", embedded => 1, description => N("Local disk sharing"), + icon => 'diskdrake_fileshare', }, @@ -408,6 +440,7 @@ my $exec_hash = binary => "$sbindir/printerdrake", embedded => -1, description => N("Printers"), + icon => 'printer-mcc-mdk', }, @@ -417,6 +450,7 @@ my $exec_hash = embedded => 1, description => N("Scheduled tasks"), #DrakCronAt enables to schedule Programs execution through crond and atd daemons + icon => 'drakcronat-mdk', }, "Proxy Configuration" => @@ -425,6 +459,7 @@ my $exec_hash = embedded => 1, description => N("Proxy"), #for files and web browsing + icon => 'drakproxy-mdk', }, "Remote Control" => @@ -432,6 +467,7 @@ my $exec_hash = binary => "$xbindir/rfbdrake", embedded => 1, description => N("Remote Control (Linux/Unix, Windows)"), + icon => 'internet-access-mdk', }, @@ -440,6 +476,7 @@ my $exec_hash = binary => "$sbindir/drakconnect --del", embedded => 1, description => N("Remove a connection"), + icon => 'remove-connection-mdk', }, @@ -448,6 +485,7 @@ my $exec_hash = binary => "$sbindir/rpmdrake-remove", embedded => 1, description => N("Remove"), + icon => 'rpmdrake-remove', }, @@ -456,6 +494,7 @@ my $exec_hash = binary => "$sbindir/XFdrake resolution", embedded => 1, description => N("Screen resolution"), + icon => 'resolution-mdk', }, @@ -464,6 +503,7 @@ my $exec_hash = binary => "$sbindir/diskdrake --smb", embedded => 1, description => N("Samba mount points"), + icon => 'diskdrake_samba', }, @@ -472,6 +512,7 @@ my $exec_hash = binary => "$sbindir/scannerdrake", embedded => 1, description => N("Scanners"), + icon => 'scanner-mdk', }, @@ -480,6 +521,7 @@ my $exec_hash = binary => "$sbindir/draksec", embedded => 1, description => N("Level and checks"), + icon => 'draksec-mdk', }, @@ -488,6 +530,7 @@ my $exec_hash = binary => "$sbindir/drakperm", embedded => 1, description => N("Permissions"), + icon => 'drakperm-mdk', }, @@ -496,6 +539,7 @@ my $exec_hash = binary => "$sbindir/drakxservices", embedded => 1, description => N("Services"), + icon => 'service-mdk', }, @@ -504,6 +548,7 @@ my $exec_hash = binary => "$sbindir/edit-urpm-sources.pl", embedded => 1, description => N("Media Manager"), + icon => 'source-manager', }, @@ -512,6 +557,7 @@ my $exec_hash = binary => "$sbindir/drakxtv", embedded => 1, description => N("TV card"), + icon =>, 'tv-mdk', }, @@ -520,6 +566,7 @@ my $exec_hash = binary => "$sbindir/drakups --wizard", embedded => 1, description => N("UPS"), + icon => 'drakups-mdk', }, @@ -529,6 +576,7 @@ my $exec_hash = binary => "$bindir/userdrake", embedded => -1, description => N("Users and groups"), + icon => 'user-mdk', }, @@ -537,6 +585,7 @@ my $exec_hash = binary => "$sbindir/diskdrake --dav", embedded => 1, description => N("WebDAV mount points"), + icon => 'webdav-mdk', }, }; @@ -545,31 +594,31 @@ my $exec_hash = my @tree = ([ N("Boot"), 'boot-mdk', [ - if_(0 && detect_devices::floppies, [ "Boot Disk", 'drakfloppy-mdk', ]), - [ "Auto login Config", 'autologin-mdk', ], - [ "Boot Config", 'drakboot-mdk', ], - [ "Boot Theme", 'boot-theme-mdk', ], - if_(0, [ "Auto Install", 'drakautoinst-mdk', ]), + if_(0 && detect_devices::floppies, "Boot Disk"), + "Auto login Config", + "Boot Config", + "Boot Theme", + if_(0, "Auto Install"), ] ], [ N("Hardware"), 'drakhard-mdk', [ - [ "Hardware List", 'harddrake-mdk', ], - [ "Monitor", 'configure-monitor-mdk', ], - [ "Resolution", 'resolution-mdk', ], - if_(0, [ "Graphical server configuration", 'XFdrake-mdk', ]), - if_(-x "$bindir/drakfax", [ "Fax", 'drakfax-mdk', ]), - [ "TV Cards", 'tv-mdk', ], - [ "Keyboard", 'keyboard-mdk', ], - [ "Mouse", 'mousedrake-mdk', ], - [ "Printer", 'printer-mcc-mdk', ], - [ "Scanner", 'scanner-mdk', ], - [ "UPS", 'drakups-mdk', ], + "Hardware List",, + "Monitor", + "Resolution", + if_(0, "Graphical server configuration"), + if_(-x "$bindir/drakfax","Fax"), + "TV Cards", + "Keyboard", + "Mouse", + "Printer", + "Scanner", + "UPS", ] ], [ N("Mount Points"), 'partition-mdk', [ - [ "Hard Drives", 'diskdrake_hd', ], + "Hard Drives", (map { my ($type, $name, $scan, $text) = @$_; map_index { @@ -579,8 +628,9 @@ my @tree = binary => "$sbindir/diskdrake --removable=$_->{device}", embedded => 1, description => $text, + icon => "diskdrake_$type", }; - [ $full_name, "diskdrake_$type" ]; + $full_name, } $scan->(); } do { my %cdroms_by_type; @@ -594,57 +644,57 @@ my @tree = [ 'zip', N("Zip"), \&detect_devices::zips, N("ZIP drive") ], ), }), - [ "NFS mount points", 'diskdrake_nfs', ], - [ "Samba mount points", 'diskdrake_samba', ], - [ "WebDAV mount points", 'webdav-mdk', ], - [ "Partition Sharing", 'diskdrake_fileshare', ], + "NFS mount points",, + "Samba mount points", + "WebDAV mount points", + "Partition Sharing", ] ], [ N("Network & Internet"), 'net-mdk', [ - [ "Add Connection", 'new-connection-mdk', ], - [ "Configure Internet", 'internet-access-mdk', ], - [ "Manage Connection", 'manage-connections-mdk', ], - [ "Monitor Connection", 'net_monitor-mdk', ], - [ "Remove Interface", 'remove-connection-mdk', ], - [ "Proxy Configuration", 'drakproxy-mdk', ], - [ "Connection Sharing", 'drakgw-mdk', ], + "Add Connection", + "Configure Internet", + "Manage Connection", + "Monitor Connection", + "Remove Interface", + "Proxy Configuration", + "Connection Sharing", ], ], [ N("Security"), 'security-mdk', [ - [ "Security Level", 'draksec-mdk', ], - [ "Security Permissions", 'drakperm-mdk', ], - [ "Firewall", 'firewall-mdk', ], + "Security Level", + "Security Permissions", + "Firewall", ] ], [ N("System"), 'system-mdk', [ - [ "Authentication" , 'wizard-mdk', ], - [ "Menus" , 'menudrake-mdk', ], - [ "Display Manager chooser", 'drakedm-mdk', ], - [ "Services" , 'service-mdk', ], - [ "Fonts", 'drakfont-mdk', ], - [ "Date & Time" , 'time-mdk', ], - [ "Logs", 'logdrake-mdk', ], - if_($ENV{LANGUAGE} !~ /^zh/, [ "Console", 'console-mdk', ]), - [ "Users", 'user-mdk', ], - if_(-x "/usr/X11R6/bin/drakcronat", [ "Programs scheduling", 'drakcronat-mdk', ]), - [ "Backups", 'backup-mdk', ], -# [ "RFBDrake", 'unknown-mdk' ], + "Authentication", + "Menus", + "Display Manager chooser", + "Services", + "Fonts", + "Date & Time", + "Logs", + if_($ENV{LANGUAGE} !~ /^zh/, "Console"), + "Users", + if_(-x "/usr/X11R6/bin/drakcronat", "Programs scheduling"), + "Backups", +# "RFBDrake", 'unknown-mdk', ] ], if_($isRpmDrake || $isParkRpmDrake, [ N("Software Management"), 'software', [ if_($isRpmDrake, - [ "Install Software", 'rpmdrake' ], - [ "Installed Softwares", 'rpmdrake-remove' ], - [ "Remove Software", 'rpmdrake-remove' ], - [ "Mandrake Update", 'MandrakeUpdate' ], - [ "Software Media Manager", 'source-manager' ], + "Install Software", + "Installed Softwares", + "Remove Software", + "Mandrake Update", + "Software Media Manager", ), - if_($isParkRpmDrake, [ "Manage park", 'drakpark-mdk' ]), + if_($isParkRpmDrake, "Manage park"), ] ]), if_($isWiz, @@ -657,9 +707,10 @@ my @tree = binary => "$sbindir/drakwizard $wizard", embedded => 1, description => $description, + icon => $icon, }; - [ $id, $icon ]; + $id; } (# [ id, wizard file name, icon, description ] [ "DHCP wizard", "dhcp", 'dhcp_server-mdk', N("Configure DHCP") ], [ "DNS wizard", "bind", 'dns_server-mdk', N("Configure DNS") ], @@ -690,16 +741,17 @@ my @tree = binary => "$bindir/mdkwebadmin.pl $op", embedded => -1, description => $description, + icon => $icon, }; - [ $id, $icon ]; + $id; } (# [ id, wizard file name, icon, description ] [ "Local Admin", 'local-administration-mdk', '--direct', N("Local administration") ], [ "Remote Admin", 'remote-administration-mdk', '--link', N("Remote administration") ]) ) ), if_($isRfbDrake, - ["Remote Control", 'internet-access-mdk'] + "Remote Control", ) ] ]), @@ -1002,7 +1054,7 @@ foreach (@tree) { my @subtree; foreach my $stuff (@$subtree) { - my $exec = first(split /\s+/, $exec_hash->{$stuff->[0]}->{binary}); + my $exec = first(split /\s+/, $exec_hash->{$stuff}->{binary}); # do not complain about missing entries in move: if (-x $exec) { push @subtree, $stuff; @@ -1033,16 +1085,16 @@ foreach (@tree) { my $tbl = create_packtable({ col_spacings => $spacing, row_spacings => $spacing, homogeneous => 1, mcc => 1 }, group_by3(map { - my ($label, $tag) = @$_; - my $text = $exec_hash->{$label}->{description}; + my $label = $_; + my ($icon, $text) = @{$exec_hash->{$label}}{qw(icon description)}; die "$label 's icon is missing" if !$exec_hash->{$label} && $::testing; my $event_box; $tool_callbacks{$label} = sub { # needed for --start-with parameter: $event_box->realize; - compute_exec_string($label, $event_box, $tag, $text, $exec_hash->{$label}); + compute_exec_string($label, $event_box, $icon, $text, $exec_hash->{$label}); }; - $event_box = Gtk2::WebIcon->new($text, $tag, + $event_box = Gtk2::WebIcon->new($text, $icon, { button_release_event => $tool_callbacks{$label}, } |