diff --git a/Linux/Bungloo.py b/Linux/Bungloo.py index 587d223..43a9920 100755 --- a/Linux/Bungloo.py +++ b/Linux/Bungloo.py @@ -45,6 +45,7 @@ class Bungloo: self.timeline.show() self.conversation = Windows.Timeline(self, "conversation", "Conversation") self.profile = Windows.Timeline(self, "profile", "Profile") + self.find_entity = Windows.FindEntity(self) def timeline_show(self): self.timeline.show() @@ -53,6 +54,9 @@ class Bungloo: self.controller.unreadMentions(0) self.mentions.show() + def find_entity_show(self): + self.find_entity.show() + class Controller(QtCore.QObject): diff --git a/Linux/Windows.py b/Linux/Windows.py index 338416b..c4442bb 100644 --- a/Linux/Windows.py +++ b/Linux/Windows.py @@ -124,6 +124,11 @@ class Timeline: mentionsAction.setStatusTip("Show Mentions") 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.setShortcut("Ctrl+W") hideAction.setStatusTip("Hide this window") @@ -133,6 +138,7 @@ class Timeline: windowMenu.addAction(timelineAction) windowMenu.addAction(mentionsAction) windowMenu.addAction(hideAction) + windowMenu.addAction(findEntityAction) def show(self): self.window.show() @@ -231,6 +237,31 @@ class Login(QtGui.QDialog): #self.buttonLogin.clicked.connect(callback) #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): def __init__(self, app): self.app = app