added open profile to Linux

This commit is contained in:
jeena 2013-02-26 02:09:21 +01:00
parent 3238b06c27
commit 43124c4c97
2 changed files with 35 additions and 0 deletions

View file

@ -45,6 +45,7 @@ class Bungloo:
self.timeline.show() self.timeline.show()
self.conversation = Windows.Timeline(self, "conversation", "Conversation") self.conversation = Windows.Timeline(self, "conversation", "Conversation")
self.profile = Windows.Timeline(self, "profile", "Profile") self.profile = Windows.Timeline(self, "profile", "Profile")
self.find_entity = Windows.FindEntity(self)
def timeline_show(self): def timeline_show(self):
self.timeline.show() self.timeline.show()
@ -53,6 +54,9 @@ class Bungloo:
self.controller.unreadMentions(0) self.controller.unreadMentions(0)
self.mentions.show() self.mentions.show()
def find_entity_show(self):
self.find_entity.show()
class Controller(QtCore.QObject): class Controller(QtCore.QObject):

View file

@ -124,6 +124,11 @@ class Timeline:
mentionsAction.setStatusTip("Show Mentions") mentionsAction.setStatusTip("Show Mentions")
mentionsAction.triggered.connect(self.app.mentions_show) mentionsAction.triggered.connect(self.app.mentions_show)
findEntityAction = QtGui.QAction("&Entity", self.window)
findEntityAction.setShortcut("Ctrl+u")
findEntityAction.setStatusTip("Find Entity")
findEntityAction.triggered.connect(self.app.find_entity_show)
hideAction = QtGui.QAction("&Hide window", self.window) hideAction = QtGui.QAction("&Hide window", self.window)
hideAction.setShortcut("Ctrl+W") hideAction.setShortcut("Ctrl+W")
hideAction.setStatusTip("Hide this window") hideAction.setStatusTip("Hide this window")
@ -133,6 +138,7 @@ class Timeline:
windowMenu.addAction(timelineAction) windowMenu.addAction(timelineAction)
windowMenu.addAction(mentionsAction) windowMenu.addAction(mentionsAction)
windowMenu.addAction(hideAction) windowMenu.addAction(hideAction)
windowMenu.addAction(findEntityAction)
def show(self): def show(self):
self.window.show() self.window.show()
@ -231,6 +237,31 @@ class Login(QtGui.QDialog):
#self.buttonLogin.clicked.connect(callback) #self.buttonLogin.clicked.connect(callback)
#self.label.setText("The server " + url.host() + " requires a username and password.") #self.label.setText("The server " + url.host() + " requires a username and password.")
class FindEntity(QtGui.QDialog):
def __init__(self, app):
QtGui.QDialog.__init__(self)
self.app = app
self.setWindowTitle("Open Profile ...")
self.label = QtGui.QLabel(self)
self.label.setText("Open the profile of the entity:")
self.textEntity = QtGui.QLineEdit(self)
self.button = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
self.button.accepted.connect(self.openProfile)
layout = QtGui.QVBoxLayout(self)
layout.addWidget(self.label)
layout.addWidget(self.textEntity)
layout.addWidget(self.button)
def openProfile(self):
self.app.controller.showProfileForEntity(self.textEntity.text())
self.hide()
class NewPost(Helper.RestorableWindow): class NewPost(Helper.RestorableWindow):
def __init__(self, app): def __init__(self, app):
self.app = app self.app = app