# HG changeset patch
# Node ID adfaff51ecac
# Parent  d3e3f19bba8d
diff --git a/pidgin/pidginaddbuddydialog.c b/pidgin/pidginaddbuddydialog.c
--- a/pidgin/pidginaddbuddydialog.c
+++ b/pidgin/pidginaddbuddydialog.c
@@ -85,7 +85,7 @@
 
 		protocol = purple_account_get_protocol(account);
 		if(PURPLE_IS_PROTOCOL(protocol)) {
-			const gchar *username = gtk_entry_get_text(GTK_ENTRY(dialog->username));
+			const gchar *username = gtk_editable_get_text(GTK_EDITABLE(dialog->username));
 
 			valid = purple_validate(protocol, username);
 		}
@@ -115,9 +115,9 @@
 
 		/* Grab all of the values that the user entered. */
 		account = pidgin_account_chooser_get_selected(PIDGIN_ACCOUNT_CHOOSER(abdialog->account));
-		username = gtk_entry_get_text(GTK_ENTRY(abdialog->username));
-		alias = gtk_entry_get_text(GTK_ENTRY(abdialog->alias));
-		message = gtk_entry_get_text(GTK_ENTRY(abdialog->message));
+		username = gtk_editable_get_text(GTK_EDITABLE(abdialog->username));
+		alias = gtk_editable_get_text(GTK_EDITABLE(abdialog->alias));
+		message = gtk_editable_get_text(GTK_EDITABLE(abdialog->message));
 		groupname = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(abdialog->group));
 
 		/* Make anything that is an empty string NULL. */
@@ -194,7 +194,7 @@
 		g_free(groupname);
 	}
 
-	gtk_widget_destroy(GTK_WIDGET(abdialog));
+	gtk_window_destroy(GTK_WINDOW(abdialog));
 }
 
 static void
@@ -304,22 +304,22 @@
 	}
 
 	if(username != NULL) {
-		gtk_entry_set_text(GTK_ENTRY(abdialog->username), username);
+		gtk_editable_set_text(GTK_EDITABLE(abdialog->username), username);
 	}
 
 	if(alias != NULL) {
-		gtk_entry_set_text(GTK_ENTRY(abdialog->alias), alias);
+		gtk_editable_set_text(GTK_EDITABLE(abdialog->alias), alias);
 	}
 
 	if(message != NULL) {
-		gtk_entry_set_text(GTK_ENTRY(abdialog->message), message);
+		gtk_editable_set_text(GTK_EDITABLE(abdialog->message), message);
 	}
 
 	if(group != NULL) {
 		GtkWidget *entry = NULL;
 
-		entry = gtk_bin_get_child(GTK_BIN(abdialog->group));
-		gtk_entry_set_text(GTK_ENTRY(entry), group);
+		entry = gtk_combo_box_get_child(GTK_COMBO_BOX(abdialog->group));
+		gtk_editable_set_text(GTK_EDITABLE(entry), group);
 	}
 
 	return dialog;
diff --git a/pidgin/resources/Dialogs/addbuddy.ui b/pidgin/resources/Dialogs/addbuddy.ui
--- a/pidgin/resources/Dialogs/addbuddy.ui
+++ b/pidgin/resources/Dialogs/addbuddy.ui
@@ -15,12 +15,11 @@
 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, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+along with this program; if not, see <https://www.gnu.org/licenses/>.
 
 -->
 <interface>
-  <requires lib="gtk+" version="3.24"/>
+  <requires lib="gtk" version="4.0"/>
   <requires lib="pidgin" version="3.0"/>
   <!-- interface-license-type gplv2 -->
   <!-- interface-name Pidgin -->
@@ -34,302 +33,144 @@
     <property name="child-model">account_filter_connected</property>
   </object>
   <template class="PidginAddBuddyDialog" parent="GtkDialog">
-    <property name="can-focus">False</property>
     <property name="border-width">12</property>
-    <property name="title" translatable="yes">Add Buddy</property>
-    <property name="resizable">False</property>
-    <property name="type-hint">dialog</property>
+    <property name="title" translatable="1">Add Buddy</property>
+    <property name="resizable">0</property>
     <signal name="response" handler="pidgin_add_buddy_dialog_response_cb" swapped="no"/>
-    <child internal-child="vbox">
+    <child internal-child="content_area">
       <object class="GtkBox">
-        <property name="can-focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox">
-            <property name="can-focus">False</property>
-            <property name="layout-style">end</property>
-            <child>
-              <object class="GtkButton" id="button1">
-                <property name="label" translatable="yes">_Cancel</property>
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
-                <property name="receives-default">True</property>
-                <property name="use-underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button2">
-                <property name="label" translatable="yes">_Add</property>
-                <property name="visible">True</property>
-                <property name="sensitive">False</property>
-                <property name="can-focus">True</property>
-                <property name="can-default">True</property>
-                <property name="receives-default">True</property>
-                <property name="use-underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
               <object class="GtkLabel">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="label" translatable="yes">Add a buddy.</property>
+                <property name="label" translatable="1">Add a buddy.</property>
                 <property name="xalign">0</property>
                 <property name="yalign">0</property>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="spacer">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
+              <object class="GtkLabel" id="spacer"/>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label1">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes">A_ccount:</property>
-                    <property name="use-underline">True</property>
+                    <property name="label" translatable="1">A_ccount:</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">account</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="PidginAccountChooser" id="account">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
+                    <property name="hexpand">1</property>
+                    <property name="halign">fill</property>
                     <property name="model">filter</property>
                     <signal name="changed" handler="pidgin_add_buddy_dialog_account_changed_cb" object="PidginAddBuddyDialog" swapped="no"/>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes">Buddy's _username:</property>
-                    <property name="use-underline">True</property>
+                    <property name="label" translatable="1">Buddy&apos;s _username:</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">username</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="username">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="has-focus">True</property>
-                    <property name="can-default">True</property>
-                    <property name="activates-default">True</property>
+                    <property name="hexpand">1</property>
+                    <property name="halign">fill</property>
+                    <property name="focusable">1</property>
+                    <property name="has-focus">1</property>
+                    <property name="can-default">1</property>
+                    <property name="activates-default">1</property>
                     <signal name="changed" handler="pidgin_add_buddy_dialog_username_changed_cb" object="PidginAddBuddyDialog" swapped="no"/>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes">(Optional) A_lias:</property>
-                    <property name="use-underline">True</property>
+                    <property name="label" translatable="1">(Optional) A_lias:</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">alias</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="alias">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="hexpand">1</property>
+                    <property name="halign">fill</property>
+                    <property name="focusable">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">4</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes">(Optional) _Invite message:</property>
-                    <property name="use-underline">True</property>
+                    <property name="label" translatable="1">(Optional) _Invite message:</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">message</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="message">
-                    <property name="visible">True</property>
-                    <property name="sensitive">False</property>
-                    <property name="can-focus">True</property>
+                    <property name="hexpand">1</property>
+                    <property name="halign">fill</property>
+                    <property name="sensitive">0</property>
+                    <property name="focusable">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">5</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label5">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes">Add buddy to _group:</property>
-                    <property name="use-underline">True</property>
+                    <property name="label" translatable="1">Add buddy to _group:</property>
+                    <property name="use-underline">1</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkComboBoxText" id="group">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="has-entry">True</property>
-                    <child internal-child="entry">
+                    <property name="hexpand">1</property>
+                    <property name="halign">fill</property>
+                    <property name="has-entry">1</property>
+                    <property name="child">
                       <object class="GtkEntry">
-                        <property name="can-focus">True</property>
+                        <property name="focusable">1</property>
                       </object>
-                    </child>
+                    </property>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">6</property>
-              </packing>
             </child>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
         </child>
       </object>
     </child>
@@ -337,6 +178,33 @@
       <action-widget response="-6">button1</action-widget>
       <action-widget response="-5">button2</action-widget>
     </action-widgets>
+    <child internal-child="action_area">
+      <object class="GtkBox">
+        <property name="halign">end</property>
+        <child>
+          <object class="GtkButton" id="button1">
+            <property name="label" translatable="1">_Cancel</property>
+            <property name="focusable">1</property>
+            <property name="receives-default">1</property>
+            <property name="use-underline">1</property>
+            <property name="vexpand">1</property>
+            <property name="vfill">fill</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="button2">
+            <property name="label" translatable="1">_Add</property>
+            <property name="sensitive">0</property>
+            <property name="focusable">1</property>
+            <property name="can-default">1</property>
+            <property name="receives-default">1</property>
+            <property name="use-underline">1</property>
+            <property name="vexpand">1</property>
+            <property name="vfill">fill</property>
+          </object>
+        </child>
+      </object>
+    </child>
   </template>
   <object class="GtkSizeGroup">
     <widgets>
