{"action":"created","issue":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/596","labels_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/596/labels{/name}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/596/comments","events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/596/events","html_url":"https://github.com/The-Compiler/qutebrowser/pull/596","id":65860263,"number":596,"title":"Add TabIndex label to the statusbar.","user":{"login":"ff2000","id":1973708,"avatar_url":"https://avatars.githubusercontent.com/u/1973708?v=3","gravatar_id":"","url":"https://api.github.com/users/ff2000","html_url":"https://github.com/ff2000","followers_url":"https://api.github.com/users/ff2000/followers","following_url":"https://api.github.com/users/ff2000/following{/other_user}","gists_url":"https://api.github.com/users/ff2000/gists{/gist_id}","starred_url":"https://api.github.com/users/ff2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ff2000/subscriptions","organizations_url":"https://api.github.com/users/ff2000/orgs","repos_url":"https://api.github.com/users/ff2000/repos","events_url":"https://api.github.com/users/ff2000/events{/privacy}","received_events_url":"https://api.github.com/users/ff2000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-02T07:07:43Z","updated_at":"2015-04-02T07:57:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/596","html_url":"https://github.com/The-Compiler/qutebrowser/pull/596","diff_url":"https://github.com/The-Compiler/qutebrowser/pull/596.diff","patch_url":"https://github.com/The-Compiler/qutebrowser/pull/596.patch"},"body":"It shows the current tab index and the number of tabs of the window it\r\nsits in."},"comment":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/comments/88807256","html_url":"https://github.com/The-Compiler/qutebrowser/pull/596#issuecomment-88807256","issue_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/596","id":88807256,"user":{"login":"ff2000","id":1973708,"avatar_url":"https://avatars.githubusercontent.com/u/1973708?v=3","gravatar_id":"","url":"https://api.github.com/users/ff2000","html_url":"https://github.com/ff2000","followers_url":"https://api.github.com/users/ff2000/followers","following_url":"https://api.github.com/users/ff2000/following{/other_user}","gists_url":"https://api.github.com/users/ff2000/gists{/gist_id}","starred_url":"https://api.github.com/users/ff2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ff2000/subscriptions","organizations_url":"https://api.github.com/users/ff2000/orgs","repos_url":"https://api.github.com/users/ff2000/repos","events_url":"https://api.github.com/users/ff2000/events{/privacy}","received_events_url":"https://api.github.com/users/ff2000/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T07:57:46Z","updated_at":"2015-04-02T07:57:46Z","body":"Florian Bruhin wrote:\n> Thanks a lot for your contribution!\n> \n> I think it'd be better to not access the tabwidget from `mainwindow/statusbar/tabindex.py` however, so it's more self-contained. What about this?\n> \n> * Add a new `tab_index_changed = pyqtSignal(int, int)` to `TabWidget` in `qutebrowser/mainwindow/tabwidget.py`\n> * Connect `QTabWidget::currentChanged` to a new slot in `TabWidget`, where you emit the `tab_index_changed` signal with `idx + 1` and `self.count()` as arguments.\n> * Then connect that new signal to your `on_tab_changed` and use the values you get there.\nThat actually was my first thought, too. Decoupling types usually is the better approach.\nI decided against it because TabIndex would have been the only consumer of the signal. But I don't have any strong argument against it, so I will go and implement it that way.\n\n> \n> I'll also leave some inline comments with some minor nitpicks.\n> \n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/The-Compiler/qutebrowser/pull/596#issuecomment-88788041\n\n\n"}}