summaryrefslogtreecommitdiffstats
path: root/lib/network
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network')
-rw-r--r--lib/network/connection_manager/gtk.pm14
-rw-r--r--lib/network/drakconnect/edit.pm196
-rw-r--r--lib/network/drakconnect/global.pm36
-rwxr-xr-xlib/network/drakroam.pm24
-rw-r--r--lib/network/net_applet/ifw.pm14
-rwxr-xr-xlib/network/netcenter.pm16
-rw-r--r--lib/network/signal_strength.pm4
7 files changed, 152 insertions, 152 deletions
diff --git a/lib/network/connection_manager/gtk.pm b/lib/network/connection_manager/gtk.pm
index 8fe7851..0d3af67 100644
--- a/lib/network/connection_manager/gtk.pm
+++ b/lib/network/connection_manager/gtk.pm
@@ -5,9 +5,9 @@ use base qw(network::connection_manager);
use strict;
use common;
-use mygtk2;
-use ugtk2 qw(:create :helpers :wrappers);
-use Gtk2::SimpleList;
+use mygtk3;
+use ugtk3 qw(:create :helpers :wrappers);
+use Gtk3::SimpleList;
use network::signal_strength;
use locale; # for cmp
@@ -57,7 +57,7 @@ sub create_networks_list {
return;
}
- $cmanager->{gui}{networks_list} = Gtk2::SimpleList->new(
+ $cmanager->{gui}{networks_list} = Gtk3::SimpleList->new(
"AP" => "hidden",
'' => "pixbuf",
N("SSID") => "text",
@@ -150,7 +150,7 @@ sub update_on_status_change {
if ($cmanager->{gui}{status_image} && $cmanager->{connection}) {
my $icon = $cmanager->{connection}->get_status_icon;
- ugtk2::_find_imgfile($icon) or $icon = $cmanager->{connection}->get_type_icon;
+ ugtk3::_find_imgfile($icon) or $icon = $cmanager->{connection}->get_type_icon;
gtkset($cmanager->{gui}{status_image}, file => $icon);
}
}
@@ -186,7 +186,7 @@ sub update_networks_list {
if ($cmanager->{gui}{show_unique_network}) {
gtkset($cmanager->{gui}{networks_list}, children => [
1, $network_name,
- 0, Gtk2::Image->new_from_pixbuf($strength_pixbuf),
+ 0, Gtk3::Image->new_from_pixbuf($strength_pixbuf),
]);
$cmanager->{connection}{network} = $network_name;
} else {
@@ -210,7 +210,7 @@ sub update_networks_list {
sub setup_dbus_handlers {
my ($cmanagers, $connections, $on_network_event, $dbus) = @_;
network::connection_manager::setup_dbus_handlers($cmanagers, $connections, $on_network_event, $dbus);
- dbus_object::set_gtk2_watch_helper($dbus);
+ dbus_object::set_gtk3_watch_helper($dbus);
}
1;
diff --git a/lib/network/drakconnect/edit.pm b/lib/network/drakconnect/edit.pm
index 8132368..8a258f8 100644
--- a/lib/network/drakconnect/edit.pm
+++ b/lib/network/drakconnect/edit.pm
@@ -1,8 +1,8 @@
package network::drakconnect::edit;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
-use ugtk2 qw(:create :dialogs :helpers :wrappers);
-use mygtk2 qw(gtknew);
+use ugtk3 qw(:create :dialogs :helpers :wrappers);
+use mygtk3 qw(gtknew);
use common;
use detect_devices;
use run_program;
@@ -18,13 +18,13 @@ sub manage {
my $p = {};
my ($interface_menu, $selected, $apply_button);
- my $window = ugtk2->new('Manage Connection');
+ my $window = ugtk3->new('Manage Connection');
unless ($::isEmbedded) {
$window->{rwindow}->set_position('center');
$window->{rwindow}->set_title(N("Manage connections")); # translation availlable in mcc domain => we need merging
}
- my $notebook = Gtk2::Notebook->new;
+ my $notebook = Gtk3::Notebook->new;
$notebook->set_property('show-tabs', 0);
$notebook->set_property('show-border', 0);
@@ -46,10 +46,10 @@ sub manage {
};
}
- $window->{rwindow}->add(gtkpack_(Gtk2::VBox->new,
- 0, gtkpack__(Gtk2::HBox->new,
+ $window->{rwindow}->add(gtkpack_(Gtk3::VBox->new,
+ 0, gtkpack__(Gtk3::HBox->new,
gtknew('Label', text => N("Device: "), alignment => [ 0, 0 ]),
- $interface_menu = gtksignal_connect(Gtk2::ComboBox->new_text,
+ $interface_menu = gtksignal_connect(Gtk3::ComboBox->new_text,
changed => sub {
$selected = $interface_menu->get_text;
$notebook->set_current_page($p->{$selected}{gui}{index});
@@ -59,13 +59,13 @@ sub manage {
1, $notebook,
0, create_okcancel(my $oc =
{
- cancel_clicked => sub { $window->destroy; Gtk2->main_quit },
+ cancel_clicked => sub { $window->destroy; Gtk3->main_quit },
ok_clicked => sub {
if ($apply_button->get_property('sensitive')) {
save($in, $net, $modules_conf, $p, $apply_button);
}
$window->destroy;
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
},
undef, undef, '',
@@ -82,7 +82,7 @@ sub manage {
$p->{$name}{intf} ||= { DEVICE => $interface };
build_tree($in, $net, $p->{$name}{intf}, $name);
build_notebook($net, \@all_cards, $p->{$name}{intf}, $p->{$name}{gui}, $apply_button, $name, $interface);
- $notebook->append_page(gtkpack(Gtk2::VBox->new(0,0), $p->{$name}{gui}{notebook}));
+ $notebook->append_page(gtkpack(Gtk3::VBox->new(0,0), $p->{$name}{gui}{notebook}));
} (sort keys %$p);
$interface_menu->set_popdown_strings(sort keys %$p);
@@ -126,15 +126,15 @@ sub build_notebook {
my $apply = sub { $apply_button->set_sensitive(1) };
my $is_ethernet = detect_devices::is_lan_interface($interface);
- my $size_group = Gtk2::SizeGroup->new('horizontal');
+ my $size_group = Gtk3::SizeGroup->new('horizontal');
if ($intf->{pages}{'TCP/IP'}) {
- gtkpack__($gui->{sheet}{'TCP/IP'} = gtkset_border_width(Gtk2::VBox->new(0,10), 5),
+ gtkpack__($gui->{sheet}{'TCP/IP'} = gtkset_border_width(Gtk3::VBox->new(0,10), 5),
gtknew('Title2', label => N("IP configuration")),
if_($is_ethernet,
- gtkpack(Gtk2::HBox->new(1,0),
+ gtkpack(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("Protocol")),
- $gui->{intf}{BOOTPROTO} = gtksignal_connect(Gtk2::ComboBox->new_text, changed => sub {
+ $gui->{intf}{BOOTPROTO} = gtksignal_connect(Gtk3::ComboBox->new_text, changed => sub {
return if !$_[0]->realized;
my $proto = $gui->{intf}{BOOTPROTO};
my $protocol = $intf->{BOOTPROTO} = { reverse %{$proto->{protocols}} }->{$proto->get_text};
@@ -148,20 +148,20 @@ sub build_notebook {
),
),
),
- gtkpack(Gtk2::HBox->new(1,0),
+ gtkpack(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("IP address")),
- gtksignal_connect($gui->{intf}{IPADDR} = Gtk2::Entry->new,
+ gtksignal_connect($gui->{intf}{IPADDR} = Gtk3::Entry->new,
key_press_event => $apply),
),
- gtkpack(Gtk2::HBox->new(1,0),
+ gtkpack(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("Netmask")),
- gtksignal_connect($gui->{intf}{NETMASK} = Gtk2::Entry->new,
+ gtksignal_connect($gui->{intf}{NETMASK} = Gtk3::Entry->new,
key_press_event => $apply),
),
if_($is_ethernet,
- gtkpack(Gtk2::HBox->new(1,0),
+ gtkpack(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("Gateway")),
- gtksignal_connect($gui->{network}{GATEWAY} = Gtk2::Entry->new,
+ gtksignal_connect($gui->{network}{GATEWAY} = Gtk3::Entry->new,
key_press_event => $apply),
),
),
@@ -170,7 +170,7 @@ sub build_notebook {
$intf->{dns2} || $net->{resolv}{dnsServer2},
$intf->{dns3} || $net->{resolv}{dnsServer3}),
),
- gtkpack(Gtk2::HBox->new(1,0),
+ gtkpack(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("Search Domain")),
my $w2 = gtknew('Label_Left', text => $intf->{domain} || $net->{resolv}{DOMAINNAME} || 'none'),
),
@@ -194,25 +194,25 @@ sub build_notebook {
}
if ($intf->{pages}{DHCP}) {
- gtkpack(gtkset_border_width($gui->{sheet}{DHCP} = Gtk2::HBox->new(0,10), 5),
- gtkpack__(gtkset_border_width(Gtk2::VBox->new(0,10), 5),
- gtkpack__(Gtk2::HBox->new(1,0),
+ gtkpack(gtkset_border_width($gui->{sheet}{DHCP} = Gtk3::HBox->new(0,10), 5),
+ gtkpack__(gtkset_border_width(Gtk3::VBox->new(0,10), 5),
+ gtkpack__(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("DHCP client")),
- gtksignal_connect($gui->{intf}{DHCP_CLIENT} = Gtk2::ComboBox->new_with_strings(\@network::connection::ethernet::dhcp_clients,
+ gtksignal_connect($gui->{intf}{DHCP_CLIENT} = Gtk3::ComboBox->new_with_strings(\@network::connection::ethernet::dhcp_clients,
$intf->{DHCP_CLIENT} || $network::connection::ethernet::dhcp_clients[0]),
changed => $apply)),
- gtksignal_connect($gui->{intf_bool}{NEEDHOSTNAME} = Gtk2::CheckButton->new(N("Assign host name from DHCP server (or generate a unique one)")), toggled => $apply),
- gtkpack__(Gtk2::HBox->new(1,0),
+ gtksignal_connect($gui->{intf_bool}{NEEDHOSTNAME} = Gtk3::CheckButton->new(N("Assign host name from DHCP server (or generate a unique one)")), toggled => $apply),
+ gtkpack__(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("DHCP host name")),
- gtksignal_connect($gui->{intf}{DHCP_HOSTNAME} = Gtk2::Entry->new,
+ gtksignal_connect($gui->{intf}{DHCP_HOSTNAME} = Gtk3::Entry->new,
key_press_event => $apply)),
- gtkpack__(Gtk2::HBox->new(1,0),
+ gtkpack__(Gtk3::HBox->new(1,0),
gtknew('Label_Left', text => N("DHCP timeout (in seconds)")),
- gtksignal_connect($gui->{intf}{DHCP_TIMEOUT} = Gtk2::Entry->new,
+ gtksignal_connect($gui->{intf}{DHCP_TIMEOUT} = Gtk3::Entry->new,
key_press_event => $apply)),
- gtksignal_connect($gui->{intf_bool}{PEERDNS} = Gtk2::CheckButton->new(N("Get DNS servers from DHCP")), toggled => $apply),
- gtksignal_connect($gui->{intf_bool}{PEERYP} = Gtk2::CheckButton->new(N("Get YP servers from DHCP")), toggled => $apply),
- gtksignal_connect($gui->{intf_bool}{PEERNTPD} = Gtk2::CheckButton->new(N("Get NTPD servers from DHCP")), toggled => $apply),
+ gtksignal_connect($gui->{intf_bool}{PEERDNS} = Gtk3::CheckButton->new(N("Get DNS servers from DHCP")), toggled => $apply),
+ gtksignal_connect($gui->{intf_bool}{PEERYP} = Gtk3::CheckButton->new(N("Get YP servers from DHCP")), toggled => $apply),
+ gtksignal_connect($gui->{intf_bool}{PEERNTPD} = Gtk3::CheckButton->new(N("Get NTPD servers from DHCP")), toggled => $apply),
),
);
foreach (qw(NEEDHOSTNAME PEERDNS)) { #- default these settings to yes
@@ -223,15 +223,15 @@ sub build_notebook {
$gui->{intf}{DHCP_CLIENT}->set_text($intf->{DHCP_CLIENT});
$gui->{sheet}{DHCP}->set_sensitive($intf->{BOOTPROTO} eq 'dhcp');
}
- my $size_group2 = Gtk2::SizeGroup->new('horizontal');
+ my $size_group2 = Gtk3::SizeGroup->new('horizontal');
$size_group2->add_widget($_) foreach $gui->{intf}{DHCP_HOSTNAME}, $gui->{intf}{DHCP_TIMEOUT}, $gui->{intf}{DHCP_CLIENT};
if ($intf->{pages}{Wireless}) {
- gtkpack(gtkset_border_width($gui->{sheet}{Wireless} = Gtk2::HBox->new(0,10), 5),
- gtkpack_(Gtk2::VBox->new(0,0),
- map { (0, gtkpack_(Gtk2::VBox->new(0,0),
- 1, Gtk2::Label->new($_->[0]),
- 0, gtksignal_connect($gui->{intf}{$_->[1]} = Gtk2::Entry->new,
+ gtkpack(gtkset_border_width($gui->{sheet}{Wireless} = Gtk3::HBox->new(0,10), 5),
+ gtkpack_(Gtk3::VBox->new(0,0),
+ map { (0, gtkpack_(Gtk3::VBox->new(0,0),
+ 1, Gtk3::Label->new($_->[0]),
+ 0, gtksignal_connect($gui->{intf}{$_->[1]} = Gtk3::Entry->new,
key_press_event => $apply),
));
} ([ N("Operating Mode"), "WIRELESS_MODE" ],
@@ -242,11 +242,11 @@ sub build_notebook {
[ N("Bitrate (in b/s)"), "WIRELESS_RATE" ]
),
),
- Gtk2::VSeparator->new,
- gtkpack_(Gtk2::VBox->new(0,0),
- map { (0, gtkpack_(Gtk2::VBox->new(0,0),
- 1, Gtk2::Label->new($_->[0]),
- 0, gtksignal_connect($gui->{intf}{$_->[1]} = Gtk2::Entry->new,
+ Gtk3::VSeparator->new,
+ gtkpack_(Gtk3::VBox->new(0,0),
+ map { (0, gtkpack_(Gtk3::VBox->new(0,0),
+ 1, Gtk3::Label->new($_->[0]),
+ 0, gtksignal_connect($gui->{intf}{$_->[1]} = Gtk3::Entry->new,
key_press_event => $apply),
));
} ([ N("Encryption key"), 'WIRELESS_ENC_KEY' ],
@@ -261,37 +261,37 @@ sub build_notebook {
}
if ($intf->{pages}{Options}) {
- gtkpack__(gtkset_border_width($gui->{sheet}{Options} = Gtk2::VBox->new(0,10), 5),
- $gui->{intf_bool}{ONBOOT} = gtksignal_connect(Gtk2::CheckButton->new(N("Start at boot")),
+ gtkpack__(gtkset_border_width($gui->{sheet}{Options} = Gtk3::VBox->new(0,10), 5),
+ $gui->{intf_bool}{ONBOOT} = gtksignal_connect(Gtk3::CheckButton->new(N("Start at boot")),
toggled => $apply),
if_($is_ethernet,
- map { ($gui->{intf_bool}{$_->[0]} = gtksignal_connect(Gtk2::CheckButton->new($_->[1]),
+ map { ($gui->{intf_bool}{$_->[0]} = gtksignal_connect(Gtk3::CheckButton->new($_->[1]),
toggled => $apply));
} (
[ "MII_NOT_SUPPORTED", N("Network Hotplugging") ],
),
),
if_($interface eq 'isdn',
- gtkpack(Gtk2::HBox->new(0,0),
- gtkpack__(Gtk2::VBox->new(0,0),
- Gtk2::Label->new(N("Dialing mode")),
+ gtkpack(Gtk3::HBox->new(0,0),
+ gtkpack__(Gtk3::VBox->new(0,0),
+ Gtk3::Label->new(N("Dialing mode")),
my @dialing_mode_radio = gtkradio(("auto") x 2, "manual"),
),
- Gtk2::VSeparator->new,
- gtkpack__(Gtk2::VBox->new(0,0),
- Gtk2::Label->new(N("Connection speed")),
+ Gtk3::VSeparator->new,
+ gtkpack__(Gtk3::VBox->new(0,0),
+ Gtk3::Label->new(N("Connection speed")),
my @speed_radio = gtkradio(("64 Kb/s") x 2, "128 Kb/s"),
),
),
- gtkpack__(Gtk2::HBox->new(0,5),
- Gtk2::Label->new(N("Connection timeout (in sec)")),
- gtksignal_connect($gui->{intf}{huptimeout} = Gtk2::Entry->new,
+ gtkpack__(Gtk3::HBox->new(0,5),
+ Gtk3::Label->new(N("Connection timeout (in sec)")),
+ gtksignal_connect($gui->{intf}{huptimeout} = Gtk3::Entry->new,
key_press_event => $apply),
),
),
- gtkpack__(Gtk2::HBox->new(0,1),
+ gtkpack__(Gtk3::HBox->new(0,1),
gtknew('Label_Left', text => N("Metric")),
- gtksignal_connect(gtkset_text($gui->{intf}{METRIC} = Gtk2::Entry->new, $intf->{METRIC}),
+ gtksignal_connect(gtkset_text($gui->{intf}{METRIC} = Gtk3::Entry->new, $intf->{METRIC}),
key_press_event => $apply)),
);
@@ -307,16 +307,16 @@ sub build_notebook {
if ($interface_name =~ /^speedtouch|sagem$/) {
$gui->{description} = $interface_name eq 'speedtouch' ? 'Alcatel|USB ADSL Modem (Speed Touch)' : 'Analog Devices Inc.|USB ADSL modem';
}
- gtkpack_(gtkset_border_width($gui->{sheet}{Account} = Gtk2::VBox->new(0,10), 5),
+ gtkpack_(gtkset_border_width($gui->{sheet}{Account} = Gtk3::VBox->new(0,10), 5),
if_($interface eq 'modem',
- 0, gtkpack(Gtk2::VBox->new(1,0),
- gtkpack__(Gtk2::HBox->new, Gtk2::Label->new(N("Authentication"))),
- gtkpack__(Gtk2::HBox->new, $gui->{intf}{auth} = gtksignal_connect(Gtk2::ComboBox->new_text,
+ 0, gtkpack(Gtk3::VBox->new(1,0),
+ gtkpack__(Gtk3::HBox->new, Gtk3::Label->new(N("Authentication"))),
+ gtkpack__(Gtk3::HBox->new, $gui->{intf}{auth} = gtksignal_connect(Gtk3::ComboBox->new_text,
changed => $apply)),
)),
- map { (0, gtkpack(Gtk2::VBox->new(1,0),
- gtkpack__(Gtk2::HBox->new, Gtk2::Label->new($_->[0])),
- gtkpack__(Gtk2::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk2::Entry->new,
+ map { (0, gtkpack(Gtk3::VBox->new(1,0),
+ gtkpack__(Gtk3::HBox->new, Gtk3::Label->new($_->[0])),
+ gtkpack__(Gtk3::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk3::Entry->new,
key_press_event => $apply)),
),
);
@@ -335,12 +335,12 @@ sub build_notebook {
}
if ($intf->{pages}{Modem}) {
- gtkpack(gtkset_border_width($gui->{sheet}{Modem} = Gtk2::HBox->new(0,10), 5),
+ gtkpack(gtkset_border_width($gui->{sheet}{Modem} = Gtk3::HBox->new(0,10), 5),
if_($interface eq 'modem',
- gtkpack__(Gtk2::VBox->new(0,5),
- (map { (gtkpack(Gtk2::VBox->new(1,0),
- gtkpack__(Gtk2::HBox->new, Gtk2::Label->new($_->[0])),
- gtkpack__(Gtk2::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk2::ComboBox->new_text,
+ gtkpack__(Gtk3::VBox->new(0,5),
+ (map { (gtkpack(Gtk3::VBox->new(1,0),
+ gtkpack__(Gtk3::HBox->new, Gtk3::Label->new($_->[0])),
+ gtkpack__(Gtk3::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk3::ComboBox->new_text,
changed => $apply)),
),
);
@@ -348,38 +348,38 @@ sub build_notebook {
[ N("Line termination"), 'Enter' ],
[ N("Connection speed"), 'Speed' ],
)),
- # gtkpack(Gtk2::VBox->new(0,0), # no relative kppp option found :-(
- # Gtk2::Label->new(N("Dialing mode")),
+ # gtkpack(Gtk3::VBox->new(0,0), # no relative kppp option found :-(
+ # Gtk3::Label->new(N("Dialing mode")),
# gtkradio('', N("Tone dialing"), N("Pulse dialing")),
# ),
),
- Gtk2::VSeparator->new,
- gtkpack__(Gtk2::VBox->new(0,10),
- gtkpack__(Gtk2::HBox->new(0,5),
- Gtk2::Label->new(N("Modem timeout")),
- $gui->{intf}{Timeout} = gtksignal_connect(Gtk2::SpinButton->new(Gtk2::Adjustment->new($intf->{Timeout}, 0, 120, 1, 5, 0), 0, 0),
+ Gtk3::VSeparator->new,
+ gtkpack__(Gtk3::VBox->new(0,10),
+ gtkpack__(Gtk3::HBox->new(0,5),
+ Gtk3::Label->new(N("Modem timeout")),
+ $gui->{intf}{Timeout} = gtksignal_connect(Gtk3::SpinButton->new(Gtk3::Adjustment->new($intf->{Timeout}, 0, 120, 1, 5, 0), 0, 0),
value_changed => $apply),
),
- gtksignal_connect($gui->{intf_bool}{UseLockFile} = Gtk2::CheckButton->new(N("Use lock file")),
+ gtksignal_connect($gui->{intf_bool}{UseLockFile} = Gtk3::CheckButton->new(N("Use lock file")),
toggled => $apply),
- gtkpack__(Gtk2::HBox->new, gtksignal_connect($gui->{intf_bool}{WaitForDialTone} = Gtk2::CheckButton->new(N("Wait for dialup tone before dialing")),
+ gtkpack__(Gtk3::HBox->new, gtksignal_connect($gui->{intf_bool}{WaitForDialTone} = Gtk3::CheckButton->new(N("Wait for dialup tone before dialing")),
toggled => $apply)),
- gtkpack__(Gtk2::HBox->new(0,5),
- Gtk2::Label->new(N("Busy wait")),
- $gui->{intf}{BusyWait} = gtksignal_connect(Gtk2::SpinButton->new(Gtk2::Adjustment->new($intf->{BusyWait}, 0, 120, 1, 5, 0), 0, 0),
+ gtkpack__(Gtk3::HBox->new(0,5),
+ Gtk3::Label->new(N("Busy wait")),
+ $gui->{intf}{BusyWait} = gtksignal_connect(Gtk3::SpinButton->new(Gtk3::Adjustment->new($intf->{BusyWait}, 0, 120, 1, 5, 0), 0, 0),
value_changed => $apply),
),
- gtkpack__(Gtk2::HBox->new(0,5),
- Gtk2::Label->new(N("Modem sound")),
- gtkpack__(Gtk2::VBox->new(0,5), my @volume_radio = gtkradio('', N("Enable"), N("Disable"))),
+ gtkpack__(Gtk3::HBox->new(0,5),
+ Gtk3::Label->new(N("Modem sound")),
+ gtkpack__(Gtk3::VBox->new(0,5), my @volume_radio = gtkradio('', N("Enable"), N("Disable"))),
),
),
),
if_($interface eq 'isdn',
- gtkpack_(Gtk2::VBox->new(0,0),
- map { (0, gtkpack(Gtk2::VBox->new(1,0),
- gtkpack__(Gtk2::HBox->new, Gtk2::Label->new($_->[0])),
- gtkpack__(Gtk2::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk2::Entry->new,
+ gtkpack_(Gtk3::VBox->new(0,0),
+ map { (0, gtkpack(Gtk3::VBox->new(1,0),
+ gtkpack__(Gtk3::HBox->new, Gtk3::Label->new($_->[0])),
+ gtkpack__(Gtk3::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk3::Entry->new,
key_press_event => $apply)),
),
);
@@ -389,9 +389,9 @@ sub build_notebook {
[ N("Card IO_0"), 'io0' ],
),
),
- Gtk2::VSeparator->new,
- gtkpack__(Gtk2::VBox->new(0,0),
- Gtk2::Label->new(N("Protocol")),
+ Gtk3::VSeparator->new,
+ gtkpack__(Gtk3::VBox->new(0,0),
+ Gtk3::Label->new(N("Protocol")),
my @protocol_radio = gtkradio('', N("European protocol (EDSS1)"),
N("Protocol for the rest of the world\nNo D-Channel (leased lines)")),
),
@@ -416,8 +416,8 @@ sub build_notebook {
@cards == 1 and $info = $cards[0];
}
- gtkpack(gtkset_border_width($gui->{sheet}{Information} = Gtk2::VBox->new(0,10), 5),
- gtktext_insert(Gtk2::TextView->new,
+ gtkpack(gtkset_border_width($gui->{sheet}{Information} = Gtk3::VBox->new(0,10), 5),
+ gtktext_insert(Gtk3::TextView->new,
join('',
map { $_->[0] . ": \x{200e}" . $_->[1] . "\n" } (
[ N("Vendor"), split('\|', $info->{description}) ],
@@ -434,7 +434,7 @@ sub build_notebook {
}
foreach (keys %{$gui->{intf}}) {
- next if ref($gui->{intf}{$_}) !~ /Gtk2::(ComboBox|Entry)/;
+ next if ref($gui->{intf}{$_}) !~ /Gtk3::(ComboBox|Entry)/;
# skip unset fields:
next if !$intf->{$_};
# special case b/c of translation:
@@ -449,7 +449,7 @@ sub build_notebook {
}
}
- $gui->{notebook} = Gtk2::Notebook->new;
+ $gui->{notebook} = Gtk3::Notebook->new;
populate_notebook($gui->{notebook}, $gui);
}
@@ -457,7 +457,7 @@ sub populate_notebook {
my ($notebook, $gui) = @_;
foreach ('TCP/IP', 'DHCP', 'Account', 'Wireless', 'Modem', 'Options', 'Information') {
!$gui->{sheet}{$_} and next;
- $notebook->append_page($gui->{sheet}{$_}, Gtk2::Label->new(translate($_)));
+ $notebook->append_page($gui->{sheet}{$_}, Gtk3::Label->new(translate($_)));
}
}
@@ -466,7 +466,7 @@ sub save {
my $dialog = _create_dialog(N("Please wait"));
gtkpack($dialog->vbox,
- gtkshow(Gtk2::Label->new(N("Please Wait... Applying the configuration"))));
+ gtkshow(Gtk3::Label->new(N("Please Wait... Applying the configuration"))));
$dialog->show_all;
gtkset_mousecursor_wait();
diff --git a/lib/network/drakconnect/global.pm b/lib/network/drakconnect/global.pm
index f7e1eff..28fb651 100644
--- a/lib/network/drakconnect/global.pm
+++ b/lib/network/drakconnect/global.pm
@@ -1,8 +1,8 @@
package network::drakconnect::global;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
-use ugtk2 qw(:create :dialogs :helpers :wrappers);
-use mygtk2 qw(gtknew);
+use ugtk3 qw(:create :dialogs :helpers :wrappers);
+use mygtk3 qw(gtknew);
use common;
use network::drakconnect;
use network::test;
@@ -25,11 +25,11 @@ sub update_network_status {
sub configure_net {
my ($in, $net, $modules_conf) = @_;
my $int_state;
- my $int_label = Gtk2::WrappedLabel->new($net->{type} eq 'lan' ? N("Gateway:") : N("Interface:"));
- my $int_name = Gtk2::Label->new($net->{type} eq 'lan' ? $net->{network}{GATEWAY} : $net->{net_interface});
+ my $int_label = Gtk3::WrappedLabel->new($net->{type} eq 'lan' ? N("Gateway:") : N("Interface:"));
+ my $int_name = Gtk3::Label->new($net->{type} eq 'lan' ? $net->{network}{GATEWAY} : $net->{net_interface});
- my $dialog = ugtk2->new(N("Internet connection configuration"));
- my $exit_dialogsub = sub { Gtk2->main_quit };
+ my $dialog = ugtk3->new(N("Internet connection configuration"));
+ my $exit_dialogsub = sub { Gtk3->main_quit };
if (!$net->{type}) {
$in->ask_warn(
N("Warning"),
@@ -44,7 +44,7 @@ Run the \"%s\" assistant from the Mageia Control Center", N("Set up a new networ
}
$dialog->{rwindow}->signal_connect(delete_event => $exit_dialogsub);
- my $param_vbox = Gtk2::VBox->new(0,0);
+ my $param_vbox = Gtk3::VBox->new(0,0);
my $i = 0;
my @conf_data = (
@@ -59,35 +59,35 @@ Run the \"%s\" assistant from the Mageia Control Center", N("Set up a new networ
map {
my $c;
if (defined $_->[2]) {
- $c = Gtk2::Combo->new;
+ $c = Gtk3::Combo->new;
$c->set_popdown_strings(@{$_->[2]});
$infos[2*$i+1] = $c->entry;
} else {
- $c = $infos[2*$i+1] = Gtk2::Entry->new;
+ $c = $infos[2*$i+1] = Gtk3::Entry->new;
}
$infos[2*$i+1]->set_text(${$_->[1]});
$i++;
- [ Gtk2::WrappedLabel->new($_->[0]), $c ];
+ [ Gtk3::WrappedLabel->new($_->[0]), $c ];
} @conf_data
)
);
- $dialog->{rwindow}->add(gtkpack_(Gtk2::VBox->new,
- 0, Gtk2::Label->new(N("Internet Connection Configuration")),
+ $dialog->{rwindow}->add(gtkpack_(Gtk3::VBox->new,
+ 0, Gtk3::Label->new(N("Internet Connection Configuration")),
1, gtkadd(gtkcreate_frame(N("Internet access")),
gtkset_border_width(create_packtable({ col_spacings => 5, row_spacings => 5, homogenous => 1 },
- [ Gtk2::WrappedLabel->new(N("Connection type: ")),
- Gtk2::WrappedLabel->new(translate($net->{type})) ],
+ [ Gtk3::WrappedLabel->new(N("Connection type: ")),
+ Gtk3::WrappedLabel->new(translate($net->{type})) ],
[ $int_label, $int_name ],
- [ Gtk2::WrappedLabel->new(N("Status:")),
- $int_state = Gtk2::WrappedLabel->new(N("Testing your connection...")) ]
+ [ Gtk3::WrappedLabel->new(N("Status:")),
+ $int_state = Gtk3::WrappedLabel->new(N("Testing your connection...")) ]
),
5),
),
1, gtkadd(gtkcreate_frame(N("Parameters")), gtkset_border_width($param_vbox, 5)),
0, gtkpack(create_hbox('edge'),
- gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => $exit_dialogsub),
- gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub {
+ gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => $exit_dialogsub),
+ gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => sub {
foreach my $i (0..$#conf_data) {
${$conf_data[$i][1]} = $infos[2*$i+1]->get_text;
}
diff --git a/lib/network/drakroam.pm b/lib/network/drakroam.pm
index 236a326..52b3e64 100755
--- a/lib/network/drakroam.pm
+++ b/lib/network/drakroam.pm
@@ -10,8 +10,8 @@ use strict;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
use common;
use interactive;
-use mygtk2;
-use ugtk2 qw(:create :helpers :wrappers);
+use mygtk3;
+use ugtk3 qw(:create :helpers :wrappers);
use network::connection;
use network::connection_manager::gtk;
use network::connection::wireless;
@@ -57,20 +57,20 @@ sub update_on_connection_change {
sub create_drakroam_gui {
my ($droam, $_dbus, $title, $icon) = @_;
- $droam->{gui}{model} = Gtk2::ListStore->new('Gtk2::Gdk::Pixbuf', 'Glib::String');
- $droam->{gui}{connections_combo} = Gtk2::ComboBox->new($droam->{gui}{model});
- my $pix_r = Gtk2::CellRendererPixbuf->new;
+ $droam->{gui}{model} = Gtk3::ListStore->new('Gtk3::Gdk::Pixbuf', 'Glib::String');
+ $droam->{gui}{connections_combo} = Gtk3::ComboBox->new($droam->{gui}{model});
+ my $pix_r = Gtk3::CellRendererPixbuf->new;
$droam->{gui}{connections_combo}->pack_start($pix_r, 0,);
$droam->{gui}{connections_combo}->add_attribute($pix_r, pixbuf => 0);
- my $text_r = Gtk2::CellRendererText->new;
+ my $text_r = Gtk3::CellRendererText->new;
$droam->{gui}{connections_combo}->pack_start($text_r, 1);
$droam->{gui}{connections_combo}->add_attribute($text_r, text => 1);
$droam->{gui}{pixbuf_size} = 32;
- $droam->{gui}{empty_pixbuf} = Gtk2::Gdk::Pixbuf->new('rgb', 1, 8, $droam->{gui}{pixbuf_size}, $droam->{gui}{pixbuf_size});
+ $droam->{gui}{empty_pixbuf} = Gtk3::Gdk::Pixbuf->new('rgb', 1, 8, $droam->{gui}{pixbuf_size}, $droam->{gui}{pixbuf_size});
$droam->{gui}{empty_pixbuf}->fill(0);
- my $status_bar = Gtk2::Statusbar->new;
+ my $status_bar = Gtk3::Statusbar->new;
my $status_bar_cid = $status_bar->get_context_id("Network event");
$droam->{on_network_event} = sub {
my ($message) = @_;
@@ -82,7 +82,7 @@ sub create_drakroam_gui {
my $scrolled_height = $rootwin_height > 480 ? 300 : 225;
gtkadd($droam->{gui}{w}{window},
gtknew('VBox', spacing => 5, children => [
- $::isEmbedded ? () : (0, Gtk2::Banner->new($icon, $title)),
+ $::isEmbedded ? () : (0, Gtk3::Banner->new($icon, $title)),
0, gtknew('HBox', children_tight => [ gtknew('Label_Left', text => N("Device: "), alignment => [ 0.5, 0.5 ]),
gtksignal_connect($droam->{gui}{connections_combo}, changed => sub { select_connection($droam) }) ]),
1, gtknew('ScrolledWindow', width => 500, height => $scrolled_height, child => $droam->{gui}{networks_list}),
@@ -91,7 +91,7 @@ sub create_drakroam_gui {
$droam->{gui}{buttons}{connect_start} = gtknew('Button', text => N("Connect"), relief => 'half', clicked => sub { $droam->start_connection }),
$droam->{gui}{buttons}{connect_stop} = gtknew('Button', text => N("Disconnect"), relief => 'half', clicked => sub { $droam->stop_connection }),
$droam->{gui}{buttons}{refresh} = gtknew('Button', text => N("Refresh"), clicked => sub { $droam->update_networks }),
- gtknew('Button', text => N("Quit"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Quit"), clicked => sub { Gtk3->main_quit })
]),
0, $status_bar,
]),
@@ -104,8 +104,8 @@ sub main {
my $title = N("Wireless connection");
my $icon = '/usr/share/mcc/themes/default/drakroam-mdk.png';
- $ugtk2::wm_icon = $icon;
- my $w = ugtk2->new($title);
+ $ugtk3::wm_icon = $icon;
+ my $w = ugtk3->new($title);
#- so that transient_for is defined, for wait messages and popups to be centered
$::main_window = $w->{real_window};
diff --git a/lib/network/net_applet/ifw.pm b/lib/network/net_applet/ifw.pm
index 217ca2a..4ba5743 100644
--- a/lib/network/net_applet/ifw.pm
+++ b/lib/network/net_applet/ifw.pm
@@ -3,8 +3,8 @@ package network::net_applet::ifw;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
use common;
use network::ifw;
-use ugtk2 qw(:create :helpers :wrappers :dialogs);
-use mygtk2 qw(gtknew gtkset);
+use ugtk3 qw(:create :helpers :wrappers :dialogs);
+use mygtk3 qw(gtknew gtkset);
sub init() {
network::ifw::init($network::net_applet::dbus, sub {
@@ -111,7 +111,7 @@ sub handle_ifw_message {
sub ask_attack_verdict {
my ($attack) = @_;
- my $w = ugtk2->new(N("Interactive Firewall: intrusion detected"),
+ my $w = ugtk3->new(N("Interactive Firewall: intrusion detected"),
icon => "drakfirewall");
my ($blacklist, $whitelist, $ignore, $auto);
@@ -124,14 +124,14 @@ sub ask_attack_verdict {
gtkadd($w->{window},
gtknew('VBox', spacing => 5, children_loose => [
gtknew('HBox', children => [
- 0, Gtk2::Image->new_from_stock('gtk-dialog-warning', 'dialog'),
+ 0, Gtk3::Image->new_from_stock('gtk-dialog-warning', 'dialog'),
0, gtknew('Label', text => " "),
1, gtknew('VBox', children => [
0, $attack->{msg},
0, N("What do you want to do with this attacker?")
])
]),
- gtksignal_connect(gtkadd(Gtk2::Expander->new(N("Attack details")),
+ gtksignal_connect(gtkadd(Gtk3::Expander->new(N("Attack details")),
gtknew('HBox', children => [
0, gtknew('Label', text => " "),
1, gtknew('VBox', children_loose => [
@@ -202,14 +202,14 @@ sub handle_ifw_listen {
sub ask_listen_verdict {
my ($listen) = @_;
- my $w = ugtk2->new(N("Interactive Firewall: new service"), icon => "drakfirewall");
+ my $w = ugtk3->new(N("Interactive Firewall: new service"), icon => "drakfirewall");
my $set_verdict = sub {
$network::net_applet::notification_queue->process_next;
};
gtkadd($w->{window},
gtknew('VBox', spacing => 5, children_loose => [
gtknew('HBox', children => [
- 0, Gtk2::Image->new_from_stock('gtk-dialog-warning', 'dialog'),
+ 0, Gtk3::Image->new_from_stock('gtk-dialog-warning', 'dialog'),
1, gtknew('VBox', children => [
0, $listen->{message},
0, N("Do you want to open this service?"),
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm
index 603295d..6a8b6d4 100755
--- a/lib/network/netcenter.pm
+++ b/lib/network/netcenter.pm
@@ -7,8 +7,8 @@ package network::netcenter;
use strict;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
use common;
-use mygtk2;
-use ugtk2 qw(:create :helpers :wrappers);
+use mygtk3;
+use ugtk3 qw(:create :helpers :wrappers);
use network::connection;
use network::connection_manager::gtk;
use network::tools;
@@ -97,14 +97,14 @@ sub build_cmanager_box {
$on_expand->(!$was_expanded);
};
$expander->signal_connect(activate => $toggle_expand);
- my $eventbox = gtksignal_connect(Gtk2::EventBox->new, button_press_event => sub {
+ my $eventbox = gtksignal_connect(Gtk3::EventBox->new, button_press_event => sub {
$_[1]->button == 1 or return;
$toggle_expand->();
my $was_expanded = $expander->get_expanded;
$expander->set_expanded(!$was_expanded);
});
my $box = gtknew('VBox', spacing => 5, children_tight => [
- (!$is_first ? Gtk2::HSeparator->new : ()),
+ (!$is_first ? Gtk3::HSeparator->new : ()),
gtknew('HBox', children => [
0, $expander,
1, gtkadd($eventbox, $head),
@@ -153,8 +153,8 @@ sub main {
my $title = N("Network Center");
my $icon = '/usr/share/mcc/themes/default/drakroam-mdk.png';
- $ugtk2::wm_icon = $icon;
- my $w = ugtk2->new($title);
+ $ugtk3::wm_icon = $icon;
+ my $w = ugtk3->new($title);
#- so that transient_for is defined, for wait messages and popups to be centered
$::main_window = $w->{real_window};
@@ -167,7 +167,7 @@ sub main {
my $managers_box;
gtkadd($w->{window},
gtknew('VBox', spacing => 5, children => [
- $::isEmbedded ? () : (0, Gtk2::Banner->new($icon, $title)),
+ $::isEmbedded ? () : (0, Gtk3::Banner->new($icon, $title)),
if_($net->{PROFILE} && network::network::netprofile_count() > 0, 0, gtknew('Label', text_markup => N("You are currently using the network profile <b>%s</b>", $net->{PROFILE}))),
1, gtknew('ScrolledWindow', width => 600, height => $scrolled_height, shadow_type => 'none',
child => $managers_box = gtknew('VBox', spacing => 5, children_tight => [
@@ -175,7 +175,7 @@ sub main {
])),
0, gtknew('HButtonBox', spacing => 6, layout => 'end', children_loose => [
gtknew('Button', text => N("Advanced settings"), clicked => sub { advanced_settings($in, $net) }),
- gtknew('Button', text => N("Quit"), clicked => sub { Gtk2->main_quit }),
+ gtknew('Button', text => N("Quit"), clicked => sub { Gtk3->main_quit }),
]),
]),
);
diff --git a/lib/network/signal_strength.pm b/lib/network/signal_strength.pm
index 0e69108..8a3a5be 100644
--- a/lib/network/signal_strength.pm
+++ b/lib/network/signal_strength.pm
@@ -2,14 +2,14 @@ package network::signal_strength;
use lib qw(/usr/lib/libDrakX); # helps perl_checker
use common;
-use ugtk2;
+use ugtk3;
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));
+ return $pixbufs{$approx} ||= ugtk3::gtkcreate_pixbuf('wifi-' . sprintf('%03d', $approx));
}
1;