added next view shortcut to linux

This commit is contained in:
jeena 2013-04-09 22:48:21 +02:00
parent cf4e3386e7
commit 3cda481255
4 changed files with 35 additions and 2 deletions

View file

@ -89,7 +89,10 @@ class Bungloo:
self.oauth_implementation.log_out() self.oauth_implementation.log_out()
self.timeline.hide() self.timeline.hide()
self.preferences.show() self.preferences.show()
self.timeline.evaluateJavaScript("bungloo.sidebar.logout()") self.timeline.evaluateJavaScript("bungloo.sidebar.logout();")
def next_show(self):
self.timeline.evaluateJavaScript("bungloo.sidebar.showContentForNext();")
class Controller(QtCore.QObject): class Controller(QtCore.QObject):

View file

@ -154,12 +154,19 @@ class Timeline:
searchAction.setStatusTip("Show Search") searchAction.setStatusTip("Show Search")
searchAction.triggered.connect(self.app.search_show) searchAction.triggered.connect(self.app.search_show)
nextAction = QtGui.QAction("&Next", self.window)
nextAction.setShortcut("Ctrl+6")
nextAction.setStatusTip("Show Next")
nextAction.triggered.connect(self.app.next_show)
windowMenu = menubar.addMenu("&View") windowMenu = menubar.addMenu("&View")
windowMenu.addAction(timelineAction) windowMenu.addAction(timelineAction)
windowMenu.addAction(mentionsAction) windowMenu.addAction(mentionsAction)
windowMenu.addAction(conversationAction) windowMenu.addAction(conversationAction)
windowMenu.addAction(profileAction) windowMenu.addAction(profileAction)
windowMenu.addAction(searchAction) windowMenu.addAction(searchAction)
windowMenu.addSeparator()
windowMenu.addAction(nextAction)
aboutAction = QtGui.QAction("&About Bungloo", self.window) aboutAction = QtGui.QAction("&About Bungloo", self.window)
aboutAction.setStatusTip("Open about page in Webbrowser") aboutAction.setStatusTip("Open about page in Webbrowser")

View file

@ -169,6 +169,29 @@ function(HostApp, Paths, Cache) {
img.src = img.src_active; img.src = img.src_active;
} }
Sidebar.prototype.showContentForNext = function() {
var parts = [
"timeline",
"mentions",
"conversation",
"entityProfile",
"search"
];
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
var img = this.menu[part].getElementsByTagName("img")[0];
if (img.src.endsWith(img.src_active)) {
var next = parts[(i+1)%parts.length];
this.showContentFor(bungloo[next], this.menu[next]);
return;
}
}
}
Sidebar.prototype.setUnreadMentions = function(count) { Sidebar.prototype.setUnreadMentions = function(count) {
this.unreadMentionsSpan.innerHTML = count == 0 ? "" : count; this.unreadMentionsSpan.innerHTML = count == 0 ? "" : count;
if (count > 0) { if (count > 0) {

View file

@ -14,7 +14,7 @@ function(Core, Paths, HostApp, URI) {
this.action = "timeline"; this.action = "timeline";
this.reload_blocked = false; this.reload_blocked = false;
this.max_length = 200; this.max_length = 20;
this.timeout = 10 * 1000; // every 10 seconds this.timeout = 10 * 1000; // every 10 seconds
this.since_id = null; this.since_id = null;
this.since_id_entity = null; this.since_id_entity = null;