pidgin/pidgin

c2b876aa4c03
Parents cc0679f47fd9
Children 611ae5d8a232
Fix a number of issues with the Plugins dialog

Testing Done:
Compiled and debugged locally with the gplugin fixes from [rr 454](https://reviews.imfreedom.org/r/455/)

Reviewed at https://reviews.imfreedom.org/r/455/
--- a/pidgin/pidginpluginsdialog.c Tue Jan 26 01:46:21 2021 -0600
+++ b/pidgin/pidginpluginsdialog.c Tue Jan 26 02:01:37 2021 -0600
@@ -38,7 +38,6 @@
GtkWidget *tree_view;
GtkWidget *configure_plugin_button;
- GtkWidget *close_button;
GtkWidget *plugin_info;
GtkListStore *plugin_store;
@@ -143,11 +142,6 @@
* Callbacks
*****************************************************************************/
static void
-pidgin_plugins_dialog_close(GtkWidget *b, gpointer data) {
- gtk_widget_destroy(GTK_WIDGET(data));
-}
-
-static void
pidgin_plugins_dialog_selection_cb(GtkTreeSelection *sel, gpointer data) {
PidginPluginsDialog *dialog = PIDGIN_PLUGINS_DIALOG(data);
GPluginPlugin *plugin = NULL;
@@ -165,12 +159,14 @@
plugin
);
- gtk_widget_set_sensitive(
- GTK_WIDGET(dialog->configure_plugin_button),
- pidgin_plugins_dialog_plugin_has_config(plugin)
- );
+ if(GPLUGIN_IS_PLUGIN(plugin)) {
+ gtk_widget_set_sensitive(
+ GTK_WIDGET(dialog->configure_plugin_button),
+ pidgin_plugins_dialog_plugin_has_config(plugin)
+ );
- g_object_unref(G_OBJECT(plugin));
+ g_object_unref(G_OBJECT(plugin));
+ }
}
static void
@@ -310,7 +306,6 @@
gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, tree_view);
gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, configure_plugin_button);
- gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, close_button);
gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, plugin_info);
gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, plugin_store);
@@ -322,14 +317,6 @@
pidgin_plugins_dialog_init(PidginPluginsDialog *dialog) {
gtk_widget_init_template(GTK_WIDGET(dialog));
- /* wire up the close button */
- g_signal_connect(
- dialog->close_button,
- "clicked",
- G_CALLBACK(pidgin_plugins_dialog_close),
- dialog
- );
-
/* set the sort column for the plugin_store */
gtk_tree_sortable_set_sort_column_id(
GTK_TREE_SORTABLE(dialog->plugin_store),
@@ -338,12 +325,11 @@
);
}
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
GtkWidget *
pidgin_plugins_dialog_new(void) {
- return g_object_new(
- PIDGIN_TYPE_PLUGINS_DIALOG,
- "title", _("Plugins"),
- NULL
- );
+ return GTK_WIDGET(g_object_new(PIDGIN_TYPE_PLUGINS_DIALOG, NULL));
}
--- a/pidgin/resources/Plugins/dialog.ui Tue Jan 26 01:46:21 2021 -0600
+++ b/pidgin/resources/Plugins/dialog.ui Tue Jan 26 02:01:37 2021 -0600
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1
+<!-- Generated with glade 3.38.2
Pidgin - Internet Messenger
Copyright (C) Pidgin Developers <devel@pidgin.im>
@@ -26,32 +26,31 @@
<!-- interface-name Pidgin -->
<!-- interface-description Internet Messenger -->
<!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <object class="GPluginGtkStore" id="raw_plugin_store"/>
+ <object class="GPluginGtkStore" type-func="gplugin_gtk_store_get_type" id="raw_plugin_store"/>
<object class="GtkTreeModelSort" id="plugin_store">
<property name="model">raw_plugin_store</property>
</object>
<template class="PidginPluginsDialog" parent="GtkDialog">
- <property name="can_focus">False</property>
- <property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
+ <property name="can-focus">False</property>
+ <property name="title" translatable="yes">Plugins</property>
+ <property name="type-hint">dialog</property>
+ <signal name="delete-event" handler="gtk_widget_destroy" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
<child>
<object class="GtkButton" id="configure_plugin_button">
<property name="label" translatable="yes">Configure Plugin</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<signal name="clicked" handler="pidgin_plugins_dialog_config_plugin_cb" object="PidginPluginsDialog" swapped="no"/>
</object>
<packing>
@@ -61,11 +60,12 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="close_button">
+ <object class="GtkButton">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <signal name="clicked" handler="gtk_widget_destroy" object="PidginPluginsDialog" swapped="yes"/>
</object>
<packing>
<property name="expand">True</property>
@@ -83,19 +83,19 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="can-focus">True</property>
+ <property name="shadow-type">in</property>
<child>
- <object class="GPluginGtkView" id="tree_view">
+ <object class="GPluginGtkView" type-func="gplugin_gtk_view_get_type" id="tree_view">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="model">plugin_store</property>
- <property name="headers_clickable">False</property>
+ <property name="headers-clickable">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<signal name="changed" handler="pidgin_plugins_dialog_selection_cb" object="PidginPluginsDialog" swapped="no"/>
@@ -111,9 +111,9 @@
</packing>
</child>
<child>
- <object class="GPluginGtkPluginInfo" id="plugin_info">
+ <object class="GPluginGtkPluginInfo" type-func="gplugin_gtk_plugin_info_get_type" id="plugin_info">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>