Mageia Bugzilla – Attachment 4652 Details for
Bug 12041
Bubble click callbacks are not fired
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
WIP but glib/gtk create threads behind our back and segfault
12041.diff (text/plain), 2.38 KB, created by
Thierry Vignaud
on 2013-12-21 01:16:53 CET
(
hide
)
Description:
WIP but glib/gtk create threads behind our back and segfault
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2013-12-21 01:16:53 CET
Size:
2.38 KB
patch
obsolete
>diff --git a/mgaapplet b/mgaapplet >index 43a2f86..1209a05 100755 >--- a/mgaapplet >+++ b/mgaapplet >@@ -269,6 +269,9 @@ sub gnome_shell_exit_overview() { > } > > sub is_there_a_new_distributions() { >+ warn ">> HERE\n" . backtrace(); >+ $new_distro= { version => 5 , arch=> 'x86_64', url => "test"}; >+ return 1; > # sanity check for cooker/cauldron: > return if $product_id->{branch} eq 'Devel'; > >@@ -796,25 +799,30 @@ sub setState { > my $bubble = Gtk3::Notify::Notification->new(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n", > '/usr/share/icons/mgaonline.png'); > if ($state eq 'new_distribution') { >- $bubble->add_action('clicked', N("More Information"), \&upgrade); >+ $bubble->add_action('upgrade', N("More Information2"), sub { upgrade(); Gtk3->main_quit }); >+ $bubble->signal_connect('closed' => \&Gtk3::main_quit); > if ($sub_state eq 'updates') { > push @arr, 'update'; > } > } elsif ($state eq 'no_more_supported') { >- $bubble->add_action('clicked', N("More Information"), \&no_more_supported); >+ $bubble->add_action('no_more', N("More Information"), sub { no_more_supported(); Gtk3->main_quit }); >+ $bubble->signal_connect('closed' => \&Gtk3::main_quit); > if ($sub_state eq 'updates') { > push @arr, 'update'; > } > } elsif ($state eq 'updates') { > unshift @arr, 'upgrade_distro' if $new_distro; >- $bubble->add_action('clicked', N("Install updates"), \&installUpdates); >+ $bubble->add_action('updates', N("Install updates"), sub { installUpdates(); Gtk3->main_quit }); >+ $bubble->signal_connect('closed' => \&Gtk3::main_quit); > } elsif (member($state, qw(no_enabled_medium no_update_medium))) { >- $bubble->add_action('clicked', N("Add media"), \&add_media); >+ $bubble->add_action('add_med', N("Add media"), sub { add_media(); Gtk3->main_quit }); >+ $bubble->signal_connect('closed' => \&Gtk3::main_quit); > } > > $bubble->set_urgency($state{$state}{urgency}) if $state{$state}{urgency}; > $bubble->set_timeout(5000); >- eval { $bubble->show }; >+ eval { $bubble->show; Gtk3->main }; >+ warn ">> ERR:$@" if $@; > } > > my $menu = Gtk3::Menu->new;
diff --git a/mgaapplet b/mgaapplet index 43a2f86..1209a05 100755 --- a/mgaapplet +++ b/mgaapplet @@ -269,6 +269,9 @@ sub gnome_shell_exit_overview() { } sub is_there_a_new_distributions() { + warn ">> HERE\n" . backtrace(); + $new_distro= { version => 5 , arch=> 'x86_64', url => "test"}; + return 1; # sanity check for cooker/cauldron: return if $product_id->{branch} eq 'Devel'; @@ -796,25 +799,30 @@ sub setState { my $bubble = Gtk3::Notify::Notification->new(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n", '/usr/share/icons/mgaonline.png'); if ($state eq 'new_distribution') { - $bubble->add_action('clicked', N("More Information"), \&upgrade); + $bubble->add_action('upgrade', N("More Information2"), sub { upgrade(); Gtk3->main_quit }); + $bubble->signal_connect('closed' => \&Gtk3::main_quit); if ($sub_state eq 'updates') { push @arr, 'update'; } } elsif ($state eq 'no_more_supported') { - $bubble->add_action('clicked', N("More Information"), \&no_more_supported); + $bubble->add_action('no_more', N("More Information"), sub { no_more_supported(); Gtk3->main_quit }); + $bubble->signal_connect('closed' => \&Gtk3::main_quit); if ($sub_state eq 'updates') { push @arr, 'update'; } } elsif ($state eq 'updates') { unshift @arr, 'upgrade_distro' if $new_distro; - $bubble->add_action('clicked', N("Install updates"), \&installUpdates); + $bubble->add_action('updates', N("Install updates"), sub { installUpdates(); Gtk3->main_quit }); + $bubble->signal_connect('closed' => \&Gtk3::main_quit); } elsif (member($state, qw(no_enabled_medium no_update_medium))) { - $bubble->add_action('clicked', N("Add media"), \&add_media); + $bubble->add_action('add_med', N("Add media"), sub { add_media(); Gtk3->main_quit }); + $bubble->signal_connect('closed' => \&Gtk3::main_quit); } $bubble->set_urgency($state{$state}{urgency}) if $state{$state}{urgency}; $bubble->set_timeout(5000); - eval { $bubble->show }; + eval { $bubble->show; Gtk3->main }; + warn ">> ERR:$@" if $@; } my $menu = Gtk3::Menu->new;
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12041
: 4652