# preferences_dialog.py # # Copyright 2025 Pavel Baksy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # SPDX-License-Identifier: GPL-3.0-or-later from gi.repository import Adw, Gtk, Gio @Gtk.Template(resource_path='/cz/vesp/roster/preferences-dialog.ui') class PreferencesDialog(Adw.PreferencesWindow): __gtype_name__ = 'PreferencesDialog' tls_verification_row = Gtk.Template.Child() timeout_row = Gtk.Template.Child() def __init__(self, **kwargs): super().__init__(**kwargs) # Get settings self.settings = Gio.Settings.new('cz.vesp.roster') # Bind settings to UI self.settings.bind( 'force-tls-verification', self.tls_verification_row, 'active', Gio.SettingsBindFlags.DEFAULT ) self.settings.bind( 'request-timeout', self.timeout_row, 'value', Gio.SettingsBindFlags.DEFAULT )