[Linux] calling notification center on new mention
This commit is contained in:
parent
ba2c8321dd
commit
65883892f9
3 changed files with 13 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ dsa_priv.pem
|
||||||
Mac/.DS_Store
|
Mac/.DS_Store
|
||||||
build
|
build
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*~
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Tentia:
|
||||||
self.preferences = Windows.Preferences(self)
|
self.preferences = Windows.Preferences(self)
|
||||||
self.preferences.show()
|
self.preferences.show()
|
||||||
|
|
||||||
self.oauth_implementation = Windows.Oauth(self)
|
self.oauth_implementation = Windows.Oauth(self)
|
||||||
|
|
||||||
if self.controller.stringForKey("user_access_token") != "":
|
if self.controller.stringForKey("user_access_token") != "":
|
||||||
self.authentification_succeded()
|
self.authentification_succeded()
|
||||||
|
@ -111,8 +111,14 @@ class Controller(QtCore.QObject):
|
||||||
self.app.mentions.evaluateJavaScript("tentia_instance.unread_mentions = 0;")
|
self.app.mentions.evaluateJavaScript("tentia_instance.unread_mentions = 0;")
|
||||||
|
|
||||||
@QtCore.pyqtSlot(str, str, str, str)
|
@QtCore.pyqtSlot(str, str, str, str)
|
||||||
def notificateUserAboutMention(self, text, name, post_id, entity):
|
def notificateUserAboutMentionFromNameWithPostIdAndEntity(self, text, name, post_id, entity):
|
||||||
print "notificateUserAboutMention is not implemented yet"
|
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)
|
@QtCore.pyqtSlot(str)
|
||||||
def openNewMessageWidow(self, string):
|
def openNewMessageWidow(self, string):
|
||||||
|
|
|
@ -107,7 +107,9 @@ define(function() {
|
||||||
HostApp.notificateUserAboutMention = function(text, name, post_id, entity) {
|
HostApp.notificateUserAboutMention = function(text, name, post_id, entity) {
|
||||||
if (OS_TYPE == "mac") {
|
if (OS_TYPE == "mac") {
|
||||||
controller.notificateUserAboutMention_fromName_withPostId_andEntity_(text, name, post_id, entity);
|
controller.notificateUserAboutMention_fromName_withPostId_andEntity_(text, name, post_id, entity);
|
||||||
}
|
} else {
|
||||||
|
controller.notificateUserAboutMentionFromNameWithPostIdAndEntity(text, name, post_id, entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HostApp.alertTitleWithMessage = function(title, message) {
|
HostApp.alertTitleWithMessage = function(title, message) {
|
||||||
|
|
Reference in a new issue