[Linux] calling notification center on new mention

This commit is contained in:
Jeena 2012-12-30 05:41:53 +01:00
parent ba2c8321dd
commit 65883892f9
3 changed files with 13 additions and 4 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ dsa_priv.pem
Mac/.DS_Store
build
.DS_Store
*~

View file

@ -111,8 +111,14 @@ class Controller(QtCore.QObject):
self.app.mentions.evaluateJavaScript("tentia_instance.unread_mentions = 0;")
@QtCore.pyqtSlot(str, str, str, str)
def notificateUserAboutMention(self, text, name, post_id, entity):
print "notificateUserAboutMention is not implemented yet"
def notificateUserAboutMentionFromNameWithPostIdAndEntity(self, text, name, post_id, entity):
try:
subprocess.check_output(['kdialog', '--passivepopup', name + ' mentioned you: ' + text])
except OSError:
try:
subprocess.check_output(['notify-send', '-i', 'dialog-information', name + 'mentioned you on Tent', text])
except OSError:
pass
@QtCore.pyqtSlot(str)
def openNewMessageWidow(self, string):

View file

@ -107,6 +107,8 @@ define(function() {
HostApp.notificateUserAboutMention = function(text, name, post_id, entity) {
if (OS_TYPE == "mac") {
controller.notificateUserAboutMention_fromName_withPostId_andEntity_(text, name, post_id, entity);
} else {
controller.notificateUserAboutMentionFromNameWithPostIdAndEntity(text, name, post_id, entity);
}
}