diff --git a/Build.PL b/Build.PL index 8a74b4711..976e8fa6e 100644 --- a/Build.PL +++ b/Build.PL @@ -23,9 +23,9 @@ my $build = Module::Build->new( 'Test::More' => '0.10', }, recommends => { - 'Growl::GNTP' => '0.15', - 'Gtk2::Notify' => '0.05', - 'Wx' => '0.9901', + 'Growl::GNTP' => '0.15', + 'Net::DBus' => '0', + 'Wx' => '0.9901', }, script_files => ['slic3r.pl'], ); diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 272f04740..df011e910 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -334,13 +334,6 @@ sub new { $self->{growler}->register([{Name => 'SKEIN_DONE', DisplayName => 'Slicing Done'}]); }; } - if (eval 'use Gtk2::Notify; 1') { - # register with libnotify - eval { - Gtk2::Notify->init('Slic3r'); - $self->{libnotify} = 1; - } - } bless $self, $class; @@ -355,8 +348,14 @@ sub notify { $self->{growler}->notify(Event => 'SKEIN_DONE', Title => $title, Message => $message) if $self->{growler}; }; - eval { - Gtk2::Notify->new($title, $message, $self->{icon})->show if $self->{libnotify}; + if (eval 'use Net::DBus; 1') { + eval { + my $session = Net::DBus->session; + my $serv = $session->get_service('org.freedesktop.Notifications'); + my $notifier = $serv->get_object('/org/freedesktop/Notifications', + 'org.freedesktop.Notifications'); + $notifier->Notify('Slic3r', 0, $self->{icon}, $title, $message, [], {}, 5); + } }; }