def clear_cache(self, button): first = 'Clear the cache?' second = ('All previously scraped articles will be lost when you refresh or exit, ' 'as well as any information regarding what articles you have read.') if utilityFunctions.decision_popup(self.parent, first, second): self.cache.clear()
def clear_cache(self, button: Gtk.Button) -> None: first = 'Clear the cache?' second = ( 'All previously scraped articles will be lost when you refresh or exit, ' 'as well as any information regarding what articles you have read.' ) if utilityFunctions.decision_popup(self.parent, first, second): self.cache.clear()
def confirm_and_reset_defaults(self, widget): if utilityFunctions.decision_popup(self.parent, 'Reset appearance to defaults?', 'Are you sure you want to reset your appearance preferences to default values?'): self.choices = Preferences.default_appearance_preferences() # Visual Effects # Set the view combo box to "Double" which is the second entry model = self.view_box.get_model() self.view_box.set_active_iter(model.iter_next(model.get_iter_first())) # Set the font buttons to display the default font values for fb, fi in zip(self.font_buttons, self.font_idents): fb.set_font_name(self.choices[fi]) fb.emit("font_set") # Set the color buttons to display the default color values for cb, ci in zip(self.color_buttons, self.color_idents): cb.set_rgba(utilityFunctions.string_to_RGBA(self.choices[ci]))
def confirm_and_reset_defaults(self, widget: Gtk.Widget) -> None: if utilityFunctions.decision_popup( self.parent, 'Reset appearance to defaults?', 'Are you sure you want to reset your appearance preferences to default values?' ): self.choices = Preferences.default_appearance_preferences() # Visual Effects # Set the view combo box to "Double" which is the second entry model = self.view_box.get_model() self.view_box.set_active_iter( model.iter_next(model.get_iter_first())) # Set the font buttons to display the default font values for fb, fi in zip(self.font_buttons, self.font_idents): fb.set_font_name(self.css_to_font_name(self.choices[fi])) # Set the color buttons to display the default color values for cb, ci in zip(self.color_buttons, self.color_idents): cb.set_rgba(utilityFunctions.string_to_RGBA(self.choices[ci]))
def warn(self, warning_list): warning_list.append('Add feed anyway?') decision = utilityFunctions.decision_popup(self, 'Warning!', '\n'.join(warning_list)) warning_list.clear() return decision