diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-14 14:48:47 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-14 14:48:47 +0000 |
commit | ce64f40f80b92ce5ead57dfbc255b3de0487ceb6 (patch) | |
tree | 8b1130eecf788b5c0c38e119051371e41dab0f1c /perl-install | |
parent | edd6b69bc68f85aa3cdd35a5fc18dfce3eda364e (diff) | |
download | drakx-ce64f40f80b92ce5ead57dfbc255b3de0487ceb6.tar drakx-ce64f40f80b92ce5ead57dfbc255b3de0487ceb6.tar.gz drakx-ce64f40f80b92ce5ead57dfbc255b3de0487ceb6.tar.bz2 drakx-ce64f40f80b92ce5ead57dfbc255b3de0487ceb6.tar.xz drakx-ce64f40f80b92ce5ead57dfbc255b3de0487ceb6.zip |
adapt Gtk2::NotificationBubble::Queue to Gtk2::Notify (#37509, from Titi)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ugtk2.pm | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index f10ab284c..23a94cdcc 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -1547,31 +1547,17 @@ sub RENDER { # not that efficient... package Gtk2::NotificationBubble::Queue; sub new { - my ($class) = @_; + my ($class, $statusicon) = @_; - require Gtk2::NotificationBubble; + require Gtk2::Notify; my $self = bless { - bubble => Gtk2::NotificationBubble->new, + bubble => Gtk2::Notify->new('', '', undef, undef), queue => [], + statusicon => $statusicon, display => 5000, delay => 500, }, $class; - $self->{bubble}->signal_connect(timeout => sub { - my $info = $self->{queue}[0]; - $info->{timeout}->() if $info->{timeout}; - $self->process_next; - }); - $self->{bubble}->signal_connect(clicked => sub { - $self->{bubble}->hide; - my $info = $self->{queue}[0]; - if ($info->{clicked}) { - #- has to call process_next when done - $info->{clicked}->(); - } else { - $self->process_next; - } - }); $self; } @@ -1591,8 +1577,26 @@ sub add { sub show { my ($self) = @_; # perl_checker: $self = Gtk2::NotificationBubble->new my $info = $self->{queue}[0]; - $self->{bubble}->set($info->{title}, Gtk2::Image->new_from_pixbuf($info->{pixbuf}), $info->{message}); - $self->{bubble}->show($self->{display}); + $self->{bubble} = Gtk2::Notify->new_with_status_icon($info->{title}, $info->{message}, undef, $self->{statusicon}); + $self->{bubble}->set_icon_from_pixbuf($info->{pixbuf}); + # FIXME: replace clicked for IFW: + $self->{bubble}->signal_connect(clicked => sub { + $self->{bubble}->hide; + my $info = $self->{queue}[0]; + if ($info->{clicked}) { + #- has to call process_next when done + $info->{clicked}->(); + } else { + $self->process_next; + } + }); + $self->{bubble}->set_timeout($self->{display}); + Glib::Timeout->add($self->{delay}, sub { + my $info = $self->{queue}[0]; + $info->{timeout}->() if $info->{timeout}; + $self->process_next; + 0 }); + $self->{bubble}->show(); } 1; |