~ubuntu-branches/ubuntu/trusty/gmusicbrowser/trusty

« back to all changes in this revision

Viewing changes to plugins/notify.pm

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-12-03 20:10:44 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20111203201044-42q2zh0yeg1qbdhl
Tags: 1.1.8-1
* New upstream release.
* Bump Standards.
* Revert gmusicbrowser.man, take the correct file from upstream's
  tarball.
* The patch spelling-errors has been forwarded upstream.
* Refresh shimmer-layouts patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
use Gtk2::Notify -init, ::PROGRAM_NAME;
23
23
 
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);
25
25
 
26
26
my $notify;
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) );
75
76
        my $pixbuf;
76
77
        if ($size)
77
78
        {       my $album_gid= Songs::Get_gid($ID,'album');