Skip to content
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

Merged
merged 6 commits into from
Feb 27, 2019

Conversation

zisato
Copy link
Contributor

@zisato zisato commented Feb 25, 2019

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

Copy link
Member

@davvid davvid left a 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)))
Copy link
Member

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.

davvid added a commit to davvid/git-cola that referenced this pull request Feb 27, 2019
…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>
@davvid davvid merged commit f9b06d5 into git-cola:master Feb 27, 2019
@zisato zisato deleted the feature/status_widget_options branch March 2, 2019 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants