code: def on_history_size_value_changed(self, spin):
          
          val = int(spin.get_value())
          self.settings.general.set_int('history-size', val)
          self._update_history_widgets()
docs: Changes the value of history_size in dconf