pidgin/resources/Prefs/vv.ui

Mon, 29 Aug 2022 22:14:37 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Mon, 29 Aug 2022 22:14:37 -0500
changeset 41627
7d9b4a9d5c3e
parent 41581
732b1fcb8e31
child 42191
68380e709c16
permissions
-rw-r--r--

Move VV preferences to Adwaita preference widgets

Also switched from `GtkProgressBar` to `GtkLevelBar`, which seemed more appropriate. The number of levels was copied from the GNOME audio settings page.

Also switched from `GtkAspectFrame` to `GtkPicture`, as it is likely that GStreamer will use a `GdkPaintable` or some such in the future, based on the blog post we've found.

More work for the devices can be done later, but needs some internal rework for list models first.

Testing Done:
Changed some options, tried the `Test Audio` button, which seemed to work. Also tried `Test Video` option, but it fails as expected due to using GTK3 GStreamer widgets.

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

<?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 program; if not, see <https://www.gnu.org/licenses/>.
-->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="Adw" version="1.0"/>
  <!-- interface-license-type gplv2 -->
  <!-- interface-name Pidgin -->
  <!-- interface-description Internet Messenger -->
  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
  <object class="GtkAdjustment" id="adjustment1">
    <property name="upper">100</property>
    <property name="step-increment">1</property>
    <property name="page-increment">10</property>
  </object>
  <object class="GtkAdjustment" id="adjustment2">
    <property name="upper">100</property>
    <property name="step-increment">1</property>
    <property name="page-increment">10</property>
  </object>
  <object class="GtkListStore" id="video.input.store">
    <columns>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name value -->
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkListStore" id="video.output.store">
    <columns>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name value -->
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkListStore" id="voice.input.store">
    <columns>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name value -->
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkListStore" id="voice.output.store">
    <columns>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name value -->
      <column type="gchararray"/>
    </columns>
  </object>
  <template class="PidginVVPrefs" parent="AdwPreferencesPage">
    <child>
      <object class="AdwPreferencesGroup">
        <property name="title" translatable="1">Audio</property>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">voice.input.combo</property>
            <property name="title" translatable="1" context="Input for Audio">Input Device</property>
            <child>
              <object class="GtkComboBox" id="voice.input.combo">
                <property name="id-column">1</property>
                <property name="model">voice.input.store</property>
                <property name="valign">center</property>
                <child>
                  <object class="GtkCellRendererText"/>
                  <attributes>
                    <attribute name="text">0</attribute>
                  </attributes>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">voice.output.combo</property>
            <property name="title" translatable="1" context="Device for Audio Output">Output Device</property>
            <child>
              <object class="GtkComboBox" id="voice.output.combo">
                <property name="id-column">1</property>
                <property name="model">voice.output.store</property>
                <property name="valign">center</property>
                <child>
                  <object class="GtkCellRendererText"/>
                  <attributes>
                    <attribute name="text">0</attribute>
                  </attributes>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">voice.volume</property>
            <property name="title" translatable="1">Volume</property>
            <child>
              <object class="GtkVolumeButton" id="voice.volume">
                <property name="focusable">1</property>
                <property name="focus-on-click">0</property>
                <property name="receives-default">1</property>
                <property name="orientation">vertical</property>
                <property name="valign">center</property>
                <property name="adjustment">adjustment2</property>
                <signal name="value-changed" handler="volume_changed_cb" swapped="no"/>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow" id="voice.threshold_row">
            <property name="activatable-widget">voice.threshold</property>
            <property name="title" translatable="1">Silence threshold</property>
            <child>
              <object class="GtkScale" id="voice.threshold">
                <property name="focusable">1</property>
                <property name="hexpand">1</property>
                <property name="valign">center</property>
                <property name="adjustment">adjustment1</property>
                <property name="round-digits">0</property>
                <property name="digits">0</property>
                <signal name="value-changed" handler="threshold_value_changed_cb" object="PidginVVPrefs" swapped="no"/>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwPreferencesRow">
            <property name="margin-bottom">12</property>
            <property name="margin-end">12</property>
            <property name="margin-start">12</property>
            <property name="margin-top">12</property>
            <child>
              <object class="GtkBox">
                <property name="orientation">vertical</property>
                <property name="spacing">6</property>
                <child>
                  <object class="GtkToggleButton" id="voice.test">
                    <property name="label" translatable="1">Test Audio</property>
                    <property name="focusable">1</property>
                    <property name="receives-default">1</property>
                    <signal name="toggled" handler="toggle_voice_test_cb" object="PidginVVPrefs" swapped="no"/>
                  </object>
                </child>
                <child>
                  <object class="GtkBox">
                    <property name="spacing">6</property>
                    <child>
                      <object class="GtkLevelBar" id="voice.level">
                        <property name="hexpand">1</property>
                        <!-- Keep this maximum in sync with MAX_AUDIO_LEVEL in
                             pidgin/prefs/pidginvvprefs.c -->
                        <property name="max-value">19</property>
                        <property name="mode">discrete</property>
                        <property name="valign">center</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkLabel" id="voice.drop">
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwPreferencesGroup">
        <property name="title" translatable="1">Video</property>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">video.input.combo</property>
            <property name="title" translatable="1" context="Device for Video Input">Input Device</property>
            <child>
              <object class="GtkComboBox" id="video.input.combo">
                <property name="id-column">1</property>
                <property name="hexpand">1</property>
                <property name="model">video.input.store</property>
                <property name="valign">center</property>
                <child>
                  <object class="GtkCellRendererText"/>
                  <attributes>
                    <attribute name="text">0</attribute>
                  </attributes>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">video.output.combo</property>
            <property name="title" translatable="1" context="Device for Video Output">Output Device</property>
            <child>
              <object class="GtkComboBox" id="video.output.combo">
                <property name="hexpand">1</property>
                <property name="id-column">1</property>
                <property name="valign">center</property>
                <property name="model">video.output.store</property>
                <child>
                  <object class="GtkCellRendererText"/>
                  <attributes>
                    <attribute name="text">0</attribute>
                  </attributes>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwPreferencesRow">
            <property name="margin-bottom">12</property>
            <property name="margin-end">12</property>
            <property name="margin-start">12</property>
            <property name="margin-top">12</property>
            <child>
              <object class="GtkBox">
                <property name="orientation">vertical</property>
                <property name="spacing">6</property>
                <child>
                  <object class="GtkToggleButton" id="video.test">
                    <property name="label" translatable="1">Test Video</property>
                    <property name="focusable">1</property>
                    <property name="receives-default">1</property>
                    <signal name="toggled" handler="toggle_video_test_cb" object="PidginVVPrefs" swapped="no"/>
                  </object>
                </child>
                <child>
                  <object class="GtkPicture" id="video.frame">
                    <property name="keep-aspect-ratio">1</property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>

mercurial