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

Add regex name filter #619

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/config/variety.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ lightness_mode = 0
min_rating_enabled = False
min_rating = 4

# Use a name regex filter?
# name_regex_enabled = <True or False>
# name_regex = <regex>
name_regex_enabled = False
name_regex = *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the default regex should probably be .* instead of *, as * alone isn't a valid regex

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I updated the defaults to be a valid .*.
Thanks for spotting it.


# What parts of the initial wizard have we covered
smart_notice_shown = False
smart_register_shown = False
Expand Down
77 changes: 77 additions & 0 deletions data/ui/PreferencesVarietyDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3277,6 +3277,83 @@ To show the icon in the launcher choose About or Preferences. You may wish to lo
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label68">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">15</property>
<property name="margin_top">10</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="name_regex_enabled">
<property name="label" translatable="yes">Matches RegEx: </property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="margin_left">30</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="delayed_apply" swapped="no"/>
<signal name="toggled" handler="on_name_regex_enabled_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="name_regex">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">False</property>
<property name="invisible_char">•</property>
<property name="max_width_chars">50</property>
<signal name="changed" handler="delayed_apply" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<placeholder/>
</child>
Expand Down
Loading