-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/status widget options #931
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please document the new configuration variables in the configuration section of docs/git-cola.rst
.
I'm thinking that maybe this option should instead be a "postive" value that defaults to false. Instead of statusremoveindentation
we could just call it statusindent
, status_indent
, STATUS_INDENT
, etc. It'll default to false so that it indents when true.
@@ -524,6 +526,9 @@ def _set_subtree(self, items, idx, | |||
parent.addChild(treeitem) | |||
self._expand_items(idx, items) | |||
self.blockSignals(False) | |||
if prefs.status_show_totals(self.context): | |||
parent_title = parent.text(0).split()[0] | |||
parent.setText(0, '%s (%s)' % (parent_title, len(items))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if this block of code runs more than once? It avoids problems by calling split()
to always take the first word only, but that seems a little too complicated.
All of the _set_subtree
callers "know" what the correct title should be, so it'd be better to just pass down an explicit title instead of getting it from the parent.text()
. We can still do the '%s (%s)'
thing here, but it'll at least separate the logic from being tied to details of what the message looks like.
For example, maybe the internationalized text will have more than one word, so it's better to make it generic.
…atus_widget_options * status_widget_options: prefs: reword descriptions for status indent and counts status: refactor headers totals doc: added new status options status: refactor option status: fixed code style status: refactor positive condition widget: Added indentation and total options Signed-off-by: David Aguilar <davvid@gmail.com>
Based on issue #902 added the option to leave/remove the indentation in status widget. Also added an option to show the number of files in each category.
The options can be found in Preferences/Settings