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)

View file

@ -76,10 +76,11 @@ class Preferences:
class Timeline:
def __init__(self, app, action="timeline", title="Bungloo"):
def __init__(self, app, action="timeline", title="Bungloo", custom_after_load=None):
self.app = app
self.action = action
self.title = title
self.custom_after_load = custom_after_load
self.window = Helper.RestorableWindow(action, self.app)
self.window.setWindowTitle(title)
@ -182,8 +183,7 @@ class Timeline:
def show(self):
self.window.show()
#self.window.raise_()
#QtGui.qApp.setActiveWindow(self.window)
def close(self):
self.window.close()
@ -192,6 +192,8 @@ class Timeline:
def load_finished(self, widget):
script = "function HostAppGo() { start('" + self.action + "'); }"
if self.custom_after_load:
script = self.custom_after_load
self.webView.page().mainFrame().evaluateJavaScript(script)
def set_window_title(self, title):