Tue, 30 Aug 2022 04:21:55 -0500
Do our best to set a transient parent for all of our dialogs
Testing Done:
Opened all of the dialogs and verified that the `GWarning` was no where to be found.
Reviewed at https://reviews.imfreedom.org/r/1698/
| 4390 | 1 | /* |
| 15884 | 2 | * Mouse gestures plugin for Purple |
| 4390 | 3 | * |
| 4 | * Copyright (C) 2003 Christian Hammond. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
5 | * |
| 4390 | 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as | |
| 8 | * published by the Free Software Foundation; either version 2 of the | |
| 9 | * License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, but | |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * General Public License for more details. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
15 | * |
| 4390 | 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
19 | * 02111-1301, USA. |
| 4390 | 20 | */ |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
21 | |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
22 | #include <glib/gi18n-lib.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
23 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
24 | #include <purple.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
25 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40497
diff
changeset
|
26 | #include <pidgin.h> |
| 4390 | 27 | |
| 28 | #include "gstroke.h" | |
| 29 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6225
diff
changeset
|
30 | #define GESTURES_PLUGIN_ID "gtk-x11-gestures" |
| 4390 | 31 | |
| 32 | static void | |
| 33 | stroke_close(GtkWidget *widget, void *data) | |
| 34 | { | |
| 15884 | 35 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
36 | PidginConversation *gtkconv; |
| 4390 | 37 | |
| 15884 | 38 | conv = (PurpleConversation *)data; |
| 4390 | 39 | |
| 40 | /* Double-check */ | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
41 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 42 | return; |
| 43 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
44 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 45 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
46 | gstroke_cleanup(gtkconv->history); |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34655
diff
changeset
|
47 | g_object_unref(conv); |
| 4390 | 48 | } |
| 49 | ||
| 50 | static void | |
| 51 | stroke_prev_tab(GtkWidget *widget, void *data) | |
| 52 | { | |
| 15884 | 53 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
54 | PidginConversation *gtkconv; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
55 | GtkWidget *win; |
| 4390 | 56 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
57 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
58 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
59 | win = gtk_widget_get_toplevel(gtkconv->tab_cont); |
| 4390 | 60 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
61 | pidgin_conversation_window_select_previous(PIDGIN_CONVERSATION_WINDOW(win)); |
| 4390 | 62 | } |
| 63 | ||
| 64 | static void | |
| 65 | stroke_next_tab(GtkWidget *widget, void *data) | |
| 66 | { | |
| 15884 | 67 | PurpleConversation *conv; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
68 | PidginConversation *gtkconv; |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
69 | GtkWidget *win; |
| 4390 | 70 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
71 | conv = (PurpleConversation *)data; |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
72 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
73 | win = gtk_widget_get_toplevel(gtkconv->tab_cont); |
| 4390 | 74 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
75 | pidgin_conversation_window_select_next(PIDGIN_CONVERSATION_WINDOW(win)); |
| 4390 | 76 | } |
| 77 | ||
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11592
diff
changeset
|
78 | static void |
| 4390 | 79 | stroke_new_win(GtkWidget *widget, void *data) |
| 80 | { | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
81 | GtkWidget *new_win, *old_win; |
| 15884 | 82 | PurpleConversation *conv; |
| 4390 | 83 | |
| 15884 | 84 | conv = (PurpleConversation *)data; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
85 | old_win = gtk_widget_get_parent(PIDGIN_CONVERSATION(conv)->tab_cont); |
| 4390 | 86 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
87 | if(pidgin_conversation_window_get_count(PIDGIN_CONVERSATION_WINDOW(old_win)) <= 1) { |
| 4390 | 88 | return; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
89 | } |
| 4390 | 90 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
91 | new_win = pidgin_conversation_window_new(); |
| 4390 | 92 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
93 | pidgin_conversation_window_remove(PIDGIN_CONVERSATION_WINDOW(old_win), |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
94 | conv); |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
95 | pidgin_conversation_window_add(PIDGIN_CONVERSATION_WINDOW(new_win), conv); |
| 4390 | 96 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41078
diff
changeset
|
97 | gtk_widget_show_all(new_win); |
| 4390 | 98 | } |
| 99 | ||
| 100 | static void | |
| 15884 | 101 | attach_signals(PurpleConversation *conv) |
| 4390 | 102 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
103 | PidginConversation *gtkconv; |
| 4390 | 104 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
105 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 106 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
107 | gstroke_enable(gtkconv->history); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
108 | gstroke_signal_connect(gtkconv->history, "14789", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
109 | gstroke_signal_connect(gtkconv->history, "1456", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
110 | gstroke_signal_connect(gtkconv->history, "1489", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
111 | gstroke_signal_connect(gtkconv->history, "74123", stroke_next_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
112 | gstroke_signal_connect(gtkconv->history, "7456", stroke_next_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
113 | gstroke_signal_connect(gtkconv->history, "96321", stroke_prev_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
114 | gstroke_signal_connect(gtkconv->history, "9654", stroke_prev_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
115 | gstroke_signal_connect(gtkconv->history, "25852", stroke_new_win, conv); |
| 4390 | 116 | } |
| 117 | ||
| 118 | static void | |
| 15884 | 119 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 120 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
121 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
122 | attach_signals(conv); |
| 4390 | 123 | } |
| 124 | ||
| 125 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
126 | static void |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
127 | mouse_button_menu_cb(GtkComboBox *opt, gpointer data) |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
128 | { |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
129 | int button = gtk_combo_box_get_active(opt); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
130 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
131 | gstroke_set_mouse_button(button + 2); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
132 | } |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
133 | #endif |
| 4390 | 134 | |
| 135 | static void | |
| 136 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 137 | { | |
| 15884 | 138 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
139 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
140 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
141 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
142 | static void |
| 15884 | 143 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
144 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
145 | { |
| 7386 | 146 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 147 | } |
| 148 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
149 | static GtkWidget * |
| 15884 | 150 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 151 | { |
| 152 | GtkWidget *ret; | |
| 153 | GtkWidget *vbox; | |
| 154 | GtkWidget *toggle; | |
| 155 | #if 0 | |
| 156 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
157 | #endif |
| 4390 | 158 | |
| 159 | /* Outside container */ | |
|
35526
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35037
diff
changeset
|
160 | ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18); |
| 4390 | 161 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
| 162 | ||
| 163 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
164 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 165 | |
| 166 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
167 | /* Mouse button drop-down menu */ |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
168 | opt = gtk_combo_box_new_text(); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
169 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
170 | gtk_combo_box_append_text(_("Middle mouse button")); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
171 | gtk_combo_box_append_text(_("Right mouse button")); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
172 | g_signal_connect(G_OBJECT(opt), "changed", |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
173 | G_CALLBACK(mouse_button_menu_cb), NULL); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
174 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
175 | gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
176 | gtk_combo_box_set_active(GTK_COMBO_BOX(opt), |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
177 | gstroke_get_mouse_button() - 2); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
178 | #endif |
| 4390 | 179 | |
| 180 | /* "Visual gesture display" checkbox */ | |
| 181 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 182 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 183 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 184 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 185 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 186 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 187 | ||
| 188 | gtk_widget_show_all(ret); | |
| 189 | ||
| 190 | return ret; | |
| 191 | } | |
| 192 | ||
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40688
diff
changeset
|
193 | static GPluginPluginInfo * |
|
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40688
diff
changeset
|
194 | gestures_query(GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
195 | { |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
196 | const gchar * const authors[] = { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
197 | "Christian Hammond <chipx86@gnupdate.org>", |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
198 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
199 | }; |
| 4390 | 200 | |
|
40688
831547e6738f
Fix an issue where an abi-version was being set twice
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
201 | return pidgin_plugin_info_new( |
|
36935
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
202 | "id", GESTURES_PLUGIN_ID, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
203 | "name", N_("Mouse Gestures"), |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
204 | "version", DISPLAY_VERSION, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
205 | "category", N_("User interface"), |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
206 | "summary", N_("Provides support for mouse gestures"), |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
207 | "description", N_("Allows support for mouse gestures in " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
208 | "conversation windows. Drag the middle " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
209 | "mouse button to perform certain " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
210 | "actions:\n" |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
211 | " • Drag down and then to the right to " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
212 | "close a conversation.\n" |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
213 | " • Drag up and then to the left to " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
214 | "switch to the previous conversation.\n" |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
215 | " • Drag up and then to the right to " |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
216 | "switch to the next conversation."), |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
217 | "authors", authors, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
218 | "website", PURPLE_WEBSITE, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
219 | "abi-version", PURPLE_ABI_VERSION, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
220 | "gtk-config-frame-cb", get_config_frame, |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
221 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
222 | ); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
223 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
224 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
225 | static gboolean |
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40688
diff
changeset
|
226 | gestures_load(GPluginPlugin *plugin, GError **error) |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
227 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
228 | PurpleConversation *conv; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
229 | PurpleConversationManager *manager; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
230 | GList *list; |
|
16749
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
231 | |
| 15884 | 232 | purple_prefs_add_none("/plugins/gtk"); |
| 233 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 234 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 235 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
236 | |
|
35539
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
237 | purple_prefs_connect_callback(plugin, |
|
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
238 | "/plugins/gtk/X11/gestures/visual", visual_pref_cb, NULL); |
|
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
239 | gstroke_set_draw_strokes(purple_prefs_get_bool( |
|
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
240 | "/plugins/gtk/X11/gestures/visual")); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
241 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
242 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
243 | list = purple_conversation_manager_get_all(manager); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
244 | while(list != NULL) { |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
245 | conv = PURPLE_CONVERSATION(list->data); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
246 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
247 | if(!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
248 | list = g_list_delete_link(list, list); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
249 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
250 | continue; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
251 | } |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
252 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
253 | attach_signals(conv); |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
254 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
255 | list = g_list_delete_link(list, list); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
256 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
257 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
258 | purple_signal_connect(purple_conversations_get_handle(), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
259 | "conversation-created", |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41184
diff
changeset
|
260 | plugin, G_CALLBACK(new_conv_cb), NULL); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
261 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
262 | return TRUE; |
| 4390 | 263 | } |
| 264 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
265 | static gboolean |
|
41078
84e48180ef67
Update to gplugin 0.35.0
Gary Kramlich <grim@reaperworld.com>
parents:
40952
diff
changeset
|
266 | gestures_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error) |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
267 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
268 | PurpleConversation *conv; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
269 | PurpleConversationManager *manager; |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
270 | PidginConversation *gtkconv; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
271 | GList *list; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
272 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
273 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
274 | list = purple_conversation_manager_get_all(manager); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
275 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
276 | while(list != NULL) { |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
277 | conv = PURPLE_CONVERSATION(list->data); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
278 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
279 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
280 | list = g_list_delete_link(list, list); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
281 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
282 | continue; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
283 | } |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
284 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
285 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
286 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
287 | gstroke_cleanup(gtkconv->history); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
288 | gstroke_disable(gtkconv->history); |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
289 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
290 | list = g_list_delete_link(list, list); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
291 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
292 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
293 | return TRUE; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
294 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
295 | |
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40688
diff
changeset
|
296 | GPLUGIN_NATIVE_PLUGIN_DECLARE(gestures) |