22
22
use Gtk2::Notify -init, ::PROGRAM_NAME;
24
::SetDefaultOptions(OPT, title => "%t", text => _"<i>by</i> %a\\n<i>from</i> %l", picsize => 50, timeout=>5);
24
::SetDefaultOptions(OPT, title => "%S", text => _"<i>by</i> %a\\n<i>from</i> %l", picsize => 50, timeout=>5);
27
27
my ($Daemon_name,$can_actions,$can_body);
48
48
{ my $vbox=Gtk2::VBox->new(::FALSE, 2);
49
49
my $sg1=Gtk2::SizeGroup->new('horizontal');
50
50
my $sg2=Gtk2::SizeGroup->new('horizontal');
51
my $replacetext=::MakeReplaceText('talydngLf');
51
my $replacetext=::MakeReplaceText('talydngLfS');
52
52
my $summary=::NewPrefEntry(OPT.'title',_"Summary :", sizeg1=> $sg1, sizeg2=>$sg2, tip => $replacetext);
53
53
my $body= ::NewPrefEntry(OPT.'text', _"Body :", sizeg1=> $sg1, sizeg2=>$sg2, width=>40, tip => $replacetext."\n\n"._("You can use some markup, eg :\n<b>bold</b> <i>italic</i> <u>underline</u>\nNote that the markup may be ignored by the notification daemon"),);
54
my $size= ::NewPrefSpinButton(OPT.'picsize', 0,1000, step=>10, page=>40, text1=>_"Picture size :", sizeg1=>$sg1, tip=> _"Note that some notification daemons resize the displayed picture");
55
my $timeout=::NewPrefSpinButton(OPT.'timeout', 0,9999, step=>2, page=>5, text1=>_"Timeout :", sizeg1=>$sg1, text2=>_"seconds", digits=>1);
54
my $size= ::NewPrefSpinButton(OPT.'picsize', 0,1000, step=>10, page=>40, text=>_"Picture size : %d", sizeg1=>$sg1, tip=> _"Note that some notification daemons resize the displayed picture");
55
my $timeout=::NewPrefSpinButton(OPT.'timeout', 0,9999, step=>2, page=>5, text=>_"Timeout : %d seconds", sizeg1=>$sg1, digits=>1);
56
56
my $actions=::NewPrefCheckButton(OPT.'actions',_"Display stop/next actions", cb=>\&set_actions);
57
57
$actions->set_sensitive($can_actions);
58
58
$actions->set_tooltip_text(_("Actions are not supported by current notification daemon").' : '.$Daemon_name) unless $can_actions;
71
71
my $size= $::Options{OPT.'picsize'};
72
72
my $timeout=$::Options{OPT.'timeout'}*1000;
73
73
return unless $title || $text || $size;
74
$notify->update( ::ReplaceFields($ID,$title), ::ReplaceFieldsAndEsc($ID,$text));
74
$title= ::ReplaceFields($ID,$title) || " "; #libnotify do not like null summaries
75
$notify->update($title, ::ReplaceFieldsAndEsc($ID,$text) );
77
78
{ my $album_gid= Songs::Get_gid($ID,'album');