Skip to content

Commit

Permalink
preferences: Add view option checkbuttons to 'General' tab
Browse files Browse the repository at this point in the history
  • Loading branch information
tpikonen committed Jun 18, 2024
1 parent e0cebb8 commit 5c12f84
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
112 changes: 112 additions & 0 deletions share/gpodder/ui/gtk/gpodderpreferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,118 @@
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_podcast_list_hide_empty">
<property name="label" translatable="yes">Hide podcasts without episodes</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_podcast_list_all_episodes">
<property name="label" translatable="yes">"All episodes" in podcast list</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_podcast_list_sections">
<property name="label" translatable="yes">Use sections for podcast list</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">8</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_episode_list_always_show_new">
<property name="label" translatable="yes">Always show New Episodes</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">9</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_episode_list_trim_title_prefix">
<property name="label" translatable="yes">Trim episode title prefix</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">10</property>
</packing>
</child>
<child>
<!-- Also in 'menuView' submenu in menu bar -->
<object class="GtkCheckButton" id="checkbutton_episode_list_descriptions">
<property name="label" translatable="yes">Episode descriptions</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">11</property>
</packing>
</child>
</object>
<packing>
<property name="name">general</property>
Expand Down
6 changes: 6 additions & 0 deletions share/gpodder/ui/gtk/menus.ui
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,17 @@
</section>
<section>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewHideBoringPodcasts</attribute>
<attribute name="label" translatable="yes">Hide podcasts without episodes</attribute>
</item>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewShowAllEpisodes</attribute>
<attribute name="label" translatable="yes">"All episodes" in podcast list</attribute>
</item>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewShowPodcastSections</attribute>
<attribute name="label" translatable="yes">Use sections for podcast list</attribute>
</item>
Expand Down Expand Up @@ -229,14 +232,17 @@
</section>
<section>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewAlwaysShowNewEpisodes</attribute>
<attribute name="label" translatable="yes">Always show New Episodes</attribute>
</item>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewTrimEpisodeTitlePrefix</attribute>
<attribute name="label" translatable="yes">Trim episode title prefix</attribute>
</item>
<item>
<!-- Also in 'vbox_general' page in preferences -->
<attribute name="action">win.viewShowEpisodeDescription</attribute>
<attribute name="label" translatable="yes">Episode descriptions</attribute>
<attribute name="accel">&lt;Primary&gt;d</attribute>
Expand Down
14 changes: 14 additions & 0 deletions src/gpodder/gtkui/desktop/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,20 @@ def new(self):
self._config.connect_gtk_togglebutton('ui.gtk.find_as_you_type',
self.checkbutton_find_as_you_type)

self._config.connect_gtk_togglebutton('ui.gtk.podcast_list.hide_empty',
self.checkbutton_podcast_list_hide_empty)
self._config.connect_gtk_togglebutton('ui.gtk.podcast_list.all_episodes',
self.checkbutton_podcast_list_all_episodes)
self._config.connect_gtk_togglebutton('ui.gtk.podcast_list.sections',
self.checkbutton_podcast_list_sections)

self._config.connect_gtk_togglebutton('ui.gtk.episode_list.always_show_new',
self.checkbutton_episode_list_always_show_new)
self._config.connect_gtk_togglebutton('ui.gtk.episode_list.trim_title_prefix',
self.checkbutton_episode_list_trim_title_prefix)
self._config.connect_gtk_togglebutton('ui.gtk.episode_list.descriptions',
self.checkbutton_episode_list_descriptions)

self.update_interval_presets = [0, 10, 30, 60, 2 * 60, 6 * 60, 12 * 60]
adjustment_update_interval = self.hscale_update_interval.get_adjustment()
adjustment_update_interval.set_upper(len(self.update_interval_presets) - 1)
Expand Down

0 comments on commit 5c12f84

Please sign in to comment.