Skip to content

Commit

Permalink
Rename 'tracking_recent_activities_items' to 'count'
Browse files Browse the repository at this point in the history
  • Loading branch information
elbenfreund committed Sep 27, 2017
1 parent 95fc765 commit 82fad51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions hamster_gtk/hamster_gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def _get_default_config(self):
'autocomplete_activities_range': 30,
'autocomplete_split_activity': False,
'tracking_show_recent_activities': True,
'tracking_recent_activities_items': 6,
'tracking_recent_activities_count': 6,
}

def _config_to_configparser(self, config):
Expand Down Expand Up @@ -326,8 +326,8 @@ def get_autocomplete_split_activity():
def get_tracking_show_recent_activities():
return text_type(config['tracking_show_recent_activities'])

def get_tracking_recent_activities_items():
return text_type(config['tracking_recent_activities_items'])
def get_tracking_recent_activities_count():
return text_type(config['tracking_recent_activities_count'])

cp_instance = SafeConfigParser()
cp_instance.add_section('Backend')
Expand All @@ -345,8 +345,8 @@ def get_tracking_recent_activities_items():
get_autocomplete_split_activity())
cp_instance.set('Frontend', 'tracking_show_recent_activities',
get_tracking_show_recent_activities())
cp_instance.set('Frontend', 'tracking_recent_activities_items',
get_tracking_recent_activities_items())
cp_instance.set('Frontend', 'tracking_recent_activities_count',
get_tracking_recent_activities_count())

return cp_instance

Expand Down Expand Up @@ -406,8 +406,8 @@ def get_autocomplete_split_activity():
def get_tracking_show_recent_activities():
return cp_instance.getboolean('Frontend', 'tracking_show_recent_activities')

def get_tracking_recent_activities_items():
return int(cp_instance.get('Frontend', 'tracking_recent_activities_items'))
def get_tracking_recent_activities_count():
return int(cp_instance.get('Frontend', 'tracking_recent_activities_count'))

result = {
'store': get_store(),
Expand All @@ -416,8 +416,8 @@ def get_tracking_recent_activities_items():
'tmpfile_path': get_tmpfile_path(),
'autocomplete_activities_range': get_autocomplete_activities_range(),
'autocomplete_split_activity': get_autocomplete_split_activity(),
'tracking_show_recent_activities': get_tracking_recent_activities_items(),
'tracking_recent_activities_items': get_tracking_recent_activities_items(),
'tracking_show_recent_activities': get_tracking_show_recent_activities(),
'tracking_recent_activities_count': get_tracking_recent_activities_count(),
}
result.update(get_db_config())
return result
Expand Down
2 changes: 1 addition & 1 deletion hamster_gtk/preferences/preferences_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, parent, app, initial, *args, **kwargs):
('tracking_show_recent_activities',
(_("Show recent activities for quickly starting tracking."),
HamsterSwitch())),
('tracking_recent_activities_items', (_('How many recent activities?'),
('tracking_recent_activities_count', (_('How many recent activities?'),
HamsterSpinButton(SimpleAdjustment(0, GObject.G_MAXDOUBLE, 1)))),
]))),
]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ def config(request, tmpdir):
'autocomplete_activities_range': 30,
'autocomplete_split_activity': False,
'tracking_show_recent_activities': True,
'tracking_recent_activities_items': 6,
'tracking_recent_activities_count': 6,
}
return config

0 comments on commit 82fad51

Please sign in to comment.