From 40348a760c3b1d07924db2c7feefa14e2cc5bfae Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 10 Sep 2007 10:09:10 +0000 Subject: do not hardcode icon extension and path --- bin/drakconnect | 6 +++--- bin/drakgw | 2 +- bin/drakids | 2 +- bin/drakvpn-old | 2 +- bin/net_applet | 12 ++++++------ lib/network/connection.pm | 2 +- lib/network/connection/cable.pm | 2 +- lib/network/connection/cellular_bluetooth.pm | 2 +- lib/network/connection/cellular_card.pm | 2 +- lib/network/connection/dvb.pm | 2 +- lib/network/connection/ethernet.pm | 2 +- lib/network/connection/isdn.pm | 2 +- lib/network/connection/pots.pm | 2 +- lib/network/connection/wireless.pm | 2 +- lib/network/connection/xdsl.pm | 2 +- lib/network/connection_manager.pm | 4 ++-- lib/network/signal_strength.pm | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/bin/drakconnect b/bin/drakconnect index ece74c5..8318bcc 100755 --- a/bin/drakconnect +++ b/bin/drakconnect @@ -59,7 +59,7 @@ network::network::read_net_conf($net); my $modules_conf = modules::any_conf->read; $::Wizard_title = N("Network & Internet Configuration"); -$::Wizard_pix_up = "drakconnect.png"; +$::Wizard_pix_up = "drakconnect"; local $_ = join '', @ARGV; /--skip-wizard/ and manage(); @@ -710,7 +710,7 @@ sub del_intf() { require wizards; my $wiz = wizards->new( { - defaultimage => "drakconnect.png", + defaultimage => "drakconnect", name => N("Remove a network interface"), pages => { welcome => { @@ -786,7 +786,7 @@ sub update_list { } foreach my $interface (@new_intf) { my ($ip, $state) = get_intf_ip($interface); - $tree_model->set($intf{$interface}, map_index { $::i => $_ } (gtkcreate_pixbuf("eth_card_mini2.png"), $interface, $ip , $net->{ifcfg}{$interface}{BOOTPROTO}, $new_intf{$interface}, $state)); + $tree_model->set($intf{$interface}, map_index { $::i => $_ } (gtkcreate_pixbuf("eth_card_mini2"), $interface, $ip , $net->{ifcfg}{$interface}{BOOTPROTO}, $new_intf{$interface}, $state)); } foreach my $i (difference2([ keys %intf ], \@new_intf)) { $tree_model->remove($intf{$i}); diff --git a/bin/drakgw b/bin/drakgw index 965665c..85c9d03 100755 --- a/bin/drakgw +++ b/bin/drakgw @@ -67,7 +67,7 @@ my $dhcpd_conf = network::dhcpd::read_dhcpd_conf(); require wizards; my $wiz = wizards->new( { - defaultimage => "drakgw.png", + defaultimage => "drakgw", name => N("Internet Connection Sharing"), pages => { welcome => diff --git a/bin/drakids b/bin/drakids index 933a94e..dd3259e 100644 --- a/bin/drakids +++ b/bin/drakids @@ -37,7 +37,7 @@ my $services_log = create_service_list('status'); my $allowed_services = create_service_list(); my $blocked_services = create_service_list(); -$ugtk2::wm_icon = "/usr/lib/libDrakX/icons/drakfirewall.png"; +$ugtk2::wm_icon = "drakfirewall"; my $w = ugtk2->new(N("Interactive Firewall")); my $ifw; diff --git a/bin/drakvpn-old b/bin/drakvpn-old index b658325..de096a2 100755 --- a/bin/drakvpn-old +++ b/bin/drakvpn-old @@ -42,7 +42,7 @@ $::isInstall and die "Not supported during install.\n"; local $_ = join '', @ARGV; -$::Wizard_pix_up = "drakvpn.png"; +$::Wizard_pix_up = "drakvpn"; $ugtk2::wm_icon = "drakvpn"; my $direct = /-direct/; diff --git a/bin/net_applet b/bin/net_applet index 5e8a348..a1055fb 100644 --- a/bin/net_applet +++ b/bin/net_applet @@ -41,14 +41,14 @@ my $watched_interface; my %pixbufs = ( - firewall => gtknew('Pixbuf', file => 'drakfirewall.png'), - firewall_icon => gtknew('Pixbuf', file => 'drakfirewall.png')->scale_simple(24, 24, 'hyper'), + firewall => gtknew('Pixbuf', file => 'drakfirewall'), + firewall_icon => gtknew('Pixbuf', file => 'drakfirewall')->scale_simple(24, 24, 'hyper'), state => { map { $_ => gtknew('Pixbuf', file => $_) } qw(connected disconnected) }, link_level => { map { - $_ => gtknew('Pixbuf', file => 'wifi-' . sprintf('%03d', $_) . '.png')->scale_simple(24, 24, 'hyper'); + $_ => gtknew('Pixbuf', file => 'wifi-' . sprintf('%03d', $_))->scale_simple(24, 24, 'hyper'); } qw(20 40 60 80 100) }, encryption => { map { - $_ => gtknew('Pixbuf', file => "encryption-$_-24.png"); + $_ => gtknew('Pixbuf', file => "encryption-$_-24"); } qw(open weak strong) }, ); my %wireless_networks; @@ -563,7 +563,7 @@ sub ask_attack_verdict { my ($attack) = @_; my $w = ugtk2->new(N("Interactive Firewall: intrusion detected"), - icon => "drakfirewall.png"); + icon => "drakfirewall"); my ($blacklist, $whitelist, $ignore, $auto); my $update_automatic_mode = sub { $auto->get_active and $interactive_cb->set_active(1) }; @@ -648,7 +648,7 @@ sub handle_ifw_listen { sub ask_listen_verdict { my ($listen) = @_; - my $w = ugtk2->new(N("Interactive Firewall: new service"), icon => "drakfirewall.png"); + my $w = ugtk2->new(N("Interactive Firewall: new service"), icon => "drakfirewall"); my $set_verdict = sub { $bubble_queue->process_next; }; diff --git a/lib/network/connection.pm b/lib/network/connection.pm index a641691..fbe29dc 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -25,7 +25,7 @@ Get the connection type icon path =cut -sub get_type_icon() { '/usr/share/mcc/themes/default/drakconnect-mdk.png' } +sub get_type_icon() { '/usr/share/mcc/themes/default/drakconnect-mdk' } =item get_devices() diff --git a/lib/network/connection/cable.pm b/lib/network/connection/cable.pm index e74ac6a..8d4fe07 100644 --- a/lib/network/connection/cable.pm +++ b/lib/network/connection/cable.pm @@ -12,7 +12,7 @@ use detect_devices; sub get_type_name() { N("Cable") } sub get_type_description() { N("Cable modem") } -sub get_type_icon() { 'cablemodem-24.png' } +sub get_type_icon() { 'cablemodem-24' } sub get_metric { 20 } sub handles_ifcfg { diff --git a/lib/network/connection/cellular_bluetooth.pm b/lib/network/connection/cellular_bluetooth.pm index 1457795..0b16ba1 100644 --- a/lib/network/connection/cellular_bluetooth.pm +++ b/lib/network/connection/cellular_bluetooth.pm @@ -9,7 +9,7 @@ my $rfcomm_dev_prefix = "/dev/rfcomm"; sub get_type_name { N("Bluetooth") } sub get_type_description { N("Bluetooth Dial Up Networking") } -sub get_type_icon { 'bluetooth-24.png' } +sub get_type_icon { 'bluetooth-24' } sub get_devices { search_services('DUN') } sub get_metric { 45 } sub get_interface { "ppp0" } diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm index 9132f49..6ed31b6 100644 --- a/lib/network/connection/cellular_card.pm +++ b/lib/network/connection/cellular_card.pm @@ -6,7 +6,7 @@ use strict; use common; sub get_type_name() { N("GPRS/Edge/3G") } -sub get_type_icon() { 'cellular-24.png' } +sub get_type_icon() { 'cellular-24' } sub get_devices() { require detect_devices; my @maybe_usbserial_modules = ('usbserial_generic', 'unknown'); diff --git a/lib/network/connection/dvb.pm b/lib/network/connection/dvb.pm index 3364886..ec085b3 100644 --- a/lib/network/connection/dvb.pm +++ b/lib/network/connection/dvb.pm @@ -11,7 +11,7 @@ use modules; sub get_type_name() { N("DVB") } sub get_type_description() { N("Satellite (DVB)") } -sub get_type_icon() { 'dvb-24.png' } +sub get_type_icon() { 'dvb-24' } sub get_devices() { require detect_devices; diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index 39752f5..e7aff7c 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -8,7 +8,7 @@ use common; our @dhcp_clients = qw(dhclient dhcpcd pump dhcpxd); sub get_type_name() { N("Ethernet") } -sub get_type_icon() { 'ethernet-24.png' } +sub get_type_icon() { 'ethernet-24' } sub get_devices() { #require list_modules; diff --git a/lib/network/connection/isdn.pm b/lib/network/connection/isdn.pm index 4b85d1d..84c2d10 100644 --- a/lib/network/connection/isdn.pm +++ b/lib/network/connection/isdn.pm @@ -6,7 +6,7 @@ use strict; use common; sub get_type_name { N("ISDN") } -sub get_type_icon { 'isdn-24.png' } +sub get_type_icon { 'isdn-24' } sub get_devices { require modules; diff --git a/lib/network/connection/pots.pm b/lib/network/connection/pots.pm index be7bf9f..449d58d 100644 --- a/lib/network/connection/pots.pm +++ b/lib/network/connection/pots.pm @@ -15,7 +15,7 @@ sub get_type_description { #-PO: for example, in French, it can be translated as "RTC" N("Analog telephone modem (POTS)"); } -sub get_type_icon { 'potsmodem-24.png' } +sub get_type_icon { 'potsmodem-24' } sub get_metric { 50 } sub handles_ifcfg { diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm index 59f8747..fd0c82b 100644 --- a/lib/network/connection/wireless.pm +++ b/lib/network/connection/wireless.pm @@ -9,7 +9,7 @@ use strict; use common; sub get_type_name() { N("Wireless") } -sub get_type_icon() { 'wireless-24.png' } +sub get_type_icon() { 'wireless-24' } sub get_devices { my ($_class, %options) = @_; require detect_devices; diff --git a/lib/network/connection/xdsl.pm b/lib/network/connection/xdsl.pm index 337d4f7..f810ba5 100644 --- a/lib/network/connection/xdsl.pm +++ b/lib/network/connection/xdsl.pm @@ -6,7 +6,7 @@ use strict; use common; sub get_type_name() { N("DSL") } -sub get_type_icon() { 'xdsl-24.png' } +sub get_type_icon() { 'xdsl-24' } sub get_devices() { require detect_devices; diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 83def2d..f5d539d 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -20,10 +20,10 @@ sub create_pixbufs() { { state => { map { $_ => gtkcreate_pixbuf($_) } qw(connected disconnected refresh) }, link_level => { map { - $_ => gtkcreate_pixbuf('wifi-' . sprintf('%03d', $_) . '.png')->scale_simple(24, 24, 'hyper'); + $_ => gtkcreate_pixbuf('wifi-' . sprintf('%03d', $_))->scale_simple(24, 24, 'hyper'); } qw(20 40 60 80 100) }, encryption => { map { - $_ => gtkcreate_pixbuf("encryption-$_-24.png"); + $_ => gtkcreate_pixbuf("encryption-$_-24"); } qw(open weak strong) }, }; } diff --git a/lib/network/signal_strength.pm b/lib/network/signal_strength.pm index 0fa891d..19e119c 100644 --- a/lib/network/signal_strength.pm +++ b/lib/network/signal_strength.pm @@ -8,7 +8,7 @@ my %pixbufs; sub get_strength_icon { my ($network) = @_; my $approx = 20 + min(80, int($network->{signal_strength}/20)*20); - return $pixbufs{$approx} ||= ugtk2::gtkcreate_pixbuf('wifi-' . sprintf('%03d', $approx) . '.png'); + return $pixbufs{$approx} ||= ugtk2::gtkcreate_pixbuf('wifi-' . sprintf('%03d', $approx)); } 1; -- cgit v1.2.1