mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 18:42:24 +00:00
Merge pull request #190 from henrikbrixandersen/master
Add Growl support
This commit is contained in:
@@ -68,6 +68,12 @@ sub new {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
$self->{panels} = \%panels;
|
$self->{panels} = \%panels;
|
||||||
|
|
||||||
|
if (eval "use Growl::GNTP; 1") {
|
||||||
|
# register growl notifications
|
||||||
|
$self->{growler} = Growl::GNTP->new(AppName => 'Slic3r'); #, AppIcon => "path/to/my/icon.gif");
|
||||||
|
$self->{growler}->register([{Name => 'SKEIN_DONE', DisplayName => 'Slicing Done'}]);
|
||||||
|
}
|
||||||
|
|
||||||
my $tabpanel = Wx::Notebook->new($self, -1, Wx::wxDefaultPosition, Wx::wxDefaultSize, &Wx::wxNB_TOP);
|
my $tabpanel = Wx::Notebook->new($self, -1, Wx::wxDefaultPosition, Wx::wxDefaultSize, &Wx::wxNB_TOP);
|
||||||
my $make_tab = sub {
|
my $make_tab = sub {
|
||||||
@@ -191,6 +197,8 @@ sub do_slice {
|
|||||||
my $message = sprintf "%s was successfully sliced in %d minutes and %.3f seconds.",
|
my $message = sprintf "%s was successfully sliced in %d minutes and %.3f seconds.",
|
||||||
$input_file_basename, int($skein->processing_time/60),
|
$input_file_basename, int($skein->processing_time/60),
|
||||||
$skein->processing_time - int($skein->processing_time/60)*60;
|
$skein->processing_time - int($skein->processing_time/60)*60;
|
||||||
|
$self->{growler}->notify(Event => 'SKEIN_DONE', Title => 'Slicing Done!', Message => $message)
|
||||||
|
if ($self->{growler});
|
||||||
Wx::MessageDialog->new($self, $message, 'Done!',
|
Wx::MessageDialog->new($self, $message, 'Done!',
|
||||||
wxOK | wxICON_INFORMATION)->ShowModal;
|
wxOK | wxICON_INFORMATION)->ShowModal;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user