emorrp1 / mintupload

Uploads files on the Internet
http://emorrp1.github.com/mintupload
6 stars 21 forks source link

Integrate with jaunty's notification system #16

Closed emorrp1 closed 15 years ago

emorrp1 commented 15 years ago

Perhaps provide an upload finished notification for large uploads.

kinkerl commented 15 years ago

this is possible with pynotify. it should be usable on all linux platforms. when should such a notification show up? only when uploading large files? or everytime, depending on a new mintUpload configuration?:

 import pynotify

 def callback_function(notification=None, action=None, data=None):
      print "It worked!"
 pynotify.init( "Some Application or Title" )
 n = pynotify.Notification("Title", "body", "dialog-warning")
 n.set_urgency(pynotify.URGENCY_NORMAL)
 n.set_timeout(pynotify.EXPIRES_NEVER)
 n.add_action("clicked","Button text", callback_function, None)
 n.show()
emorrp1 commented 15 years ago

I would say that it should definitely be possible to turn the notifications off, as some people really hate them. Also bear in mind that the jaunty notification system is just that, with no actions, which is ok just to say upload finished. Also not sure about the expires never part. As for when it shows, I'd go for a configurable minimum filesize, such that a setting of 0 would be every upload. There might also be other things we want to "notify" about, but I can't think of any at the moment.

emorrp1 commented 15 years ago

Oooh, one thought, can we implement it using a custom notification class please, like with the custom error class, in such a way that we just need to call something like Notify(message) to do it all. I suppose actually this could just be a notify(message) function rather than class, at least until we do something more useful.

kinkerl commented 15 years ago

i just copied the code from a tutorial to have some sort of reference to plan the actual implementation ;) your points are absolute correct.

maybe its time for some sort of review notification system? we have a progressbar, statusbar and noficications.... hm... maybe later

emorrp1 commented 15 years ago

I don't think it's too bad, the progressbar isn't really notification, everything should go to statusbar, and a few things past a certain "visibility threshold" would be real notifications.

kinkerl commented 15 years ago

notification added in http://github.com/kinkerl/mintupload/commit/f19f364f612f33678de56a0d68e5423792d7e8a6 http://github.com/kinkerl/mintupload/commit/cfa3c0499c501204cc1a838f5dd8cbb71a099c55

emorrp1 commented 15 years ago

just wondering if it would be better to just use notify-send, as that's what mintInstall uses?

kinkerl commented 15 years ago

i really dont know. what does notify-send do?

emorrp1 commented 15 years ago

try it (terminal): notify-send -i /usr/lib/linuxmint/mintSystem/icon.png "Heading" "Message"

emorrp1 commented 15 years ago

Fix Committed, grossly simplified, ready for release v3.6