fixed problems with scroll to load more

This commit is contained in:
jeena 2013-04-14 13:36:53 +02:00
parent 624dd9a1b9
commit be8a0c63e3
10 changed files with 101 additions and 45 deletions

View file

@ -28,6 +28,7 @@ class Bungloo:
self.preferences.show()
self.oauth_implementation = Windows.Oauth(self)
self.conversation_views = []
if self.controller.stringForKey("user_access_token") != "":
self.authentification_succeded()
@ -160,10 +161,10 @@ class Controller(QtCore.QObject):
@QtCore.pyqtSlot(str, str, str, str)
def notificateUserAboutMentionFromNameWithPostIdAndEntity(self, text, name, post_id, entity):
try:
subprocess.check_output(['kdialog', '--passivepopup', name + ' mentioned you: ' + text])
subprocess.check_output(['kdialog', '--passivepopup', (name + ' mentioned you: ' + text).replace("\"", "\\\"")])
except OSError:
try:
subprocess.check_output(['notify-send', '-i', 'dialog-information', name + ' mentioned you on Tent', text])
subprocess.check_output(['notify-send', '-i', 'dialog-information', name.replace("\"", "\\\"") + ' mentioned you on Tent', text.replace("\"", "\\\"")])
except OSError:
pass
@ -221,6 +222,16 @@ class Controller(QtCore.QObject):
self.app.timeline.evaluateJavaScript(func)
self.app.timeline.show()
@QtCore.pyqtSlot(str, str)
def showConversationViewForPostIdandEntity(self, postId, entity):
custom_after_load = "function HostAppGo() { start('conversation-standalone', function() { bungloo.conversation.showStatus("
custom_after_load += "'{}', '{}'".format(postId, entity)
custom_after_load += "); }) }"
conversation = Windows.Timeline(self.app, "conversation", "Conversation", custom_after_load)
self.app.conversation_views += [conversation]
conversation.show()
@QtCore.pyqtSlot(str)
def showProfileForEntity(self, entity):
func = "bungloo.sidebar.onEntityProfile(); bungloo.entityProfile.showProfileForEntity('{}');".format(entity)