pidgin/pidgin

bf78d5476c6a
Parents 2bfdd6552f14
Children ca648c0e192d
initial start of moving the plugins dialog to glade
--- a/meson.build Tue Nov 19 05:03:18 2019 +0000
+++ b/meson.build Thu Oct 17 20:37:48 2019 -0500
@@ -629,19 +629,43 @@
else
gplugin_include_directories = []
endif
+
+ if get_option('gtkui')
+ gplugin_gtk_dep = dependency('gplugin-gtk', required : true)
+
+ if enable_introspection
+ gplugin_gtk_gir = 'GPluginGtk-0.0'
+ gplugin_gtk_include_directories = include_directories(
+ join_paths(gplugin_gtk_dep.get_pkgconfig_variable('prefix'),
+ 'share/gir-1.0'))
+ else
+ gplugin_gtk_include_directories = []
+ endif
+ endif
else
gplugin_proj = subproject('gplugin',
default_options : [
'doc=' + get_option('doc').to_string(),
'gobject-introspection=' + enable_introspection.to_string(),
'nls=' + get_option('nls').to_string(),
+ 'gtk3=' + get_option('gtkui').to_string(),
]
)
+
gplugin_dep = gplugin_proj.get_variable('gplugin_dep')
if enable_introspection
gplugin_gir = gplugin_proj.get_variable('gplugin_gir')[0]
endif
gplugin_include_directories = []
+
+ if get_option('gtkui')
+ gplugin_gtk_dep = gplugin_proj.get_variable('gplugin_gtk_dep')
+
+ if enable_introspection
+ gplugin_gtk_gir = gplugin_proj.get_variable('gplugin_gtk_gir')[0]
+ endif
+ gplugin_gtk_include_directories = []
+ endif
endif
PLUGINS = get_option('plugins')
--- a/pidgin/gtkblist.c Tue Nov 19 05:03:18 2019 +0000
+++ b/pidgin/gtkblist.c Thu Oct 17 20:37:48 2019 -0500
@@ -63,6 +63,7 @@
#include "pidgin/pidgindebugplugininfo.h"
#include "pidgin/pidgingdkpixbuf.h"
#include "pidgin/pidginlog.h"
+#include "pidgin/pidginpluginsdialog.h"
#include "pidgin/pidgintooltip.h"
#include "pidginmenutray.h"
@@ -3617,6 +3618,15 @@
* Crap *
***************************************************/
static void
+pidgin_plugins_dialog_cb(GtkAction *action, GtkWidget *window) {
+ GtkWidget *dialog = pidgin_plugins_dialog_new();
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+
+ gtk_widget_show_all(dialog);
+}
+
+static void
_pidgin_about_cb(GtkAction *action, GtkWidget *window) {
GtkWidget *about = pidgin_about_dialog_new();
@@ -3651,6 +3661,7 @@
{ "BuddyPounces", NULL, N_("Buddy _Pounces"), NULL, NULL, pidgin_pounces_manager_show },
{ "CustomSmileys", PIDGIN_STOCK_TOOLBAR_SMILEY, N_("Custom Smile_ys"), "<control>Y", NULL, pidgin_smiley_manager_show },
{ "Plugins", PIDGIN_STOCK_TOOLBAR_PLUGINS, N_("Plu_gins"), "<control>U", NULL, pidgin_plugin_dialog_show },
+ { "Plugins-NG", PIDGIN_STOCK_TOOLBAR_PLUGINS, N_("Plugins-ng"), NULL, NULL, pidgin_plugins_dialog_cb },
{ "Preferences", GTK_STOCK_PREFERENCES, N_("Pr_eferences"), "<control>P", NULL, pidgin_prefs_show },
{ "Privacy", NULL, N_("Pr_ivacy"), NULL, NULL, pidgin_privacy_dialog_show },
{ "SetMood", NULL, N_("Set _Mood"), "<control>D", NULL, set_mood_show },
@@ -3710,6 +3721,7 @@
"<menuitem action='BuddyPounces'/>"
"<menuitem action='CustomSmileys'/>"
"<menuitem action='Plugins'/>"
+ "<menuitem action='Plugins-NG'/>"
"<menuitem action='Preferences'/>"
"<menuitem action='Privacy'/>"
"<menuitem action='SetMood'/>"
--- a/pidgin/meson.build Tue Nov 19 05:03:18 2019 +0000
+++ b/pidgin/meson.build Thu Oct 17 20:37:48 2019 -0500
@@ -44,6 +44,7 @@
'pidginlog.c',
'pidginmenutray.c',
'pidginmessage.c',
+ 'pidginpluginsdialog.c',
'pidgintalkatu.c',
'pidgintooltip.c',
]
@@ -96,6 +97,7 @@
'pidginlog.h',
'pidginmenutray.h',
'pidginmessage.h',
+ 'pidginpluginsdialog.h',
'pidgintalkatu.h',
'pidgintooltip.h',
'pidgin.h',
@@ -150,15 +152,16 @@
install_headers(libpidgin_headers, subdir : 'pidgin-3')
_libpidgin_dependencies = [
- glib,
- gstreamer_video,
- gtk,
- IOKIT,
- json,
- math,
+ glib,
+ gplugin_gtk_dep,
+ gstreamer_video,
+ gtk,
+ IOKIT,
+ json,
+ math,
libsoup,
- talkatu_dep,
- libpurple_dep,
+ talkatu_dep,
+ libpurple_dep,
]
if x11.found()
_libpidgin_dependencies += x11
@@ -224,20 +227,21 @@
introspection_sources = libpidgin_headers
gnome.generate_gir(libpidgin,
- sources : introspection_sources,
- includes : ['GObject-2.0', 'Gtk-3.0', libpurple_gir[0], talkatu_gir, gplugin_gir],
- namespace : 'Pidgin',
- symbol_prefix : 'pidgin',
- identifier_prefix : 'Pidgin',
- export_packages : 'pidgin-@0@'.format(purple_major_version),
- nsversion : '@0@.@1@'.format(purple_major_version,
- purple_minor_version),
- include_directories : [
- gplugin_include_directories,
- talkatu_include_directories,
- ],
- install : true,
- extra_args : ['--quiet'])
+ sources : introspection_sources,
+ includes : ['GObject-2.0', 'Gtk-3.0', libpurple_gir[0], talkatu_gir, gplugin_gir],
+ namespace : 'Pidgin',
+ symbol_prefix : 'pidgin',
+ identifier_prefix : 'Pidgin',
+ export_packages : 'pidgin-@0@'.format(purple_major_version),
+ nsversion : '@0@.@1@'.format(purple_major_version,
+ purple_minor_version),
+ include_directories : [
+ gplugin_include_directories,
+ gplugin_gtk_include_directories,
+ talkatu_include_directories,
+ ],
+ install : true,
+ extra_args : ['--quiet'])
endif
subdir('data')
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginpluginsdialog.c Thu Oct 17 20:37:48 2019 -0500
@@ -0,0 +1,84 @@
+/*
+ * pidgin
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * 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 02111-1301 USA
+ *
+ */
+
+#include "pidginpluginsdialog.h"
+
+#include <glib/gi18n.h>
+
+struct _PidginPluginsDialog {
+ GtkDialog parent;
+
+ GtkWidget *close_button;
+};
+
+/******************************************************************************
+ * Helpers
+ *****************************************************************************/
+
+/******************************************************************************
+ * Callbacks
+ *****************************************************************************/
+static void
+pidgin_plugins_dialog_close(GtkWidget *b, gpointer data) {
+ gtk_widget_destroy(GTK_WIDGET(data));
+}
+
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+G_DEFINE_TYPE(PidginPluginsDialog, pidgin_plugins_dialog, GTK_TYPE_DIALOG);
+
+static void
+pidgin_plugins_dialog_class_init(PidginPluginsDialogClass *klass) {
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+
+ gtk_widget_class_set_template_from_resource(
+ widget_class,
+ "/im/pidgin/Pidgin/Plugins/dialog.ui"
+ );
+
+ gtk_widget_class_bind_template_child(widget_class, PidginPluginsDialog, close_button);
+}
+
+static void
+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
+ );
+}
+
+GtkWidget *
+pidgin_plugins_dialog_new(void) {
+ return g_object_new(
+ PIDGIN_TYPE_PLUGINS_DIALOG,
+ "title", _("Plugins"),
+ NULL
+ );
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginpluginsdialog.h Thu Oct 17 20:37:48 2019 -0500
@@ -0,0 +1,46 @@
+/* pidgin
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * 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 02111-1301 USA
+ *
+ */
+
+#ifndef PIDGIN_PLUGINS_DIALOG_H
+#define PIDGIN_PLUGINS_DIALOG_H
+
+/**
+ * SECTION:pidginpluginsdialog
+ * @section_id: pidgin-plugins-dialog
+ * @short_description: A widget to display available plugins
+ * @title: Plugins Dialog
+ */
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define PIDGIN_TYPE_PLUGINS_DIALOG (pidgin_plugins_dialog_get_type())
+G_DECLARE_FINAL_TYPE(PidginPluginsDialog, pidgin_plugins_dialog, PIDGIN,
+ PLUGINS_DIALOG, GtkDialog)
+
+GtkWidget *pidgin_plugins_dialog_new(void);
+
+G_END_DECLS
+
+#endif /* PIDGIN_PLUGINS_DIALOG_H */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Plugins/dialog.ui Thu Oct 17 20:37:48 2019 -0500
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <requires lib="gplugin-gtk" version="0.28"/>
+ <object class="GPluginGtkStore" id="pluginstore"/>
+ <template class="PidginPluginDialog" parent="GtkDialog">
+ <property name="can_focus">False</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <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>
+ <child>
+ <object class="GtkButton" id="configure_plugin_button">
+ <property name="label" translatable="yes">Configure Plugin</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">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="close_button">
+ <property name="label" translatable="yes">Close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">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="homogeneous">True</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GPluginGtkView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">pluginstore</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GPluginGtkPluginInfo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
--- a/pidgin/resources/pidgin.gresource.xml Tue Nov 19 05:03:18 2019 +0000
+++ b/pidgin/resources/pidgin.gresource.xml Thu Oct 17 20:37:48 2019 -0500
@@ -10,6 +10,7 @@
<file compressed="true">Debug/debug.ui</file>
<file compressed="true">Debug/plugininfo.ui</file>
<file compressed="true">Log/log-viewer.ui</file>
+ <file compressed="true">Plugins/dialog.ui</file>
<file compressed="true">Prefs/prefs.ui</file>
<file compressed="true">Prefs/vv.ui</file>
<file compressed="true">Whiteboard/whiteboard.ui</file>