--- a/pidgin/gtkmedia.c Thu Aug 04 16:11:11 2022 -0500
+++ b/pidgin/gtkmedia.c Mon Aug 08 20:23:17 2022 -0500
@@ -126,12 +126,21 @@
+pidgin_media_delete_event_cb(GtkWidget *widget, + GdkEvent *event, PidginMedia *media) + if (media->priv->media) + g_action_group_activate_action(G_ACTION_GROUP(media), pidgin_media_class_init (PidginMediaClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-/* GtkContainerClass *container_class = (GtkContainerClass*)klass; */
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); gobject_class->dispose = pidgin_media_dispose;
gobject_class->finalize = pidgin_media_finalize;
@@ -150,6 +159,20 @@
"The screenname of the user this session is with.",
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ gtk_widget_class_set_template_from_resource( + "/im/pidgin/Pidgin3/Media/window.ui" + gtk_widget_class_bind_template_child_private(widget_class, PidginMedia, + gtk_widget_class_bind_template_child_private(widget_class, PidginMedia, + gtk_widget_class_bind_template_callback(widget_class, + pidgin_media_delete_event_cb); @@ -204,16 +227,6 @@
g_simple_action_set_state(action, value);
-pidgin_media_delete_event_cb(GtkWidget *widget,
- GdkEvent *event, PidginMedia *media)
- if (media->priv->media)
- g_action_group_activate_action(G_ACTION_GROUP(media),
static const GActionEntry media_action_entries[] = {
{ "Hangup", pidgin_media_hangup_activate_cb },
{ "Hold", NULL, NULL, "false", pidgin_media_hold_change_state_cb },
@@ -221,76 +234,19 @@
{ "Pause", NULL, NULL, "false", pidgin_media_pause_change_state_cb },
-static const gchar *media_menu =
- "<menu id='MediaMenu'>"
- "<attribute name='label' translatable='yes'>_Media</attribute>"
- "<attribute name='label' translatable='yes'>_Hangup</attribute>"
- "<attribute name='action'>win.Hangup</attribute>"
-setup_menubar(PidginMedia *window)
- window->priv->ui = gtk_builder_new();
- gtk_builder_set_translation_domain(window->priv->ui, PACKAGE);
- if (!gtk_builder_add_from_string(window->priv->ui, media_menu, -1, &error))
- g_message("building menus failed: %s", error->message);
- menu = gtk_menu_bar_new_from_model(G_MENU_MODEL(
- gtk_builder_get_object(window->priv->ui,
pidgin_media_init (PidginMedia *media)
media->priv = pidgin_media_get_instance_private(media);
+ gtk_widget_init_template(GTK_WIDGET(media)); g_action_map_add_action_entries(G_ACTION_MAP(media),
G_N_ELEMENTS(media_action_entries), media);
- vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add(GTK_CONTAINER(media), vbox);
- media->priv->statusbar = gtk_statusbar_new();
- gtk_box_pack_end(GTK_BOX(vbox), media->priv->statusbar,
gtk_statusbar_push(GTK_STATUSBAR(media->priv->statusbar),
- gtk_widget_show(media->priv->statusbar);
- media->priv->menubar = setup_menubar(media);
- gtk_box_pack_start(GTK_BOX(vbox), media->priv->menubar,
- media->priv->display = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_container_set_border_width(GTK_CONTAINER(media->priv->display), 6);
- gtk_box_pack_start(GTK_BOX(vbox), media->priv->display, TRUE, TRUE, 6);
- g_signal_connect(G_OBJECT(media), "delete-event",
- G_CALLBACK(pidgin_media_delete_event_cb), media);
media->priv->recv_progressbars =
g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
@@ -1048,4 +1004,3 @@
purple_media_manager_set_active_element(manager, audio_sink);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Media/window.ui Mon Aug 08 20:23:17 2022 -0500
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 +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, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + <requires lib="gtk+" version="3.24"/> + <!-- interface-license-type gplv2 --> + <!-- interface-name Pidgin --> + <!-- interface-description Internet Messenger --> + <!-- interface-copyright Pidgin Developers <devel@pidgin.im> --> + <template class="PidginMedia" parent="GtkApplicationWindow"> + <property name="can-focus">False</property> + <signal name="delete-event" handler="pidgin_media_delete_event_cb" swapped="no"/> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <object class="GtkToolbar"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="toolbar-style">both</property> + <object class="GtkToolButton"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="tooltip-text" translatable="yes">Hangup</property> + <property name="action-name">win.Hangup</property> + <property name="label" translatable="yes">Hangup</property> + <property name="use-underline">True</property> + <property name="icon-name">media-playback-stop</property> + <property name="expand">False</property> + <property name="homogeneous">True</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkBox" id="display"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <object class="GtkStatusbar" id="statusbar"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-left">10</property> + <property name="margin-right">10</property> + <property name="margin-start">10</property> + <property name="margin-end">10</property> + <property name="margin-top">6</property> + <property name="margin-bottom">6</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> --- a/pidgin/resources/pidgin.gresource.xml Thu Aug 04 16:11:11 2022 -0500
+++ b/pidgin/resources/pidgin.gresource.xml Mon Aug 08 20:23:17 2022 -0500
@@ -20,6 +20,7 @@
<file compressed="true">Debug/plugininfo.ui</file>
<file compressed="true">Keypad/keypad.ui</file>
<file compressed="true">Log/log-viewer.ui</file>
+ <file compressed="true">Media/window.ui</file> <file compressed="true">Notifications/connectionerror.ui</file>
<file compressed="true">Notifications/list.ui</file>
<file compressed="true">Plugins/dialog.ui</file>
--- a/po/POTFILES.in Thu Aug 04 16:11:11 2022 -0500
+++ b/po/POTFILES.in Mon Aug 08 20:23:17 2022 -0500
@@ -408,6 +408,7 @@
pidgin/resources/Debug/plugininfo.ui
pidgin/resources/Keypad/keypad.ui
pidgin/resources/Log/log-viewer.ui
+pidgin/resources/Media/window.ui pidgin/resources/Plugins/dialog.ui
pidgin/resources/Plugins/menu.ui
pidgin/resources/Prefs/away.ui