From a90c75de317ece497ecd0da553c3a0666ae4fd16 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 10 Feb 2013 19:37:06 +0000 Subject: (create_boxradio,create_widgets) adapt to new tooltips API --- perl-install/interactive/gtk.pm | 6 ++---- perl-install/mygtk3.pm | 5 +---- perl-install/standalone/drakperm | 9 +++------ perl-install/ugtk3.pm | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 03c0ea2c1..d7ce8f182 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -46,7 +46,6 @@ sub create_boxradio { my $boxradio = gtkpack2__(Gtk3::VBox->new, my @radios = gtkradio('', @{$e->{formatted_list}})); - my $tips = Gtk3::Tooltips->new; mapn { my ($txt, $w) = @_; # workaround infamous 6 years old gnome bug #101968: @@ -59,7 +58,7 @@ sub create_boxradio { $onchange_f->(sub { $txt }); }); if ($e->{help}) { - gtkset_tip($tips, $w, + $w->set_tooltip_text( ref($e->{help}) eq 'HASH' ? $e->{help}{$txt} : ref($e->{help}) eq 'CODE' ? $e->{help}($txt) : $e->{help}); } @@ -750,9 +749,8 @@ sub create_widgets { my $box = create_widgets_block($o, $common, $l, $update, \$ignore); - my $tooltips = Gtk3::Tooltips->new; foreach my $e (@all) { - $tooltips->set_tip($e->{w}, $e->{help}) if $e->{help} && !ref($e->{help}); + $e->{w}->set_tooltip_text($e->{help}) if $e->{help} && !ref($e->{help}); } $box, $set_all; diff --git a/perl-install/mygtk3.pm b/perl-install/mygtk3.pm index 173f0519b..50b2a491f 100644 --- a/perl-install/mygtk3.pm +++ b/perl-install/mygtk3.pm @@ -97,8 +97,6 @@ sub gtkval_modify { } } -my $global_tooltips; - sub _gtk { my ($w, $class, $action, $opts) = @_; @@ -122,8 +120,7 @@ sub _gtk { $w->signal_connect(realize => delete $opts->{realize}) if exists $opts->{realize}; (delete $opts->{size_group})->add_widget($w) if $opts->{size_group}; if (my $tip = delete $opts->{tip}) { - $global_tooltips ||= Gtk3::Tooltips->new; - $global_tooltips->set_tip($w, $tip); + $w->set_tooltip_text($tip); } #- WARNING: hide_ref and show_ref are not effective until you gtkval_modify the ref diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index 5dd9d9198..225fe19f1 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -103,8 +103,6 @@ $permList->signal_connect(button_press_event => sub { }); -my $tips = Gtk3::Tooltips->new; - $W->add(gtknew('VBox', spacing => 5, children => [ if_(!$::isEmbedded, 0, Gtk3::Banner->new('/usr/share/mcc/themes/default/drakperm-mdk.png', N("Permissions"))), 0, gtknew('Label_Left', text => N("Here you can see files to use in order to fix permissions, owners, and groups via msec.\nYou can also edit your own rules which will overwrite the default rules."), alignment => [ 0.5, 0 ]), @@ -118,7 +116,7 @@ Select permissions to see/edit", $level), alignment => [ 0, 0 ]), 1, gtknew('ScrolledWindow', child => $permList), 0, my $up_down_box = gtknew('HBox', spacing => 5, children_loose => [ @buttons = map { - gtkset_tip($tips, + gtkset_tip( gtknew('Button', text => $_->[0], clicked => $_->[2]), $_->[1]); } ([ N("Up"), N("Move selected rule up one level"), sub { move_callback('up') } ], @@ -292,7 +290,7 @@ sub row_setting_dialog { ] ); - my $usr_check = gtksignal_connect(gtkset_tip($tips, gtknew('CheckButton', text => N("Current user")), + my $usr_check = gtksignal_connect(gtkset_tip(gtknew('CheckButton', text => N("Current user")), N("When checked, owner and group will not be changed")), clicked => sub { $id_box->set_sensitive(!$_[0]->get_active) }); @@ -343,8 +341,7 @@ sub row_setting_dialog { map { my $c = $_; my $active = $perms{$owner}{$c}; - $perms{$owner}{$c} = gtknew('CheckButton'); - $tips->set_tip($perms{$owner}{$c}, + $perms{$owner}{$c} = gtkset_tip(gtknew('CheckButton'), $checks{$c}{tip}{$owner}, ); gtkset_active($perms{$owner}{$c}, $active); diff --git a/perl-install/ugtk3.pm b/perl-install/ugtk3.pm index 7e356c8e0..192d7a6a9 100644 --- a/perl-install/ugtk3.pm +++ b/perl-install/ugtk3.pm @@ -78,7 +78,7 @@ sub gtkset_mousecursor_wait { gtkset_mousecursor('watch', @_) } sub gtkset_relief { $_[0]->set_relief($_[1]); $_[0] } sub gtkset_sensitive { $_[0]->set_sensitive($_[1]); $_[0] } sub gtkset_visibility { $_[0]->set_visibility($_[1]); $_[0] } -sub gtkset_tip { $_[0]->set_tip($_[1], $_[2]) if $_[2]; $_[1] } +sub gtkset_tip { $_[0]->set_tooltip_text($_[1]) if $_[1]; $_[0] } sub gtkset_shadow_type { $_[0]->set_shadow_type($_[1]); $_[0] } sub gtkset_style { $_[0]->set_style($_[1]); $_[0] } sub gtkset_size_request { $_[0]->set_size_request($_[1], $_[2]); $_[0] } -- cgit v1.2.1