diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-07 16:57:13 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-24 11:00:40 +0100 |
commit | 4a4453328a1a2051307f44e6c1c200625666ba16 (patch) | |
tree | 9fb9eb5089abd561cf1c857e448e3c63fcc4465e | |
parent | 7bf101337af175668274aaae14b6320a5224f480 (diff) | |
download | drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.gz drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.bz2 drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.xz drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.zip |
switch from gtk2 to gtk3
-rwxr-xr-x | bin/drakconnect | 2 | ||||
-rwxr-xr-x | bin/drakconnect-old | 88 | ||||
-rwxr-xr-x | bin/drakfirewall | 2 | ||||
-rwxr-xr-x | bin/drakhosts | 44 | ||||
-rwxr-xr-x | bin/drakids | 38 | ||||
-rwxr-xr-x | bin/drakinvictus | 10 | ||||
-rwxr-xr-x | bin/draknetprofile | 42 | ||||
-rwxr-xr-x | bin/draknfs | 58 | ||||
-rwxr-xr-x | bin/drakproxy | 2 | ||||
-rwxr-xr-x | bin/draksambashare | 218 | ||||
-rwxr-xr-x | bin/net_applet | 46 | ||||
-rwxr-xr-x | bin/net_monitor | 30 | ||||
-rw-r--r-- | lib/network/connection_manager/gtk.pm | 14 | ||||
-rw-r--r-- | lib/network/drakconnect/edit.pm | 196 | ||||
-rw-r--r-- | lib/network/drakconnect/global.pm | 36 | ||||
-rwxr-xr-x | lib/network/drakroam.pm | 24 | ||||
-rw-r--r-- | lib/network/net_applet/ifw.pm | 14 | ||||
-rwxr-xr-x | lib/network/netcenter.pm | 16 | ||||
-rw-r--r-- | lib/network/signal_strength.pm | 4 | ||||
-rwxr-xr-x | old/drakvpn-old | 2 |
20 files changed, 443 insertions, 443 deletions
diff --git a/bin/drakconnect b/bin/drakconnect index 4f58840..72d24aa 100755 --- a/bin/drakconnect +++ b/bin/drakconnect @@ -33,7 +33,7 @@ use modules; require_root_capability(); -$ugtk2::wm_icon = "drakconnect"; +$ugtk3::wm_icon = "drakconnect"; my $in = 'interactive'->vnew; my $net = {}; diff --git a/bin/drakconnect-old b/bin/drakconnect-old index e53ffe8..10d5a0b 100755 --- a/bin/drakconnect-old +++ b/bin/drakconnect-old @@ -28,14 +28,14 @@ BEGIN { unshift @::textdomains, 'drakx-net' } use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; use interactive; -use ugtk2 qw(:create :dialogs :helpers :wrappers); -use mygtk2 qw(gtknew); +use ugtk3 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew); use network::netconnect; use network::connection::ethernet; require_root_capability(); -$ugtk2::wm_icon = "drakconnect"; +$ugtk3::wm_icon = "drakconnect"; my $in = 'interactive'->vnew; my $net = {}; @@ -44,8 +44,8 @@ my $modules_conf = modules::any_conf->read; my @all_cards; -my $window1 = ugtk2->new(N("Network configuration (%d adapters)", scalar @all_cards)); -$window1->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); +my $window1 = ugtk3->new(N("Network configuration (%d adapters)", scalar @all_cards)); +$window1->{rwindow}->signal_connect(delete_event => sub { ugtk3->exit(0) }); unless ($::isEmbedded) { $window1->{rwindow}->set_position('center'); $window1->{rwindow}->set_size_request(-1, -1); @@ -57,11 +57,11 @@ my $button_apply; my $hostname = chomp_(`hostname`); -my $tree_model = Gtk2::TreeStore->new("Gtk2::Gdk::Pixbuf", map { "Glib::String" } 2..6); -my $list = Gtk2::TreeView->new_with_model($tree_model); -$list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererPixbuf->new, 'pixbuf' => 0)); +my $tree_model = Gtk3::TreeStore->new("Gtk3::Gdk::Pixbuf", map { "Glib::String" } 2..6); +my $list = Gtk3::TreeView->new_with_model($tree_model); +$list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererPixbuf->new, 'pixbuf' => 0)); each_index { - $list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i + 1)); + $list->append_column(my $col = Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i + 1)); $col->set_sort_column_id($::i); } (N("Interface"), N("IP address"), N("Protocol"), N("Driver"), N("State")); @@ -76,11 +76,11 @@ update_list($modules_conf); my $label_host; $window1->{window}->add( - gtkpack__(Gtk2::VBox->new(0,10), - gtkpack(Gtk2::HBox->new, - Gtk2::Label->new(N("Hostname: ")), - $label_host = Gtk2::Label->new($hostname), - gtksignal_connect(Gtk2::Button->new(N("Configure hostname...")), + gtkpack__(Gtk3::VBox->new(0,10), + gtkpack(Gtk3::HBox->new, + Gtk3::Label->new(N("Hostname: ")), + $label_host = Gtk3::Label->new($hostname), + gtksignal_connect(Gtk3::Button->new(N("Configure hostname...")), clicked => sub { local ($::isWizard, $::Wizard_finished) = (1, 1); eval { # For wizcancel @@ -95,26 +95,26 @@ $window1->{window}->add( ), ), gtkadd(gtkcreate_frame(N("LAN configuration")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new(0,0), 5), + gtkpack_(gtkset_border_width(Gtk3::VBox->new(0,0), 5), 0, $list, - 0, Gtk2::HBox->new(0,0), - 0, gtkpack_(Gtk2::HBox->new(0, 0), - 0, gtksignal_connect(Gtk2::Button->new(N("Configure Local Area Network...")), + 0, Gtk3::HBox->new(0,0), + 0, gtkpack_(Gtk3::HBox->new(0, 0), + 0, gtksignal_connect(Gtk3::Button->new(N("Configure Local Area Network...")), clicked => \&configure_lan), ), ) ), - gtkpack(Gtk2::HButtonBox->new, - gtksignal_connect(Gtk2::Button->new(N("Help")), clicked => sub { + gtkpack(Gtk3::HButtonBox->new, + gtksignal_connect(Gtk3::Button->new(N("Help")), clicked => sub { run_program::raw({ detach => 1 }, 'drakhelp', '--id', 'internet-connection') }), - $button_apply = gtksignal_connect(gtkset_sensitive(Gtk2::Button->new(N("Apply")), 0), + $button_apply = gtksignal_connect(gtkset_sensitive(Gtk3::Button->new(N("Apply")), 0), clicked => \&apply), - gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&quit_global), - gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub { + gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => \&quit_global), + gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => sub { if ($button_apply->get('sensitive')) { my $dialog = _create_dialog(N("Please wait")); gtkpack($dialog->vbox, - Gtk2::Label->new(N("Please Wait... Applying the configuration"))); + Gtk3::Label->new(N("Please Wait... Applying the configuration"))); $dialog->show_all; gtkflush(); apply(); @@ -132,10 +132,10 @@ $window1->{window}->add( $window1->{rwindow}->show_all; gtkflush(); $window1->main; -ugtk2->exit(0); +ugtk3->exit(0); sub quit_global() { - ugtk2->exit(0); + ugtk3->exit(0); } sub get_intf_status { @@ -174,11 +174,11 @@ sub configure_lan() { my @card_tab; if (@all_cards < 1) { - $window->vbox->add(Gtk2::Label->new(N("You do not have any configured interface. + $window->vbox->add(Gtk3::Label->new(N("You do not have any configured interface. Configure them first by clicking on 'Configure'"))); gtkpack(gtkset_layout($window->action_area, 'end'), - gtksignal_connect(Gtk2::Button->new(N("Ok")), - clicked => sub { Gtk2->main_quit }) + gtksignal_connect(Gtk3::Button->new(N("Ok")), + clicked => sub { Gtk3->main_quit }) ); $window->show_all; $window->run; @@ -188,8 +188,8 @@ Configure them first by clicking on 'Configure'"))); $window->set_border_width(10); gtkpack($window->vbox, - Gtk2::Label->new(N("LAN Configuration")), - my $notebook = Gtk2::Notebook->new, + Gtk3::Label->new(N("LAN Configuration")), + my $notebook = Gtk3::Notebook->new, ); foreach (0..$#all_cards) { @@ -198,9 +198,9 @@ Configure them first by clicking on 'Configure'"))); $card_tab[2*$_] = \@infos; $card_tab[2*$_+1] = \@conf_data; - my $vbox_local = Gtk2::VBox->new(0,0); + my $vbox_local = Gtk3::VBox->new(0,0); $vbox_local->set_border_width(10); - $vbox_local->pack_start(Gtk2::Label->new(N("Adapter %s: %s", $_+1 , $all_cards[$_][0])),1,1,0); + $vbox_local->pack_start(Gtk3::Label->new(N("Adapter %s: %s", $_+1 , $all_cards[$_][0])),1,1,0); # Eth${_}Hostname = $netc->{HOSTNAME} # Eth${_}HostAlias = " . do { $netc->{HOSTNAME} =~ /([^\.]*)\./; $1 } . " # Eth${_}Driver = $all_cards[$_]->[1] @@ -214,22 +214,22 @@ Configure them first by clicking on 'Configure'"))); [ N("DHCP client"), \$net->{ifcfg}{$interface}{DHCP_CLIENT} ] ); my $i = 0; - my $size_group = Gtk2::SizeGroup->new('horizontal'); + my $size_group = Gtk3::SizeGroup->new('horizontal'); foreach my $j (@conf_data) { - my $l = Gtk2::Label->new($j->[0]); + my $l = Gtk3::Label->new($j->[0]); $l->set_justify('left'); - $infos[2*$i] = gtkpack_(Gtk2::HBox->new, + $infos[2*$i] = gtkpack_(Gtk3::HBox->new, 1, $l); $vbox_local->pack_start($infos[2*$i], 1, 1, 0); my $c; if (defined $j->[2]) { - $c = Gtk2::ComboBox->new_text; + $c = Gtk3::ComboBox->new_text; $c->set_popdown_strings(@{$j->[2]}); $infos[2*$i+1] = $c->entry; $infos[2*$i]->pack_start($c,0,0,0); } else { - $infos[2*$i+1] = ($c = Gtk2::Entry->new); + $infos[2*$i+1] = ($c = Gtk3::Entry->new); $infos[2*$i]->pack_start($infos[2*$i+1],0,0,0); } $size_group->add_widget($c); @@ -239,7 +239,7 @@ Configure them first by clicking on 'Configure'"))); my $widget_temp; if (-e "/etc/sysconfig/network-scripts/ifcfg-$interface") { - $widget_temp = gtksignal_connect(Gtk2::Button->new(get_intf_status($interface)), + $widget_temp = gtksignal_connect(Gtk3::Button->new(get_intf_status($interface)), clicked => sub { system("/sbin/if" . (ethisup($interface) ? "down" : "up") . " $interface"); $_[0]->set_label(get_intf_status($interface)); @@ -248,23 +248,23 @@ Configure them first by clicking on 'Configure'"))); } else { $widget_temp = N("This interface has not been configured yet.\nRun the \"%s\" assistant from the Mageia Linux Control Center", N("Set up a new network interface (LAN, ISDN, ADSL, ...)")); } - $vbox_local->pack_start(gtkpack__(Gtk2::HBox->new(0,0), + $vbox_local->pack_start(gtkpack__(Gtk3::HBox->new(0,0), $widget_temp ),0,0,0); # $list->append($_+1, $interface, $intf->{$interface}{IPADDR}, $intf->{$interface}{BOOTPROTO}, $all_cards[$_]->[1]); # $list->set_selectable($_, 0); - $notebook->append_page($vbox_local, Gtk2::Label->new($interface)); + $notebook->append_page($vbox_local, Gtk3::Label->new($interface)); } my $exit_dialogsub = sub { $window->destroy; - Gtk2->main_quit; + Gtk3->main_quit; }; gtkpack($window->action_area, - gtksignal_connect(Gtk2::Button->new(N("Cancel")), + gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => $exit_dialogsub), - gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub { + gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => sub { foreach (0..$#all_cards) { my @infos = @{$card_tab[2*$_]}; each_index { ${$_->[1]} = $infos[2*$::i+1]->get_text } @{$card_tab[2*$_+1]}; diff --git a/bin/drakfirewall b/bin/drakfirewall index 9679cf9..358b9f6 100755 --- a/bin/drakfirewall +++ b/bin/drakfirewall @@ -24,7 +24,7 @@ use standalone; #- warning, standalone must be loaded very first, for 'expla use interactive; use network::drakfirewall; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/firewall-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/firewall-mdk.png"; common::require_root_capability(); diff --git a/bin/drakhosts b/bin/drakhosts index 627533b..1b53b68 100755 --- a/bin/drakhosts +++ b/bin/drakhosts @@ -26,9 +26,9 @@ use strict; use common; use network::network; -$ugtk2::wm_icon = 'IC-Dhost-48'; -use mygtk2 qw(gtknew); -use ugtk2 qw(:ask :wrappers :create :dialogs); +$ugtk3::wm_icon = 'IC-Dhost-48'; +use mygtk3 qw(gtknew); +use ugtk3 qw(:ask :wrappers :create :dialogs); use constant FALSE => 0; @@ -43,10 +43,10 @@ use constant NUM_COLUMNS => 3; require_root_capability(); -my %size_groups = map { $_ => Gtk2::SizeGroup->new('horizontal') } qw(label widget); +my %size_groups = map { $_ => Gtk3::SizeGroup->new('horizontal') } qw(label widget); my $label_and_widgets = sub { my ($label, $widget) = @_; - gtkpack_(Gtk2::HBox->new(0,5), + gtkpack_(Gtk3::HBox->new(0,5), 0, gtkadd_widget($size_groups{label}, gtknew('Label_Left', text => $label)), 1, gtkadd_widget($size_groups{widget}, $widget), ); @@ -82,7 +82,7 @@ sub add_modify_entry { undef $i; undef $iter; - $_ = Gtk2::Entry->new foreach $ip, $hostname, $alias; + $_ = Gtk3::Entry->new foreach $ip, $hostname, $alias; # test if modify or add a host @@ -160,7 +160,7 @@ sub remove_entry { sub create_model() { get_host_data(); - my $model = Gtk2::ListStore->new("Glib::String", "Glib::String", "Glib::String"); + my $model = Gtk3::ListStore->new("Glib::String", "Glib::String", "Glib::String"); foreach my $a (@listhosts) { my $iter = $model->append; $model->set($iter, @@ -176,7 +176,7 @@ sub create_model() { sub add_columns { my $treeview = shift; each_index { - my $renderer = Gtk2::CellRendererText->new; + my $renderer = Gtk3::CellRendererText->new; $renderer->set(editable => 0); $renderer->set_data(column => $::i); $treeview->insert_column_with_attributes(-1, $_, $renderer, 'text' => $::i); @@ -190,13 +190,13 @@ sub add_columns { # create model my $model = create_model(); -my $window = ugtk2->new(N("Manage hosts definitions")); +my $window = ugtk3->new(N("Manage hosts definitions")); $::main_window = $window->{real_window}; $window->{rwindow}->set_size_request(500, 400) unless $::isEmbedded; my $W = $window->{window}; -$W->signal_connect(delete_event => sub { ugtk2->exit }); +$W->signal_connect(delete_event => sub { ugtk3->exit }); -my $treeview = Gtk2::TreeView->new_with_model($model); +my $treeview = Gtk3::TreeView->new_with_model($model); $treeview->set_rules_hint(1); $treeview->get_selection->set_mode('single'); add_columns($treeview); @@ -211,42 +211,42 @@ $treeview->signal_connect(button_press_event => sub { }); my $okcancel = create_okcancel({ - cancel_clicked => sub { ugtk2->exit }, - ok_clicked => sub { write_conf_hosts(); ugtk2->exit }, + cancel_clicked => sub { ugtk3->exit }, + ok_clicked => sub { write_conf_hosts(); ugtk3->exit }, }, ); # main interface -$W->add(gtkpack_(Gtk2::VBox->new(0,0), - if_(!$::isEmbedded, 0, Gtk2::Banner->new('IC-Dhost-48', N("Manage hosts definitions"))), - #if_($::isEmbedded, 0, Gtk2::Label->new("Here you can add, remove and alter hosts definition.")), - 1, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), +$W->add(gtkpack_(Gtk3::VBox->new(0,0), + if_(!$::isEmbedded, 0, Gtk3::Banner->new('IC-Dhost-48', N("Manage hosts definitions"))), + #if_($::isEmbedded, 0, Gtk3::Label->new("Here you can add, remove and alter hosts definition.")), + 1, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 0), 1, create_scrolled_window($treeview), 0, gtkpack_(gtkset_border_width(create_vbox('start', 3)), - 0, gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Add")), clicked => sub { eval { add_modify_entry($treeview, 'add', N("Add entry")) }; my $err = $@; if ($err) { err_dialog(N("Error"), N("Failed to add host.") . "\n\n" . $err); } }), - 0, gtksignal_connect(Gtk2::Button->new(N("Modify")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Modify")), clicked => sub { eval { add_modify_entry($treeview, 'modify', N("Modify entry")) }; my $err = $@; if ($err) { err_dialog(N("Error"), N("Failed to Modify host.") . "\n\n" . $err); } }), - 0, gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => sub { eval { remove_entry($treeview) }; my $err = $@; if ($err) { err_dialog(N("Error"), N("Failed to remove host.") . "\n\n" . $err); } }), - if_($::isEmbedded, 0, gtksignal_connect(Gtk2::Button->new(N("Quit")), clicked => sub { ugtk2->exit })), + if_($::isEmbedded, 0, gtksignal_connect(Gtk3::Button->new(N("Quit")), clicked => sub { ugtk3->exit })), ), ), 0, $okcancel, @@ -254,4 +254,4 @@ $W->add(gtkpack_(Gtk2::VBox->new(0,0), ); $W->show_all; -Gtk2->main; +Gtk3->main; diff --git a/bin/drakids b/bin/drakids index 50cc786..a51f047 100755 --- a/bin/drakids +++ b/bin/drakids @@ -8,15 +8,15 @@ use common; use standalone; use Socket; -use mygtk2 qw(gtknew); -use ugtk2 qw(:dialogs); +use mygtk3 qw(gtknew); +use ugtk3 qw(:dialogs); use POSIX qw(strftime); use dbus_object; use network::ifw; -use Gtk2::SimpleList; +use Gtk3::SimpleList; -use ugtk2 qw(:create :helpers :wrappers); +use ugtk3 qw(:create :helpers :wrappers); my $loglist = create_attack_list(); $loglist->get_selection->set_mode('single'); @@ -24,7 +24,7 @@ $loglist->get_selection->set_mode('single'); my $blacklist = create_attack_list(); $blacklist->get_selection->set_mode('multiple'); -my $whitelist = Gtk2::SimpleList->new(addr => 'hidden', +my $whitelist = Gtk3::SimpleList->new(addr => 'hidden', N("Allowed addresses") => 'text', ); $whitelist->get_selection->set_mode('multiple'); @@ -40,13 +40,13 @@ my $blocked_services = create_service_list(); my $title = N("Interactive Firewall"); my $icon = "drakfirewall"; -$ugtk2::wm_icon = $icon; -my $w = ugtk2->new($title); +$ugtk3::wm_icon = $icon; +my $w = ugtk3->new($title); my $ifw; eval { my $bus = dbus_object::system_bus(); - dbus_object::set_gtk2_watch_helper($bus); + dbus_object::set_gtk3_watch_helper($bus); network::ifw::init($bus, sub { my ($_con, $msg) = @_; my $member = $msg->get_member; @@ -76,7 +76,7 @@ init_lists(); gtkadd($w->{window}, gtknew('VBox', spacing => 5, children => [ - $::isEmbedded ? () : (0, Gtk2::Banner->new($icon, $title)), + $::isEmbedded ? () : (0, Gtk3::Banner->new($icon, $title)), 1, gtknew('Notebook', children => [ if_($i_m_ifw2, gtknew('Label', text => N("Log")), @@ -85,7 +85,7 @@ gtkadd($w->{window}, 0, gtknew('HButtonBox', layout => 'edge', children_loose => [ gtknew('Button', text => N("Allow"), clicked => sub {}), gtknew('Button', text => N("Block"), clicked => sub {}), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), gtknew('Label', text => N("Allowed services")), @@ -94,7 +94,7 @@ gtkadd($w->{window}, 0, gtknew('HButtonBox', layout => 'edge', children_loose => [ gtknew('Button', text => N("Remove"), clicked => sub {}), gtknew('Button', text => N("Block"), clicked => sub {}), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), gtknew('Label', text => N("Blocked services")), @@ -103,7 +103,7 @@ gtkadd($w->{window}, 0, gtknew('HButtonBox', layout => 'edge', children_loose => [ gtknew('Button', text => N("Remove"), clicked => sub {}), gtknew('Button', text => N("Allow"), clicked => sub {}), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), ), @@ -114,7 +114,7 @@ gtkadd($w->{window}, gtknew('Button', text => N("Clear logs"), clicked => \&clear_log), gtknew('Button', text => N("Blacklist"), clicked => sub { blacklist(get_selected_log_seq()) }), gtknew('Button', text => N("Whitelist"), clicked => sub { whitelist(get_selected_log()) }), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), gtknew('Label', text => N("Blacklist")), @@ -127,7 +127,7 @@ gtkadd($w->{window}, unblacklist(@addr); whitelist(@addr); }), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), gtknew('Label', text => N("Whitelist")), @@ -135,14 +135,14 @@ gtkadd($w->{window}, 1, gtknew('ScrolledWindow', width => 600, height => 260, child => $whitelist), 0, gtknew('HButtonBox', layout => 'edge', children_loose => [ gtknew('Button', text => N("Remove from whitelist"), clicked => sub { unwhitelist(get_selected_whitelist()) }), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) ]), ]), ]), ]), ); $w->show; -Gtk2->main; +Gtk3->main; $w->exit(0); @@ -160,7 +160,7 @@ sub handle_init() { sub list_remove_addr { my ($list, @addr) = @_; - #- workaround buggy Gtk2::SimpleList array abstraction, it destroys references + #- workaround buggy Gtk3::SimpleList array abstraction, it destroys references @$list = map { member($_->[0], @addr) ? () : [ @$_ ] } @$list; } @@ -250,7 +250,7 @@ sub clear_lists() { } sub create_attack_list() { - my $attacklist = Gtk2::SimpleList->new(addr => 'hidden', + my $attacklist = Gtk3::SimpleList->new(addr => 'hidden', seq => 'hidden', timestamp => 'hidden', N("Date") => 'text', @@ -287,7 +287,7 @@ sub attack_list_add { sub create_service_list { my ($o_status) = @_; - my $service_list = Gtk2::SimpleList->new( + my $service_list = Gtk3::SimpleList->new( N("Application") => 'text', N("Service") => 'text', if_($o_status, N("Status") => 'text'), diff --git a/bin/drakinvictus b/bin/drakinvictus index c903bc6..eaf6fe1 100755 --- a/bin/drakinvictus +++ b/bin/drakinvictus @@ -29,14 +29,14 @@ use common; use network::invictus; use network::network; use detect_devices; -use mygtk2 qw(gtknew); -use ugtk2 qw(:create :helpers :wrappers :dialogs); +use mygtk3 qw(gtknew); +use ugtk3 qw(:create :helpers :wrappers :dialogs); require_root_capability(); -$ugtk2::wm_icon = 'invictus-16'; +$ugtk3::wm_icon = 'invictus-16'; my $title = N("Invictus Firewall"); -my $w = ugtk2->new($title); +my $w = ugtk3->new($title); $::main_window = $w->{real_window}; #- so that transient_for is defined for wait messages and dialogs my $net = {}; @@ -98,7 +98,7 @@ sub update_ct_sync_state() { gtkadd($w->{window}, gtknew('VBox', spacing => 5, children_tight => [ - $::isEmbedded ? () : Gtk2::Banner->new('invictus-32', $title), + $::isEmbedded ? () : Gtk3::Banner->new('invictus-32', $title), gtknew('WrappedLabel', text => N("This tool allows to set up network interfaces failover and firewall replication.")), gtknew('Frame', border_width => 5, text => N("Network redundancy (leave empty if interface is not used)"), diff --git a/bin/draknetprofile b/bin/draknetprofile index e836c06..d2e5cce 100755 --- a/bin/draknetprofile +++ b/bin/draknetprofile @@ -28,16 +28,16 @@ use standalone; use common; use network::network; -use mygtk2; -use Gtk2::SimpleList; -use ugtk2 qw(:create :helpers :wrappers :dialogs :ask); +use mygtk3; +use Gtk3::SimpleList; +use ugtk3 qw(:create :helpers :wrappers :dialogs :ask); use POSIX (); require_root_capability(); -$ugtk2::wm_icon = 'draknetprofile-16'; +$ugtk3::wm_icon = 'draknetprofile-16'; my $title = N("Network profiles"); -my $w = ugtk2->new($title); +my $w = ugtk3->new($title); $::main_window = $w->{real_window}; #- so that transient_for is defined for wait messages and dialogs my $net = {}; @@ -45,10 +45,10 @@ my @profiles; my $default_profile = "default"; my %buttons; -package Gtk2::CellRendererRadio; +package Gtk3::CellRendererRadio; sub new { - my $renderer = Gtk2::CellRendererToggle->new; + my $renderer = Gtk3::CellRendererToggle->new; $renderer->set_radio(1); $renderer; } @@ -57,14 +57,14 @@ sub new { package main; -Gtk2::SimpleList->add_column_type( +Gtk3::SimpleList->add_column_type( 'radio', type => 'Glib::Boolean', - renderer => 'Gtk2::CellRendererRadio', + renderer => 'Gtk3::CellRendererRadio', attr => 'active', ); -my $modules_list = Gtk2::SimpleList->new( +my $modules_list = Gtk3::SimpleList->new( N("Module") => 'hidden', N("Enabled") => 'bool', N("Description") => 'text', @@ -81,7 +81,7 @@ $r[0]->signal_connect('toggled' => sub { }); -my $profiles_list = Gtk2::SimpleList->new( +my $profiles_list = Gtk3::SimpleList->new( "" => 'hidden', N("Profile") => 'text', ); @@ -157,15 +157,15 @@ sub set_profile { sub clone_profile() { #my $source_profile = get_selected_profile(); my $dialog = _create_dialog(N("New profile...")); - my $entry_dialog = Gtk2::Entry->new; + my $entry_dialog = Gtk3::Entry->new; gtkpack($dialog->vbox, - Gtk2::WrappedLabel->new(N("Please specify the name of the new network profile to be created (e.g., work, home, roaming, ..). This new profile will be created based on current settings, and you'll be able to configure your system configuration as usual afterwards.")), + Gtk3::WrappedLabel->new(N("Please specify the name of the new network profile to be created (e.g., work, home, roaming, ..). This new profile will be created based on current settings, and you'll be able to configure your system configuration as usual afterwards.")), $entry_dialog, ); gtkpack($dialog->action_area, - gtksignal_connect(Gtk2::Button->new(N("Cancel")), + gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => sub { $dialog->destroy }), - gtksignal_connect(my $bok = Gtk2::Button->new(N("Ok")), clicked => sub { + gtksignal_connect(my $bok = Gtk3::Button->new(N("Ok")), clicked => sub { my $dest_profile = $entry_dialog->get_text; # netprofile does not like spaces in profile names... $dest_profile =~ s/ /_/g; @@ -198,10 +198,10 @@ sub delete_selected_profile() { } # create advanced view to configure modules -my $expander = Gtk2::Expander->new(N("Advanced")); -$expander->add(gtkpack_(Gtk2::VBox->new, - 0, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 1), - 1, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), +my $expander = Gtk3::Expander->new(N("Advanced")); +$expander->add(gtkpack_(Gtk3::VBox->new, + 0, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 1), + 1, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, gtknew('WrappedLabel', text => N("Select the netprofile modules:")), 0, gtknew('ScrolledWindow', width => 300, height => 150, child => $modules_list), ), @@ -214,7 +214,7 @@ $expander->show_all; gtkadd($w->{window}, gtknew('VBox', spacing => 5, children => [ - $::isEmbedded ? () : (0, Gtk2::Banner->new('draknetprofile', $title)), + $::isEmbedded ? () : (0, Gtk3::Banner->new('draknetprofile', $title)), 0, gtknew('WrappedLabel', text => N("This tool allows you to control network profiles.")), 0, gtknew('WrappedLabel', text => N("Select a network profile:")), 1, gtknew('ScrolledWindow', width => 300, height => 150, child => $profiles_list), @@ -223,7 +223,7 @@ gtkadd($w->{window}, $buttons{activate} = gtknew('Button', text => N("Activate"), clicked => \&set_selected_profile, sensitive => 0), $buttons{clone} = gtknew('Button', text => N("New"), clicked => \&clone_profile, sensitive => 0), $buttons{delete} = gtknew('Button', text => N("Delete"), clicked => \&delete_selected_profile, sensitive => 0), - gtknew('Button', text => N("Quit"), clicked => sub { Gtk2->main_quit }), + gtknew('Button', text => N("Quit"), clicked => sub { Gtk3->main_quit }), ]), ]), ); diff --git a/bin/draknfs b/bin/draknfs index 98aae11..2a60db1 100755 --- a/bin/draknfs +++ b/bin/draknfs @@ -31,9 +31,9 @@ use services; require_root_capability(); my $nfsicon = "/usr/share/mcc/themes/default/draknfs.png"; -$ugtk2::wm_icon = $nfsicon; -use mygtk2 qw(gtknew gtkset); -use ugtk2 qw(:ask :wrappers :create :dialogs); +$ugtk3::wm_icon = $nfsicon; +use mygtk3 qw(gtknew gtkset); +use ugtk3 qw(:ask :wrappers :create :dialogs); my $in = 'interactive'->vnew; $in->do_pkgs->ensure_is_installed('nfs-utils', '/usr/sbin/rpc.nfsd') or exit(1); @@ -79,7 +79,7 @@ sub get_items() { } sub quit_all() { - ugtk2->exit; + ugtk3->exit; } sub restart_dialog() { @@ -97,7 +97,7 @@ sub wait_action { undef $w; } -my %size_groups = map { $_ => Gtk2::SizeGroup->new('horizontal') } qw(label widget button); +my %size_groups = map { $_ => Gtk3::SizeGroup->new('horizontal') } qw(label widget button); my $label_and_widgets = sub { my ($label, $widget, $button) = @_; gtknew('HBox', children => [ @@ -196,7 +196,7 @@ sub help_b { my $dialog = _create_dialog(N("Help"), { transient_for => $::main_window, modal => 1 }); gtkpack_($dialog->vbox, 1, gtknew('ScrolledWindow', width => 390, height => 300, - child => gtknew('TextView', text => ugtk2::markup_to_TextView_format(formatAlaTeX($help_data))) + child => gtknew('TextView', text => ugtk3::markup_to_TextView_format(formatAlaTeX($help_data))) ), 0, gtknew('Button', text => N("Close"), clicked => sub { $dialog->destroy; @@ -256,9 +256,9 @@ sub add_modify_entry { undef $i; undef $iter; $_ = gtknew('Entry') foreach $dir, $options; - $_ = Gtk2::OptionMenu->new foreach $lr, $luserid, $lsecure, $lsync, $lsubtree_check; + $_ = Gtk3::OptionMenu->new foreach $lr, $luserid, $lsecure, $lsync, $lsubtree_check; - $access = Gtk2::Combo->new; + $access = Gtk3::Combo->new; # $access = gtknew('ComboBox'); my @access_list = get_access_list(); # foreach (@access_list) { @@ -357,10 +357,10 @@ sub add_modify_entry { $_->set_sensitive(0) foreach $anongid, $anonuid; } - my $expender = Gtk2::Expander->new(N("Advanced")); - $expender->add(gtkpack_(Gtk2::HBox->new, - 0, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 1), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), + my $expender = Gtk3::Expander->new(N("Advanced")); + $expender->add(gtkpack_(Gtk3::HBox->new, + 0, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 1), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, $label_and_widgets->($adv_options{sync}, $lsync, help_b($help_global)), 0, $label_and_widgets->($adv_options{secured}, $lsecure, ""), 0, $label_and_widgets->($adv_options{ro}, $lr, ""), @@ -370,7 +370,7 @@ sub add_modify_entry { ), ); - my $w = ugtk2->new(N("Modify entry")); + my $w = ugtk3->new(N("Modify entry")); $w->{window}->set_modal(1); $w->{window}->set_position('center'); @@ -378,8 +378,8 @@ sub add_modify_entry { gtkadd($w->{window}, gtknew('VBox', spacing => 0, children_loose => [ -# gtkadd(Gtk2::Frame->new(("")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), +# gtkadd(Gtk3::Frame->new(("")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, gtknew('Title2', label => N("NFS directory")), 0, $label_and_widgets->(N("Directory:"), $dir, $button), 0, gtknew('Title2', label => N("Host access")), @@ -390,8 +390,8 @@ sub add_modify_entry { 0, $label_and_widgets->(N("Anonymous Group ID:"), $anongid, ""), ), # ), -# gtkadd(Gtk2::Frame->new(""), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), +# gtkadd(Gtk3::Frame->new(""), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $expender, ), # ), @@ -484,7 +484,7 @@ sub remove_entry { sub create_model() { get_nfs_data(); - my $model = Gtk2::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String"); + my $model = Gtk3::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String"); foreach my $a (@listshare) { my $iter = $model->append; $model->set($iter, @@ -503,14 +503,14 @@ sub add_columns { my $model = $treeview->get_model; # my @colsize = (120, 160, 120); # each_index { -# my $renderer = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i); +# my $renderer = Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i); # $renderer->set_sort_column_id($::i); # $renderer->set_min_width($colsize[$::i]); # $treeview->append_column($renderer); # } N("Share Directory"), N("Hosts Wildcard"), N("General Options"), N("Custom Options"); each_index { - my $renderer = Gtk2::CellRendererText->new; + my $renderer = Gtk3::CellRendererText->new; $renderer->set(editable => 0); $renderer->signal_connect(edited => \&cell_edited, $model); $renderer->set_data(column => $::i); @@ -520,7 +520,7 @@ sub add_columns { sub cell_edited { my ($cell, $path_string, $new_text, $model) = @_; - my $path = Gtk2::TreePath->new_from_string($path_string); + my $path = Gtk3::TreePath->new_from_string($path_string); my $column = $cell->get_data("column"); my $iter = $model->get_iter($path); @@ -549,14 +549,14 @@ sub cell_edited { # create model my $model = create_model(); -my $window = ugtk2->new(N("Manage NFS shares")); +my $window = ugtk3->new(N("Manage NFS shares")); $::main_window = $window->{real_window}; $window->{rwindow}->set_size_request(550, 400) unless $::isEmbedded; $window->{rwindow}->set_position('center') if !$::isEmbedded; my $W = $window->{window}; -$W->signal_connect(delete_event => sub { ugtk2->exit }); +$W->signal_connect(delete_event => sub { ugtk3->exit }); -my $treeview = Gtk2::TreeView->new_with_model($model); +my $treeview = Gtk3::TreeView->new_with_model($model); $treeview->set_rules_hint(1); $treeview->get_selection->set_mode('single'); add_columns($treeview); @@ -573,15 +573,15 @@ $treeview->signal_connect(button_press_event => sub { # create menu my @items = get_items(); -my $factory = Gtk2::ItemFactory->new('Gtk2::MenuBar', '<main>', undef); +my $factory = Gtk3::ItemFactory->new('Gtk3::MenuBar', '<main>', undef); $factory->create_items('menu', @items); my $menu = $factory->get_widget('<main>'); my $okcancel = create_okcancel({ - cancel_clicked => sub { ugtk2->exit }, + cancel_clicked => sub { ugtk3->exit }, ok_clicked => sub { &write_conf; run_program::raw({ detach => 1 }, "exportfs -ra"); - ugtk2->exit }, + ugtk3->exit }, }, ); @@ -597,7 +597,7 @@ undef $wait; # main interface $W->add(gtknew('VBox', children => [ 0, $menu, - 0, Gtk2::Banner->new($nfsicon, N("DrakNFS manage NFS shares")), + 0, Gtk3::Banner->new($nfsicon, N("DrakNFS manage NFS shares")), #if_($::isEmbedded, 0, gtknew('Label', text => "Here you can add, remove and alter NFS shares.")), 1, gtknew('HBox', border_width => 0, children => [ 1, gtknew('ScrolledWindow', child => $treeview), @@ -630,4 +630,4 @@ $W->add(gtknew('VBox', children => [ ); $W->show_all; -Gtk2->main; +Gtk3->main; diff --git a/bin/drakproxy b/bin/drakproxy index 2c6b1fe..338dc9a 100755 --- a/bin/drakproxy +++ b/bin/drakproxy @@ -30,7 +30,7 @@ use common; require_root_capability(); -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakproxy-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakproxy-mdk.png"; my $u = { getVarsFromSh('/etc/profile.d/proxy.sh') }; my $in = 'interactive'->vnew; if (network::network::miscellaneous_choose($in, $u)) { diff --git a/bin/draksambashare b/bin/draksambashare index 0c5f97d..92209f0 100755 --- a/bin/draksambashare +++ b/bin/draksambashare @@ -27,10 +27,10 @@ use standalone; use common; use network::network; use interactive; -use mygtk2 qw(gtknew); -use ugtk2 qw(:ask :wrappers :create :dialogs); -use Gtk2::SimpleList; -use Gtk2::Gdk::Keysyms; +use mygtk3 qw(gtknew); +use ugtk3 qw(:ask :wrappers :create :dialogs); +use Gtk3::SimpleList; +use Gtk3::Gdk::Keysyms; use run_program; # use libconf @@ -53,9 +53,9 @@ my $sambaicon = "/usr/share/mcc/themes/default/diskdrake_samba.png"; my $fileshare_icon = "$icon_path/IC-winacces2-16.png"; my $printershare_icon = "$icon_path/IC-sambaprt-16.png"; my $sambauser_icon = "$icon_path/ic82-users-16.png"; -my $pixbuf_file = Gtk2::Gdk::Pixbuf->new_from_file($fileshare_icon); -my $pixbuf_printer = Gtk2::Gdk::Pixbuf->new_from_file($printershare_icon); -my $pixbuf_user = Gtk2::Gdk::Pixbuf->new_from_file($sambauser_icon); +my $pixbuf_file = Gtk3::Gdk::Pixbuf->new_from_file($fileshare_icon); +my $pixbuf_printer = Gtk3::Gdk::Pixbuf->new_from_file($printershare_icon); +my $pixbuf_user = Gtk3::Gdk::Pixbuf->new_from_file($sambauser_icon); my $printer_list = create_printer_list(); my $share_list = create_share_list(); @@ -63,14 +63,14 @@ my $user_list = create_user_list(); my $display_share = create_display_share(); sub create_user_list() { - my $user_list = Gtk2::SimpleList->new('' => 'pixbuf', + my $user_list = Gtk3::SimpleList->new('' => 'pixbuf', N("User name") => 'text', ); $user_list; } sub create_share_list() { - my $share_list = Gtk2::SimpleList->new('' => 'pixbuf', + my $share_list = Gtk3::SimpleList->new('' => 'pixbuf', N("Share name") => 'text', N("Share directory") => 'text', N("Comment") => 'text', @@ -98,7 +98,7 @@ sub create_share_list() { } sub create_display_share() { - my $display_share = Gtk2::SimpleList->new('' => 'pixbuf', + my $display_share = Gtk3::SimpleList->new('' => 'pixbuf', N("Share name") => 'text', N("Share directory") => 'text', N("Comment") => 'text', @@ -115,7 +115,7 @@ sub create_display_share() { } sub create_printer_list() { - my $printer_list = Gtk2::SimpleList->new('' => 'pixbuf', + my $printer_list = Gtk3::SimpleList->new('' => 'pixbuf', N("Printer name") => 'text', N("Path") => 'text', N("Comment") => 'text', @@ -215,7 +215,7 @@ sub get_items() { } sub quit_all() { - ugtk2->exit; + ugtk3->exit; } sub restart_dialog() { @@ -233,10 +233,10 @@ sub wait_action { undef $w; } -my %size_groups = map { $_ => Gtk2::SizeGroup->new('horizontal') } qw(label widget button); +my %size_groups = map { $_ => Gtk3::SizeGroup->new('horizontal') } qw(label widget button); my $label_and_widgets = sub { my ($label, $widget, $button) = @_; - gtkpack_(Gtk2::HBox->new(0,1), + gtkpack_(Gtk3::HBox->new(0,1), 0, gtkadd_widget($size_groups{label}, $label), 0, gtkadd_widget($size_groups{widget}, $widget), if_($button, 0, gtkadd_widget($size_groups{button}, $button)), @@ -369,22 +369,22 @@ sub printers_section() { sub add_entry() { my ($addshare_name, $addshare_comment, $addshare_dir); - $_ = Gtk2::Entry->new foreach $addshare_name, $addshare_comment, $addshare_dir; - my $button = Gtk2::Button->new(N("Open")); + $_ = Gtk3::Entry->new foreach $addshare_name, $addshare_comment, $addshare_dir; + my $button = Gtk3::Button->new(N("Open")); $button->signal_connect(clicked => sub { show_file_dialog($addshare_dir) }); my $dialog = _create_dialog(N("DrakSamba add entry"), { transient_for => $::main_window, modal => 1 }); local $::main_window = $dialog; gtkpack_($dialog->vbox, - 0, gtkadd(Gtk2::Frame->new(N("Add a share")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 3), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, gtkadd(Gtk3::Frame->new(N("Add a share")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 3), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->(N("Name of the share:"), $addshare_name, ""), 0, $label_and_widgets->(N("Comment:"), $addshare_comment, ""), 0, $label_and_widgets->(N("Directory:"), $addshare_dir, $button), ), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, create_okcancel({ cancel_clicked => sub { $dialog->destroy }, ok_clicked => sub { @@ -545,9 +545,9 @@ sub modify_printers_entry { my ($selected) = @_; my ($dir, $comment, $print_command, $guest_ok, $share_name, $browseable, $printable, $write_list, $printing, $lpq_command, $create_mode, $writable, $use_client_driver, $inherit_permissions); - $share_name = Gtk2::Label->new; - $_ = Gtk2::Entry->new foreach $dir, $comment, $print_command, $write_list, $printing, $lpq_command, $create_mode; - $_ = Gtk2::OptionMenu->new foreach $browseable, $printable, $guest_ok, $writable, $use_client_driver, $inherit_permissions; + $share_name = Gtk3::Label->new; + $_ = Gtk3::Entry->new foreach $dir, $comment, $print_command, $write_list, $printing, $lpq_command, $create_mode; + $_ = Gtk3::OptionMenu->new foreach $browseable, $printable, $guest_ok, $writable, $use_client_driver, $inherit_permissions; $_->set_popdown_strings(@yesno) foreach $browseable, $printable, $guest_ok, $writable, $use_client_driver, $inherit_permissions; @@ -567,7 +567,7 @@ sub modify_printers_entry { $create_mode->set_text($printer_list->{data}[$selected][13]); $use_client_driver->set_text($printer_list->{data}[$selected][14]); - my $button = Gtk2::Button->new(N("Open")); + my $button = Gtk3::Button->new(N("Open")); $button->signal_connect(clicked => sub { show_file_dialog($dir) }); my $dialog = _create_dialog(N("DrakSamba Printers entry"), { transient_for => $::main_window, modal => 1 }); @@ -583,34 +583,34 @@ sub modify_printers_entry { } gtkpack_($dialog->vbox, - 0, gtkadd(Gtk2::Frame->new(N("Printer share")), - gtkpack_(gtkset_border_width(Gtk2::HBox->new, 3), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, gtkadd(Gtk3::Frame->new(N("Printer share")), + gtkpack_(gtkset_border_width(Gtk3::HBox->new, 3), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->(N("Printer name:"), $share_name, ""), 0, $label_and_widgets->(N("Comment:"), $comment, ""), 0, $label_and_widgets->(N("Directory:"), $dir, $button), ), - 0, Gtk2::VSeparator->new, - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, Gtk3::VSeparator->new, + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->(N("Writable:"), $writable, ""), 0, $label_and_widgets->(N("Browseable:"), $browseable, ""), 0, $label_and_widgets->(N("Printable"), $printable, ""), ), ), ), - 0, gtkadd(Gtk2::Frame->new(N("Advanced options")), - gtkpack_(gtkset_border_width(Gtk2::HBox->new, 3), - 0, gtkadd(Gtk2::Frame->new(N("Printer access")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, gtkadd(Gtk3::Frame->new(N("Advanced options")), + gtkpack_(gtkset_border_width(Gtk3::HBox->new, 3), + 0, gtkadd(Gtk3::Frame->new(N("Printer access")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->(N("Write list"), $write_list, ""), 0, $label_and_widgets->(N("Inherit permissions"), $inherit_permissions, ""), 0, $label_and_widgets->(N("Guest ok:"), $guest_ok, ""), 0, $label_and_widgets->(N("Create mode:"), $create_mode, ""), ), ), - 0, Gtk2::VSeparator->new, - 0, gtkadd(Gtk2::Frame->new(N("Printer command")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, Gtk3::VSeparator->new, + 0, gtkadd(Gtk3::Frame->new(N("Printer command")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->(N("Print command:"), $print_command, ""), 0, $label_and_widgets->(N("LPQ command:"), $lpq_command, ""), 0, $label_and_widgets->(N("Printing:"), $printing, ""), @@ -679,18 +679,18 @@ sub modify_entry { my ($selected) = @_; my ($dir, $comment, $create_mask, $directory_mask, $read_list, $write_list, $admin_users, $valid_users, $force_group, $browseable, $public, $writable, $hide_files, $hide_dot_files, $force_create_mode, $preserve_case, $default_case, $inherit_permissions, $share_name); - $share_name = Gtk2::Label->new; - $_ = Gtk2::Entry->new foreach $dir, $comment, $create_mask, $directory_mask, $hide_files; - $_ = Gtk2::Entry->new foreach $read_list, $write_list, $admin_users, $valid_users, $force_group, $force_create_mode; - $_ = Gtk2::OptionMenu->new foreach $browseable, $public, $writable, $default_case, $preserve_case, $hide_dot_files, $inherit_permissions; + $share_name = Gtk3::Label->new; + $_ = Gtk3::Entry->new foreach $dir, $comment, $create_mask, $directory_mask, $hide_files; + $_ = Gtk3::Entry->new foreach $read_list, $write_list, $admin_users, $valid_users, $force_group, $force_create_mode; + $_ = Gtk3::OptionMenu->new foreach $browseable, $public, $writable, $default_case, $preserve_case, $hide_dot_files, $inherit_permissions; $default_case->set_popdown_strings(@default_case); $_->set_popdown_strings(@yesno) foreach $browseable, $public, $writable, $hide_dot_files, $preserve_case, $inherit_permissions; - my $button = Gtk2::Button->new(N("Open")); + my $button = Gtk3::Button->new(N("Open")); $button->signal_connect(clicked => sub { show_file_dialog($dir) }); - my $w = ugtk2->new(N("DrakSamba entry")); + my $w = ugtk3->new(N("DrakSamba entry")); $w->{window}->set_modal(1); $w->{window}->set_position('center'); @@ -716,18 +716,18 @@ sub modify_entry { $force_group->set_text($share_list->{data}[$selected][18]); $default_case->set_text($share_list->{data}[$selected][19]); - my $expander_user = Gtk2::Expander->new(N("User options (user access, mask option, force mode)")); - $expander_user->add(gtkpack_(Gtk2::HBox->new, - 0, gtkadd(Gtk2::Frame->new(N("Samba user access")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + my $expander_user = Gtk3::Expander->new(N("User options (user access, mask option, force mode)")); + $expander_user->add(gtkpack_(Gtk3::HBox->new, + 0, gtkadd(Gtk3::Frame->new(N("Samba user access")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->($adv_options{read_list}, $read_list, ""), 0, $label_and_widgets->($adv_options{write_list}, $write_list, ""), 0, $label_and_widgets->($adv_options{admin_users}, $admin_users, ""), 0, $label_and_widgets->($adv_options{valid_users}, $valid_users, ""), ), ), - 0, gtkadd(Gtk2::Frame->new(N("Mask options")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + 0, gtkadd(Gtk3::Frame->new(N("Mask options")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $label_and_widgets->($adv_options{create_mask}, $create_mask, ""), 0, $label_and_widgets->($adv_options{directory_mask}, $directory_mask, ""), 0, $label_and_widgets->($adv_options{force_group}, $force_group, ""), @@ -738,16 +738,16 @@ sub modify_entry { ), ); - my $expander_file = Gtk2::Expander->new(N("File options (hide files, case)")); - $expander_file->add(gtkpack_(Gtk2::VBox->new, - 0, gtkadd(Gtk2::Frame->new(N("Display options")), - gtkpack_(gtkset_border_width(Gtk2::HBox->new, 1), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), + my $expander_file = Gtk3::Expander->new(N("File options (hide files, case)")); + $expander_file->add(gtkpack_(Gtk3::VBox->new, + 0, gtkadd(Gtk3::Frame->new(N("Display options")), + gtkpack_(gtkset_border_width(Gtk3::HBox->new, 1), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, $label_and_widgets->($adv_options{hide_dot_files}, $hide_dot_files, ""), 0, $label_and_widgets->($adv_options{hide_files}, $hide_files, ""), ), - 0, Gtk2::VSeparator->new, - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), + 0, Gtk3::VSeparator->new, + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, $label_and_widgets->($adv_options{default_case}, $default_case, ""), 0, $label_and_widgets->($adv_options{preserve_case}, $preserve_case, ""), ), @@ -762,25 +762,25 @@ sub modify_entry { gtkadd($w->{window}, gtknew('VBox', spacing => 0, children_loose => [ - gtkadd(Gtk2::Frame->new(N("Samba share directory")), - gtkpack_(gtkset_border_width(Gtk2::HBox->new, 1), - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), + gtkadd(Gtk3::Frame->new(N("Samba share directory")), + gtkpack_(gtkset_border_width(Gtk3::HBox->new, 1), + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, $label_and_widgets->(N("Share name:"), $share_name), 0, $label_and_widgets->(N("Directory:"), $dir, $button), 0, $label_and_widgets->(N("Comment:"), $comment, ""), ), - 0, Gtk2::VSeparator->new, - 0, gtkpack_(gtkset_border_width(Gtk2::VBox->new, 0), + 0, Gtk3::VSeparator->new, + 0, gtkpack_(gtkset_border_width(Gtk3::VBox->new, 0), 0, $label_and_widgets->(N("Public:"), $public, ""), 0, $label_and_widgets->(N("Writable:"), $writable, ""), 0, $label_and_widgets->(N("Browseable:"), $browseable, ""), ), ), ), - gtkadd(Gtk2::Frame->new(N("Advanced options")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 1), + gtkadd(Gtk3::Frame->new(N("Advanced options")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 1), 0, $expander_user, - 0, Gtk2::HSeparator->new, + 0, Gtk3::HSeparator->new, 0, $expander_file, ), ), @@ -914,24 +914,24 @@ sub get_user() { sub modify_user_info { my ($user, $_passwd, $todo) = @_; my ($buser, $bpasswd); - my $dialog = new Gtk2::Dialog(); + my $dialog = new Gtk3::Dialog(); $dialog->set_title(N("Add Samba user")); $dialog->set_modal(1); $dialog->set_position('center'); $dialog->set_resizable(0); if ($todo eq "add") { - $buser = Gtk2::ComboBox->new_with_strings([ get_user() ]); + $buser = Gtk3::ComboBox->new_with_strings([ get_user() ]); $buser->set_wrap_width(3); } else { - $buser = Gtk2::Label->new; + $buser = Gtk3::Label->new; $buser->set_text($user); } - $bpasswd = Gtk2::Entry->new; + $bpasswd = Gtk3::Entry->new; $bpasswd->set_visibility(0); gtkpack_($dialog->vbox, - 0, gtkadd(Gtk2::Frame->new(N("User information")), - gtkpack_(gtkset_border_width(Gtk2::VBox->new, 5), + 0, gtkadd(Gtk3::Frame->new(N("User information")), + gtkpack_(gtkset_border_width(Gtk3::VBox->new, 5), 0, $label_and_widgets->(N("User name:"), $buser, ""), 0, $label_and_widgets->(N("Password:"), $bpasswd, ""), ), @@ -1288,13 +1288,13 @@ add_data_printer_list($printer_list); add_data_user_list($user_list); $_->set_rules_hint(1) foreach $display_share, $printer_list, $user_list; -$ugtk2::wm_icon = $fileshare_icon; -$window = ugtk2->new(N("Manage Samba configuration")); +$ugtk3::wm_icon = $fileshare_icon; +$window = ugtk3->new(N("Manage Samba configuration")); $::main_window = $window->{real_window}; $window->{rwindow}->set_size_request(600, 410) unless $::isEmbedded; $window->{rwindow}->set_position('center') if !$::isEmbedded; my $W = $window->{window}; -$W->signal_connect(delete_event => sub { ugtk2->exit }); +$W->signal_connect(delete_event => sub { ugtk3->exit }); # double clic and popup modify window $display_share->signal_connect(button_press_event => sub { @@ -1326,9 +1326,9 @@ $user_list->signal_connect(button_press_event => sub { #} [ $share_list, $printer_list, $user_list ], [ modify_entry, modify_printers_entry, modify_user_info ]; # create popup menu -my $menupopup = Gtk2::Menu->new; -my $menuitem1 = Gtk2::MenuItem->new(N("Modify")); -my $menuitem2 = Gtk2::MenuItem->new(N("Remove")); +my $menupopup = Gtk3::Menu->new; +my $menuitem1 = Gtk3::MenuItem->new(N("Modify")); +my $menuitem2 = Gtk3::MenuItem->new(N("Remove")); $menuitem1->signal_connect(activate => sub { my ($selected) = $display_share->get_selected_indices; modify_entry($selected); @@ -1349,7 +1349,7 @@ $display_share->signal_connect('button-press-event' => sub { $display_share->signal_connect(key_press_event => sub { my (undef, $event) = @_; - return unless $event->keyval == $Gtk2::Gdk::Keysyms{Return}; + return unless $event->keyval == $Gtk3::Gdk::Keysyms{Return}; my ($selected) = $display_share->get_selected_indices; modify_entry($selected); return 1; @@ -1357,22 +1357,22 @@ $display_share->signal_connect(key_press_event => sub { # create menu my @items = get_items(); -my $factory = Gtk2::ItemFactory->new('Gtk2::MenuBar', '<main>', undef); +my $factory = Gtk3::ItemFactory->new('Gtk3::MenuBar', '<main>', undef); $factory->create_items('menu', @items); my $menu = $factory->get_widget('<main>'); my $okcancel = create_okcancel({ - cancel_clicked => sub { ugtk2->exit }, - ok_clicked => sub { &write_conf; ugtk2->exit }, + cancel_clicked => sub { ugtk3->exit }, + ok_clicked => sub { &write_conf; ugtk3->exit }, }, ); -gtkappend_page(my $nb = Gtk2::Notebook->new, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), +gtkappend_page(my $nb = Gtk3::Notebook->new, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 0), 1, create_scrolled_window($display_share), 0, gtkpack_(create_vbox('start'), - 0, gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => \&add_entry), - 0, Gtk2::HSeparator->new, - 0, gtksignal_connect(Gtk2::Button->new(N("Modify")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Add")), clicked => \&add_entry), + 0, Gtk3::HSeparator->new, + 0, gtksignal_connect(Gtk3::Button->new(N("Modify")), clicked => sub { my ($selected) = $display_share->get_selected_indices; eval { modify_entry($selected) }; my $err = $@; @@ -1380,7 +1380,7 @@ gtkappend_page(my $nb = Gtk2::Notebook->new, gtkpack_(gtkset_border_width(Gtk2:: err_dialog(N("Error"), N("Failed to Modify Samba share.") . "\n\n" . $err); } }), - 0, gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => sub { my ($selected) = $display_share->get_selected_indices; ask_okcancel("Remove entry ?", "Remove $display_share->{data}[$selected][1]") or return; eval { remove_entry($selected, $display_share) }; @@ -1391,19 +1391,19 @@ gtkappend_page(my $nb = Gtk2::Notebook->new, gtkpack_(gtkset_border_width(Gtk2:: }), ), ), - gtkshow(gtkpack_(Gtk2::HBox->new(0,0), - 0, Gtk2::Image->new_from_file($fileshare_icon), - 0, Gtk2::Label->new(N("File share")), + gtkshow(gtkpack_(Gtk3::HBox->new(0,0), + 0, Gtk3::Image->new_from_file($fileshare_icon), + 0, Gtk3::Label->new(N("File share")), ), ), ); -gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), +gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 0), 1, create_scrolled_window($printer_list), 0, gtkpack_(create_vbox('start'), - 0, gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => \&add_printers_entry), - 0, Gtk2::HSeparator->new, - 0, gtksignal_connect(Gtk2::Button->new(N("Modify")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Add")), clicked => \&add_printers_entry), + 0, Gtk3::HSeparator->new, + 0, gtksignal_connect(Gtk3::Button->new(N("Modify")), clicked => sub { my ($selected) = $printer_list->get_selected_indices; eval { modify_printers_entry($selected) }; my $err = $@; @@ -1411,7 +1411,7 @@ gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), err_dialog(N("Error"), N("Failed to Modify.") . "\n\n" . $err); } }), - 0, gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => sub { my ($selected) = $printer_list->get_selected_indices; ask_okcancel("Remove entry ?", "Remove $printer_list->{data}[$selected][1]") or return; eval { remove_entry($selected, $printer_list) }; @@ -1422,25 +1422,25 @@ gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), }), ), ), - gtkshow(gtkpack_(Gtk2::HBox->new(0,0), - 0, Gtk2::Image->new_from_file($printershare_icon), - 0, Gtk2::Label->new(N("Printers")), + gtkshow(gtkpack_(Gtk3::HBox->new(0,0), + 0, Gtk3::Image->new_from_file($printershare_icon), + 0, Gtk3::Label->new(N("Printers")), ), ), ); -gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), +gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk3::HBox->new, 0), 1, create_scrolled_window($user_list), 0, gtkpack_(create_vbox('start'), - 0, gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Add")), clicked => sub { eval { modify_user_info("", "", "add") }; my $err = $@; if ($err) { err_dialog(N("Error"), N("Failed to add user.") . "\n\n" . $err); } }), - 0, Gtk2::HSeparator->new, - 0, gtksignal_connect(Gtk2::Button->new(N("Modify")), clicked => sub { + 0, Gtk3::HSeparator->new, + 0, gtksignal_connect(Gtk3::Button->new(N("Modify")), clicked => sub { my ($selected) = $user_list->get_selected_indices; eval { modify_user_info($user_list->{data}[$selected][1], "", "change") }; my $err = $@; @@ -1448,7 +1448,7 @@ gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), err_dialog(N("Error"), N("Failed to change user password.") . "\n\n" . $err); } }), - 0, gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => sub { my ($selected) = $user_list->get_selected_indices; ask_okcancel("Remove entry ?", "Remove $user_list->{data}[$selected][1]") or return; eval { @@ -1460,17 +1460,17 @@ gtkappend_page($nb, gtkpack_(gtkset_border_width(Gtk2::HBox->new, 0), err_dialog(N("Error"), N("Failed to delete user.") . "\n\n" . $err); } }), - 0, Gtk2::HSeparator->new, + 0, Gtk3::HSeparator->new, # FIXME: Why do we have both an "add" button and a "userdrake" one ??? - 0, gtksignal_connect(Gtk2::Button->new(N("Userdrake")), clicked => sub { + 0, gtksignal_connect(Gtk3::Button->new(N("Userdrake")), clicked => sub { run_program::raw({ detach => 1 }, 'userdrake'); } ), ), ), - gtkshow(gtkpack_(Gtk2::HBox->new(0,0), - 0, Gtk2::Image->new_from_file($sambauser_icon), - 0, Gtk2::Label->new(N("Samba Users"))), + gtkshow(gtkpack_(Gtk3::HBox->new(0,0), + 0, Gtk3::Image->new_from_file($sambauser_icon), + 0, Gtk3::Label->new(N("Samba Users"))), ), ); @@ -1485,10 +1485,10 @@ sub check_first_launch() { } # main interface -$W->add(gtkpack_(Gtk2::VBox->new(0,0), +$W->add(gtkpack_(Gtk3::VBox->new(0,0), 0, $menu, - 0, Gtk2::Banner->new($sambaicon, N("DrakSamba manage Samba shares")), - #if_($::isEmbedded, 0, Gtk2::Label->new("Here you can add, remove and alter Samba shares.")), + 0, Gtk3::Banner->new($sambaicon, N("DrakSamba manage Samba shares")), + #if_($::isEmbedded, 0, Gtk3::Label->new("Here you can add, remove and alter Samba shares.")), 1, $nb, 0, $okcancel, ), @@ -1496,4 +1496,4 @@ $W->add(gtkpack_(Gtk2::VBox->new(0,0), check_first_launch; $W->show_all; -Gtk2->main; +Gtk3->main; diff --git a/bin/net_applet b/bin/net_applet index 146b5b9..d9c502f 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -16,14 +16,14 @@ use network::connection::ethernet; use network::vpn; use run_program; use do_pkgs; -use mygtk2 qw(gtknew gtkset); +use mygtk3 qw(gtknew gtkset); use dbus_object; use network::monitor; use network::signal_strength; use detect_devices; -use Gtk2::Notify -init, 'NetApplet'; +use Gtk3::Notify -init, 'NetApplet'; -use ugtk2 qw(:create :helpers :wrappers :dialogs); +use ugtk3 qw(:create :helpers :wrappers :dialogs); my $onstartupfile = "$ENV{HOME}/.net_applet"; my $system_file = '/etc/sysconfig/drakx-net'; @@ -34,7 +34,7 @@ is_running('net_applet') and die "net_applet already running\n"; package network::net_applet; -use mygtk2 qw(gtknew gtkset); +use mygtk3 qw(gtknew gtkset); use common; our ($current_state, $current_interface); @@ -220,7 +220,7 @@ my %actions = ( ); -$icon = Gtk2::StatusIcon->new; +$icon = Gtk3::StatusIcon->new; eval { $dbus = dbus_object::system_bus() } if !defined($global_settings{NET_APPLET_DBUS}) || text2bool($global_settings{NET_APPLET_DBUS}); eval { $net->{monitor} = network::monitor->new($dbus) } if $dbus; @@ -240,10 +240,10 @@ if ($dbus) { } }); $dbus->{connection}->add_match("type='signal',interface='org.mageia.network'"); - dbus_object::set_gtk2_watch_helper($dbus); + dbus_object::set_gtk3_watch_helper($dbus); } -$notification_queue = Gtk2::Notify::Queue->new($icon); +$notification_queue = Gtk3::Notify::Queue->new($icon); $icon->signal_connect(activate => sub { my ($_icon, $button, $time) = @_; @@ -284,9 +284,9 @@ sub harvester { } while $pid > 0; } -Gtk2->main; +Gtk3->main; -ugtk2::exit(0); +ugtk3::exit(0); sub is_running { my ($name, $o_user) = @_; @@ -340,12 +340,12 @@ sub run_drakids() { sub generate_wireless_menuitem { my ($wnet) = @_; my $menuitem = {}; - $menuitem->{widget} = Gtk2::CheckMenuItem->new; + $menuitem->{widget} = Gtk3::CheckMenuItem->new; $menuitem->{widget}->set_draw_as_radio(1); $menuitem->{widget}->add(gtkpack_(gtkshow(gtknew('HBox')), 1, gtkset_alignment($menuitem->{label} = gtknew('Label'), 0, 0.5), - 0, $menuitem->{strength} = Gtk2::Image->new, - 0, $menuitem->{security} = Gtk2::Image->new, + 0, $menuitem->{strength} = Gtk3::Image->new, + 0, $menuitem->{security} = Gtk3::Image->new, )); $menuitem->{activate} = $menuitem->{widget}->signal_connect('activate' => sub { if ($net->{monitor} && exists $wnet->{id}) { @@ -466,7 +466,7 @@ sub create_menu_choices { my $choice = $_; my $label = $format ? $format->($choice) : $choice; my $w = gtkshow(gtkset_active(gtkadd( - Gtk2::CheckMenuItem->new, + Gtk3::CheckMenuItem->new, gtknew('HBox', children => [ 1, gtkset_alignment(gtknew('Label', text => $label), 0, 0.5), $get_icon ? @@ -488,12 +488,12 @@ sub create_action_item { gtkshow(create_menu($name, $actions{$action}{header} ? ( create_action_item($actions{$action}{header}), - gtkshow(Gtk2::SeparatorMenuItem->new), + gtkshow(Gtk3::SeparatorMenuItem->new), ) : (), @menu, )); } else { - gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($name)), activate => sub { $actions{$action}{launch}->($current_interface) }); + gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label($name)), activate => sub { $actions{$action}{launch}->($current_interface) }); } } @@ -501,7 +501,7 @@ sub empty_menu { my ($menu) = @_; delete $_->{menuitems} foreach values %wireless_networks; $menu->destroy if $menu; - Gtk2::Menu->new; + Gtk3::Menu->new; } sub get_wireless_networks_sorted() { @@ -519,7 +519,7 @@ sub generate_simple_menu() { gtkappend($simple_menu, (map { generate_wireless_menuitem($_) } @valuable_networks), (@networks ? create_menu(N("More networks"), map { generate_wireless_menuitem($_) } @networks) : ()), - Gtk2::SeparatorMenuItem->new, + Gtk3::SeparatorMenuItem->new, ); } gtkappend($simple_menu, create_menu_choices('setInterface', 'allow_single_choice')); @@ -545,25 +545,25 @@ sub generate_menu() { push @settings, create_action_item('chooseProfile'); if (defined $interactive) { - $interactive_cb = gtkshow(gtksignal_connect(gtkset_active(Gtk2::CheckMenuItem->new_with_label(N("Interactive Firewall automatic mode")), + $interactive_cb = gtkshow(gtksignal_connect(gtkset_active(Gtk3::CheckMenuItem->new_with_label(N("Interactive Firewall automatic mode")), !$interactive), toggled => sub { eval { $ifw->set_interactive(to_bool(!$_[0]->get_active)) } })); push @settings, $interactive_cb; } - push @settings, gtkshow(gtksignal_connect(gtkset_active(Gtk2::CheckMenuItem->new_with_label(N("Always launch on startup")), getAutoStart()), + push @settings, gtkshow(gtksignal_connect(gtkset_active(Gtk3::CheckMenuItem->new_with_label(N("Always launch on startup")), getAutoStart()), toggled => sub { setAutoStart(uc(bool2text($_[0]->get_active))) })); - $menu->append(gtkshow(Gtk2::SeparatorMenuItem->new)); + $menu->append(gtkshow(Gtk3::SeparatorMenuItem->new)); if ($current_state ne 'unconfigured' && $wireless_device) { $menu->append(gtkshow(create_menu(N("Wireless networks"), create_action_item('wireless'), - gtkshow(Gtk2::SeparatorMenuItem->new), + gtkshow(Gtk3::SeparatorMenuItem->new), map { generate_wireless_menuitem($_) } get_wireless_networks_sorted()))); } if (my $vpn = create_action_item('chooseVPN')) { $menu->append($vpn) } if (my $set = $current_state ne 'unconfigured' && create_action_item('setInterface')) { $menu->append($set) } $menu->append(gtkshow(create_menu(N("Settings"), @settings))); - $menu->append(gtkshow(Gtk2::SeparatorMenuItem->new)); + $menu->append(gtkshow(Gtk3::SeparatorMenuItem->new)); $menu->append(create_action_item('help')); $menu->append(create_action_item('quit')); $menu; @@ -571,7 +571,7 @@ sub generate_menu() { sub mainQuit() { Glib::Source->remove($timeout) if $timeout; Glib::Source->remove($update_timeout) if $update_timeout; - Gtk2->main_quit; + Gtk3->main_quit; } sub getAutoStart() { my %p = getVarsFromSh($onstartupfile); diff --git a/bin/net_monitor b/bin/net_monitor index eb9a37a..d3704b8 100755 --- a/bin/net_monitor +++ b/bin/net_monitor @@ -29,14 +29,14 @@ use standalone; #- warning, standalone must be loaded very first, for 'expla use c; use interactive; -use mygtk2 qw(gtknew gtkset); -use ugtk2 qw(:create :helpers :wrappers); +use mygtk3 qw(gtknew gtkset); +use ugtk3 qw(:create :helpers :wrappers); use common; use network::network; use network::tools; use POSIX; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/net_monitor-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/net_monitor-mdk.png"; if ("@ARGV" =~ /--status/) { print network::tools::connected(); exit(0) } my $force = "@ARGV" =~ /--force/; @@ -57,7 +57,7 @@ if ($force) { $quiet and exit(0); -my $window1 = ugtk2->new(N("Network Monitoring")); +my $window1 = ugtk3->new(N("Network Monitoring")); $window1->{window}->signal_connect(delete_event => \&main_quit); unless ($::isEmbedded) { @@ -121,18 +121,18 @@ gtkadd($window1->{window}, 0, gtknew('HButtonBox', layout => 'edge', children_loose => [ my $button_close = gtknew('Button', text => N("Close"), clicked => \&main_quit), ]), - 0, my $statusbar = Gtk2::Statusbar->new + 0, my $statusbar = Gtk3::Statusbar->new ]), ); $window1->{window}->show_all; $window1->{window}->realize; -my $gct = Gtk2::Gdk::GC->new($window1->{window}->window); +my $gct = Gtk3::Gdk::GC->new($window1->{window}->window); $gct->set_foreground($colort); -my $gcr = Gtk2::Gdk::GC->new($window1->{window}->window); +my $gcr = Gtk3::Gdk::GC->new($window1->{window}->window); $gcr->set_foreground($colorr); -my $gca = Gtk2::Gdk::GC->new($window1->{window}->window); +my $gca = Gtk3::Gdk::GC->new($window1->{window}->window); $gca->set_foreground($colora); $statusbar->push(1, N("Wait please, testing your connection...")); @@ -180,7 +180,7 @@ sub main_quit() { } $config{use_same_scale} = bool2yesno($use_same_scale); setVarsInSh($cfg_file, \%config); - ugtk2->exit(0); + ugtk3->exit(0); } sub getcurrentintf() { @@ -383,7 +383,7 @@ sub get_val() { sub change_color { my ($color) = @_; my $dialog = _create_dialog(N("Color configuration")); - $dialog->vbox->add(my $colorsel = Gtk2::ColorSelection->new); + $dialog->vbox->add(my $colorsel = Gtk3::ColorSelection->new); $colorsel->set_current_color($color); $dialog->add_button(N("Cancel"), 'cancel'); $dialog->add_button(N("Ok"), 'ok'); @@ -408,7 +408,7 @@ sub color_button { $gc->set_rgb_fg_color($color); $_[0]->queue_draw; }, - child => gtksignal_connect(gtkshow(gtksize(gtkset(Gtk2::DrawingArea->new, width => 10, height => 10), 10, 10)), + child => gtksignal_connect(gtkshow(gtksize(gtkset(Gtk3::DrawingArea->new, width => 10, height => 10), 10, 10)), expose_event => sub { $_[0]->window->draw_rectangle($gc, 1, 0, 0, 10, 10) }) ); } @@ -432,7 +432,7 @@ sub update() { $monitor->{$intf}{initialt} = $monitor->{$intf}{val}[8]; $monitor->{$intf}{totalr} = 0; $monitor->{$intf}{totalt} = 0; - $darea->{$intf} = Gtk2::DrawingArea->new; + $darea->{$intf} = Gtk3::DrawingArea->new; $darea->{$intf}->set_events(["pointer_motion_mask"]); $notebook->append_page(gtkshow(my $page = gtknew('VBox', children => [ 0, gtknew('HBox', border_width => 5, children_tight => [ @@ -469,7 +469,7 @@ sub update() { gtknew('Label', text => $intf)); $monitor->{$intf}{page} = $notebook->page_num($page); $darea->{$intf}->realize; - $pixmap->{$intf} = Gtk2::Gdk::Pixmap->new($darea->{$intf}->window, $width, $height, $darea->{$intf}->window->get_depth); + $pixmap->{$intf} = Gtk3::Gdk::Pixmap->new($darea->{$intf}->window, $width, $height, $darea->{$intf}->window->get_depth); $monitor->{$intf}{referencer} = $monitor->{$intf}{val}[0]; $monitor->{$intf}{referencet} = $monitor->{$intf}{val}[8]; $pixmap->{$intf}->draw_rectangle($darea->{$intf}->style->black_gc, 1, 0, 0, $width, $height); @@ -485,7 +485,7 @@ sub update() { return if !$darea->{$intf}->window; $darea->{$intf}->window->draw_drawable($darea->{$intf}->style->bg_gc('normal'), $pixmap->{$intf}, 0, 0, 0, 0, $width, $height); }); - $gc_lines->{$intf} = Gtk2::Gdk::GC->new($darea->{$intf}->window); + $gc_lines->{$intf} = Gtk3::Gdk::GC->new($darea->{$intf}->window); $gc_lines->{$intf}->set_foreground($darea->{$intf}->style->white); $gc_lines->{$intf}->set_line_attributes(1, 'on-off-dash', 'not-last', 'round'); @@ -538,7 +538,7 @@ sub draw_monitor { my $gcl = $gc_lines->{$intf}; my $pixmap = $pixmap->{$intf}; my $gc = $darea->{$intf}->style->white_gc; - # fix race on ugtk2->exit that causes a crash (#33023) + # fix race on ugtk3->exit that causes a crash (#33023) return 0 if !$gc; $pixmap->draw_rectangle($darea->{$intf}->style->black_gc, 1, 0, 0, $width, $height); my $maxr = 0; 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; diff --git a/old/drakvpn-old b/old/drakvpn-old index 1e0806e..067456b 100755 --- a/old/drakvpn-old +++ b/old/drakvpn-old @@ -44,7 +44,7 @@ require_root_capability(); local $_ = join '', @ARGV; $::Wizard_pix_up = "drakvpn"; -$ugtk2::wm_icon = "drakvpn"; +$ugtk3::wm_icon = "drakvpn"; my $direct = /-direct/; |