Mon, 05 Sep 2022 21:44:39 -0500
Convert the protocol chooser to a GtkDropDown
This effectively looks the same, but the factory and expression are more general, and this can be ported to an `AdwComboRow` almost directly (literally just `s/GtkDropDown/AdwComboRow//g` and `s/gtk_drop_down/adw_combo_row/g`), if that's the route we end up with for the account settings.
Testing Done:
Opened a new account dialog, changed protocols and saw that things changed a bit, also tried on an existing account.
Reviewed at https://reviews.imfreedom.org/r/1723/
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
41585
af28a422c1ad
Port PidginProtocolChooser to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41280
diff
changeset
|
2 | <!-- |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | Pidgin - Internet Messenger |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | This program is free software; you can redistribute it and/or |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | modify it under the terms of the GNU General Public License |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | as published by the Free Software Foundation; either version 2 |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | of the License, or (at your option) any later version. |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | This program is distributed in the hope that it will be useful, |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | GNU General Public License for more details. |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | You should have received a copy of the GNU General Public License |
|
41585
af28a422c1ad
Port PidginProtocolChooser to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41280
diff
changeset
|
17 | along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | --> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | <interface domain="pidgin"> |
|
41585
af28a422c1ad
Port PidginProtocolChooser to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41280
diff
changeset
|
20 | <requires lib="gtk" version="4.0"/> |
|
41649
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
21 | <requires lib="Adw" version="1.0"/> |
|
40787
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
22 | <requires lib="pidgin" version="3.0"/> |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | <!-- interface-license-type gplv2 --> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | <!-- interface-name Pidgin --> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | <!-- interface-description Internet Messenger --> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | <!-- interface-copyright Pidgin Developers <devel@pidgin.im> --> |
|
41649
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
27 | <template class="PidginProtocolChooser" parent="AdwBin"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
28 | <property name="child"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
29 | <object class="GtkDropDown" id="dropdown"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
30 | <property name="factory"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
31 | <object class="GtkBuilderListItemFactory"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
32 | <property name="bytes"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
33 | <![CDATA[ |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
34 | <?xml version="1.0" encoding="UTF-8"?> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
35 | <interface> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
36 | <template class="GtkListItem"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
37 | <property name="child"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
38 | <object class="GtkBox"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
39 | <property name="orientation">horizontal</property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
40 | <property name="spacing">6</property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
41 | <child> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
42 | <object class="GtkImage"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
43 | <binding name="icon-name"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
44 | <lookup name="icon-name" type="PurpleProtocol"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
45 | <lookup name="item">GtkListItem</lookup> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
46 | </lookup> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
47 | </binding> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
48 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
49 | </child> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
50 | <child> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
51 | <object class="GtkLabel"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
52 | <property name="xalign">0</property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
53 | <binding name="label"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
54 | <lookup name="name" type="PurpleProtocol"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
55 | <lookup name="item">GtkListItem</lookup> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
56 | </lookup> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
57 | </binding> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
58 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
59 | </child> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
60 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
61 | </property> |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | </template> |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | </interface> |
|
41649
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
64 | ]]> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
65 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
66 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
67 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
68 | <property name="model"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
69 | <object class="GtkSortListModel" id="sort"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
70 | <property name="sorter"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
71 | <object class="GtkStringSorter"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
72 | <property name="expression"> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
73 | <lookup name="name" type="PurpleProtocol"/> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
74 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
75 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
76 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
77 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
78 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
79 | <signal name="notify::selected" handler="dropdown_changed_cb" object="PidginProtocolChooser" swapped="no"/> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
80 | </object> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
81 | </property> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
82 | </template> |
|
35733be03440
Convert the protocol chooser to a GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41645
diff
changeset
|
83 | </interface> |