notify

2 views
Skip to first unread message

amoblin

unread,
Apr 22, 2009, 3:52:44 AM4/22/09
to gmbox-dev
实现播放状态通知

先引进包
import pynotify
在MainWindow的函数setupSystray中加入:
pynotify.init("Some Application or Title")
self.notification = pynotify.Notification("Title", "body",
"dialog-warning")
self.notification.set_urgency(pynotify.URGENCY_NORMAL)
self.notification.set_timeout(1)
在downone下增加:
self.notification = pynotify.Notification("下载",
self._songlist.get_title(self.path[0]), "dialog-warning")
self.notification.set_timeout(1)
self.notification.show()
同样的listen下也增加:
self.notification = pynotify.Notification("试听",
self._songlist.get_title(self.path[0]), "dialog-warning")
self.notification.set_timeout(1)
self.notification.show()
那么要在gmbox.py里增加两个函数

def get_title(self,i=0):
song=self.songlist[i]
return song['title']

def get_artist(self,i=0):
song=self.songlist[i]
return song['artist']
未来想这样:自动循环播放,切歌时显示歌曲信息。

lerosua

unread,
Apr 22, 2009, 4:07:38 AM4/22/09
to gmbo...@googlegroups.com
amoblin:
要不你打包一下,我帮你提交上去?

2009/4/22 amoblin <amo...@gmail.com>:

--
Only a nation of educated people could remain free. (Thomas Jefferson,
American president)

崔贵林

unread,
Apr 22, 2009, 4:17:20 AM4/22/09
to gmbo...@googlegroups.com
lerosua:
    给你,谢谢!
    我现在想实现的功能是:右键page 4播放列表里依page1做一个,但MVC我不太熟,一直未成功。。。
   MainWindow里page 1中在右键菜单里增加了“添加到播放列表”选项,这是刚完成的。
--
崔贵林 csip
E-mail:  amo...@gmail.com
MSN :  amo...@msn.cn
  Cell  :  13260179436
gmbox.py
MainWindow.py

lerosua

unread,
Apr 22, 2009, 4:28:52 AM4/22/09
to gmbo...@googlegroups.com
帮你提交了。

对了,因为窗口里有几个分页,因此第一个分页里的一些变量要相应改一下名。

2009/4/22 崔贵林 <amo...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages