pidgin/resources/Privacy/dialog.ui

Sun, 30 Oct 2022 03:29:33 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Sun, 30 Oct 2022 03:29:33 -0500
changeset 41864
6f490dec468f
parent 41854
c1d7e7445b0f
permissions
-rw-r--r--

Move PidginAccountChooser to GtkDropDown

The chooser connects to the default account manager automatically.
Additionally, re-parent the `GtkTreeModelFilter` subclasses to `GtkFilter`, and use them on the `filter` property.

This also means the previous `filter_func` that was moved to `GtkFilter` in /r/1995 are now used again.

Testing Done:
Opened most of the affected dialogs. Disabled XMPP account and saw that it was removed from all connected-only filtered choosers. Re-enabled account and it was back in the choosers.

Confirmed that only XMPP, and not Demo accounts appeared in the two XMPP-specific plugins.

Request API is still only compile-tested.

Reviewed at https://reviews.imfreedom.org/r/1992/

<?xml version="1.0" encoding="UTF-8"?>
<!--
Pidgin - Internet Messenger
Copyright (C) Pidgin Developers <devel@pidgin.im>

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 2
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 library; if not, see <https://www.gnu.org/licenses/>.
-->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="pidgin" version="3.0"/>
  <!-- interface-license-type gplv2 -->
  <!-- interface-name Pidgin -->
  <!-- interface-description Internet Messenger -->
  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
  <object class="GtkListStore" id="allow_store">
    <columns>
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkListStore" id="block_store">
    <columns>
      <column type="gchararray"/>
    </columns>
  </object>
  <template class="PidginPrivacyDialog" parent="GtkDialog">
    <property name="title" translatable="1">Privacy</property>
    <signal name="close" handler="gtk_window_destroy" swapped="no"/>
    <child internal-child="content_area">
      <object class="GtkBox">
        <property name="orientation">vertical</property>
        <property name="spacing">6</property>
        <property name="vexpand">1</property>
        <child>
          <object class="GtkLabel">
            <property name="valign">center</property>
            <property name="label" translatable="1">Changes to privacy settings take effect immediately.</property>
            <property name="xalign">0</property>
          </object>
        </child>
        <child>
          <object class="GtkBox">
            <property name="spacing">5</property>
            <child>
              <object class="GtkLabel" id="label1">
                <property name="halign">center</property>
                <property name="label" translatable="1">Set privacy for:</property>
                <property name="use-underline">1</property>
                <property name="mnemonic-widget">account_chooser</property>
              </object>
            </child>
            <child>
              <object class="PidginAccountChooser" id="account_chooser">
                <property name="hexpand">1</property>
                <property name="filter">
                  <object class="PidginAccountFilterConnected"/>
                </property>
                <signal name="notify::account" handler="select_account_cb" swapped="no"/>
                <accessibility>
                  <relation name="labelled-by">label1</relation>
                </accessibility>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkDropDown" id="type_menu">
            <property name="model">
              <object class="GtkStringList">
              </object>
            </property>
            <signal name="notify::selected" handler="type_changed_cb" object="PidginPrivacyDialog" swapped="no"/>
          </object>
        </child>
        <child>
          <object class="GtkScrolledWindow" id="allow_widget">
            <property name="vexpand">1</property>
            <property name="height-request">200</property>
            <property name="focusable">1</property>
            <property name="child">
              <object class="GtkTreeView" id="allow_list">
                <property name="focusable">1</property>
                <property name="model">allow_store</property>
                <property name="headers-visible">0</property>
                <property name="search-column">0</property>
                <child internal-child="selection">
                  <object class="GtkTreeSelection">
                    <signal name="changed" handler="user_selected_cb" object="PidginPrivacyDialog" swapped="no"/>
                  </object>
                </child>
                <child>
                  <object class="GtkTreeViewColumn">
                    <property name="clickable">1</property>
                    <property name="sort-column-id">0</property>
                    <child>
                      <object class="GtkCellRendererText"/>
                      <attributes>
                        <attribute name="text">0</attribute>
                      </attributes>
                    </child>
                  </object>
                </child>
              </object>
            </property>
          </object>
        </child>
        <child>
          <object class="GtkScrolledWindow" id="block_widget">
            <property name="vexpand">1</property>
            <property name="height-request">200</property>
            <property name="focusable">1</property>
            <property name="child">
              <object class="GtkTreeView" id="block_list">
                <property name="focusable">1</property>
                <property name="model">block_store</property>
                <property name="headers-visible">0</property>
                <child internal-child="selection">
                  <object class="GtkTreeSelection">
                    <signal name="changed" handler="user_selected_cb" object="PidginPrivacyDialog" swapped="no"/>
                  </object>
                </child>
                <child>
                  <object class="GtkTreeViewColumn">
                    <property name="clickable">1</property>
                    <property name="sort-column-id">0</property>
                    <child>
                      <object class="GtkCellRendererText"/>
                      <attributes>
                        <attribute name="text">0</attribute>
                      </attributes>
                    </child>
                  </object>
                </child>
              </object>
            </property>
          </object>
        </child>
      </object>
    </child>
    <child type="action">
      <object class="GtkButton" id="add_button">
        <property name="label">_Add</property>
        <property name="focusable">1</property>
        <property name="receives-default">1</property>
        <property name="use-underline">1</property>
        <signal name="clicked" handler="add_cb" object="PidginPrivacyDialog" swapped="no"/>
      </object>
    </child>
    <child type="action">
      <object class="GtkButton" id="remove_button">
        <property name="label">_Remove</property>
        <property name="sensitive">0</property>
        <property name="focusable">1</property>
        <property name="receives-default">1</property>
        <property name="use-underline">1</property>
        <signal name="clicked" handler="remove_cb" object="PidginPrivacyDialog" swapped="no"/>
      </object>
    </child>
    <child type="action">
      <object class="GtkButton" id="removeall_button">
        <property name="label" translatable="1">Remove Al_l</property>
        <property name="focusable">1</property>
        <property name="receives-default">1</property>
        <property name="use-underline">1</property>
        <signal name="clicked" handler="removeall_cb" object="PidginPrivacyDialog" swapped="no"/>
      </object>
    </child>
    <child type="action">
      <object class="GtkButton" id="close_button">
        <property name="label">_Close</property>
        <property name="focusable">1</property>
        <property name="receives-default">1</property>
        <property name="use-underline">1</property>
        <signal name="clicked" handler="gtk_window_destroy" object="PidginPrivacyDialog" swapped="yes"/>
      </object>
    </child>
  </template>
</interface>

mercurial