podcast_list_sections -> ui.gtk.podcast_list.sections

This commit is contained in:
auouymous 2022-12-08 15:52:23 -07:00
parent 8ca292e5a5
commit fe969e8c15
4 changed files with 7 additions and 8 deletions

View File

@ -228,7 +228,6 @@ defaults = {
# The sooner this goes away, the better
gPodderSettings_LegacySupport = {
'podcast_list_sections': 'ui.gtk.podcast_list.sections',
'episode_list_view_mode': 'ui.gtk.episode_list.view_mode',
'podcast_list_view_mode': 'ui.gtk.podcast_list.view_mode',
'podcast_list_hide_boring': 'ui.gtk.podcast_list.hide_empty',

View File

@ -231,7 +231,7 @@ class gPodderPreferences(BuilderWidget):
self._config.connect_gtk_togglebutton('ui.gtk.podcast_list.all_episodes',
self.checkbutton_show_all_episodes)
self._config.connect_gtk_togglebutton('podcast_list_sections',
self._config.connect_gtk_togglebutton('ui.gtk.podcast_list.sections',
self.checkbutton_podcast_sections)
self._config.connect_gtk_togglebutton('ui.gtk.find_as_you_type',
self.checkbutton_find_as_you_type)

View File

@ -2440,7 +2440,7 @@ class gPodder(BuilderWidget, dbus.service.Object):
else:
list_model_length = len(self.podcast_list_model)
force_update = (sections_active != self.config.podcast_list_sections
force_update = (sections_active != self.config.ui.gtk.podcast_list.sections
or sections_changed)
# Filter items in the list model that are not podcasts, so we get the
@ -2464,7 +2464,7 @@ class gPodder(BuilderWidget, dbus.service.Object):
# Otherwise just update the selected row (a podcast)
self.podcast_list_model.update_by_filter_iter(iter)
if self.config.podcast_list_sections:
if self.config.ui.gtk.podcast_list.sections:
self.podcast_list_model.update_sections()
elif list_model_length == len(self.channels) and not force_update:
# we can keep the model, but have to update some
@ -2474,7 +2474,7 @@ class gPodder(BuilderWidget, dbus.service.Object):
else:
# ok, we got a bunch of urls to update
self.podcast_list_model.update_by_urls(urls)
if self.config.podcast_list_sections:
if self.config.ui.gtk.podcast_list.sections:
self.podcast_list_model.update_sections()
else:
if model and iter and select_url is None:

View File

@ -844,7 +844,7 @@ class PodcastListModel(Gtk.ListStore):
self.update_by_iter(iter)
# Separator item
if not config.podcast_list_sections:
if not config.ui.gtk.podcast_list.sections:
self.append(('', '', '', None, SeparatorMarker, None, '',
True, True, True, True, True, True, 0, False, ''))
@ -854,13 +854,13 @@ class PodcastListModel(Gtk.ListStore):
def key_func(channel):
return (channel.group_by, model.Model.podcast_sort_key(channel))
if config.podcast_list_sections:
if config.ui.gtk.podcast_list.sections:
groups = groupby(sorted(channels, key=key_func), groupby_func)
else:
groups = [(None, sorted(channels, key=model.Model.podcast_sort_key))]
for section, section_channels in groups:
if config.podcast_list_sections and section is not None:
if config.ui.gtk.podcast_list.sections and section is not None:
section_channels = list(section_channels)
section_obj = PodcastChannelProxy(db, config, section_channels, section, self)
iter = self.append(section_to_row(section_obj))