Ejemplo n.º 1
0
    def _on_filter_options(self, *args):
        if self.filter_dialog:
            self.filter_dialog.present()
            return
        options = [
            Setting(SettingKind.SWITCH, 'Presence',
                    SettingType.VALUE, self.presence,
                    callback=self._on_option, data='presence'),

            Setting(SettingKind.SWITCH, 'Message',
                    SettingType.VALUE, self.message,
                    callback=self._on_option, data='message'),

            Setting(SettingKind.SWITCH, 'IQ', SettingType.VALUE, self.iq,
                    callback=self._on_option, data='iq'),

            Setting(SettingKind.SWITCH, 'Stream Management',
                    SettingType.VALUE, self.stream,
                    callback=self._on_option, data='stream'),

            Setting(SettingKind.SWITCH, 'In', SettingType.VALUE, self.incoming,
                    callback=self._on_option, data='incoming'),

            Setting(SettingKind.SWITCH, 'Out', SettingType.VALUE, self.outgoing,
                    callback=self._on_option, data='outgoing'),
        ]

        self.filter_dialog = SettingsDialog(self, 'Filter',
                                            Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                            options, self.account)
        self.filter_dialog.connect('destroy', self._on_filter_destroyed)
Ejemplo n.º 2
0
    def _on_filter_options(self, *args):
        if self.filter_dialog:
            self.filter_dialog.present()
            return

        combo_accounts = self._get_accounts()
        combo_accounts.insert(0, (None, _('All Accounts')))

        settings = [
            Setting(SettingKind.COMBO,
                    _('Account'),
                    SettingType.VALUE,
                    self.selected_account,
                    callback=self._set_account,
                    props={'combo_items': combo_accounts}),
            Setting(SettingKind.SWITCH,
                    'Presence',
                    SettingType.VALUE,
                    self.presence,
                    callback=self._on_setting,
                    data='presence'),
            Setting(SettingKind.SWITCH,
                    'Message',
                    SettingType.VALUE,
                    self.message,
                    callback=self._on_setting,
                    data='message'),
            Setting(SettingKind.SWITCH,
                    'IQ',
                    SettingType.VALUE,
                    self.iq,
                    callback=self._on_setting,
                    data='iq'),
            Setting(SettingKind.SWITCH,
                    'Stream Management',
                    SettingType.VALUE,
                    self.stream,
                    callback=self._on_setting,
                    data='stream'),
            Setting(SettingKind.SWITCH,
                    'In',
                    SettingType.VALUE,
                    self.incoming,
                    callback=self._on_setting,
                    data='incoming'),
            Setting(SettingKind.SWITCH,
                    'Out',
                    SettingType.VALUE,
                    self.outgoing,
                    callback=self._on_setting,
                    data='outgoing'),
        ]

        self.filter_dialog = SettingsDialog(
            self, _('Filter'), Gtk.DialogFlags.DESTROY_WITH_PARENT, settings,
            self.selected_account)
        self.filter_dialog.connect('destroy', self._on_filter_destroyed)