pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntrequest.c
Go to the documentation of this file.
1 
6 /* finch
7  *
8  * Finch is the legal property of its developers, whose names are too numerous
9  * to list here. Please refer to the COPYRIGHT file distributed with this
10  * source distribution.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25  */
26 #include <internal.h>
27 
28 #include <gnt.h>
29 #include <gntbox.h>
30 #include <gntbutton.h>
31 #include <gntcheckbox.h>
32 #include <gntcombobox.h>
33 #include <gntentry.h>
34 #include <gntfilesel.h>
35 #include <gntlabel.h>
36 #include <gntline.h>
37 #include <gnttree.h>
38 
39 #include "finch.h"
40 #include "gntrequest.h"
41 #include "debug.h"
42 #include "util.h"
43 
44 /* XXX: Until gobjectification ... */
45 #undef FINCH_GET_DATA
46 #undef FINCH_SET_DATA
47 #define FINCH_GET_DATA(obj) purple_request_field_get_ui_data(obj)
48 #define FINCH_SET_DATA(obj, data) purple_request_field_set_ui_data(obj, data)
49 
50 typedef struct
51 {
52  void *user_data;
54  GCallback *cbs;
55  gboolean save;
57 
58 static GntWidget *
59 setup_request_window(const char *title, const char *primary,
60  const char *secondary, PurpleRequestType type)
61 {
63 
68 
69  if (primary)
72  if (secondary)
74 
75  g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(purple_request_close),
76  GINT_TO_POINTER(type));
77 
78  return window;
79 }
80 
85 static void
86 setup_default_callback(GntWidget *window, gpointer default_cb, gpointer data)
87 {
88  if (default_cb == NULL)
89  return;
90  g_object_set_data(G_OBJECT(window), "default-callback", default_cb);
91  g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(default_cb), data);
92 }
93 
94 static void
95 action_performed(GntWidget *button, gpointer data)
96 {
97  g_signal_handlers_disconnect_matched(data, G_SIGNAL_MATCH_FUNC,
98  0, 0, NULL,
99  g_object_get_data(data, "default-callback"),
100  NULL);
101 }
102 
112 static GntWidget *
113 setup_button_box(GntWidget *win, gpointer userdata, gpointer cb, gpointer data, ...)
114 {
115  GntWidget *box;
116  GntWidget *button = NULL;
117  va_list list;
118  const char *text;
119  gpointer callback;
120 
121  box = gnt_hbox_new(FALSE);
122 
123  va_start(list, data);
124 
125  while ((text = va_arg(list, const char *)))
126  {
127  callback = va_arg(list, gpointer);
128  button = gnt_button_new(text);
129  gnt_box_add_widget(GNT_BOX(box), button);
130  g_object_set_data(G_OBJECT(button), "activate-callback", callback);
131  g_object_set_data(G_OBJECT(button), "activate-userdata", userdata);
132  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(action_performed), win);
133  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(cb), data);
134  }
135 
136  if (button)
137  g_object_set_data(G_OBJECT(button), "cancellation-function", GINT_TO_POINTER(TRUE));
138 
139  va_end(list);
140  return box;
141 }
142 
143 static void
145 {
146  PurpleRequestInputCb callback = g_object_get_data(G_OBJECT(button), "activate-callback");
147  gpointer data = g_object_get_data(G_OBJECT(button), "activate-userdata");
148  const char *text = gnt_entry_get_text(GNT_ENTRY(entry));
149 
150  if (callback)
151  callback(data, text);
152 
153  while (button->parent)
154  button = button->parent;
155 
157 }
158 
159 static void *
160 finch_request_input(const char *title, const char *primary,
161  const char *secondary, const char *default_value,
162  gboolean multiline, gboolean masked, gchar *hint,
163  const char *ok_text, GCallback ok_cb,
164  const char *cancel_text, GCallback cancel_cb,
165  PurpleAccount *account, const char *who, PurpleConversation *conv,
166  void *user_data)
167 {
168  GntWidget *window, *box, *entry;
169 
170  window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_INPUT);
171 
172  entry = gnt_entry_new(default_value);
173  if (masked)
176 
177  box = setup_button_box(window, user_data, notify_input_cb, entry,
178  ok_text, ok_cb, cancel_text, cancel_cb, NULL);
180 
183 
184  return window;
185 }
186 
187 static void
189 {
190  GntWidget *widget = GNT_WIDGET(ui_handle);
191  if (type == PURPLE_REQUEST_FIELDS) {
192  PurpleRequestFields *fields = g_object_get_data(G_OBJECT(widget), "fields");
194  }
195 
196  while (widget->parent)
197  widget = widget->parent;
199 }
200 
201 static void
203 {
204  PurpleRequestChoiceCb callback = g_object_get_data(G_OBJECT(button), "activate-callback");
205  gpointer data = g_object_get_data(G_OBJECT(button), "activate-userdata");
206  int choice = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo))) - 1;
207 
208  if (callback)
209  callback(data, choice);
210 
211  while (button->parent)
212  button = button->parent;
213 
215 }
216 
217 static void *
218 finch_request_choice(const char *title, const char *primary,
219  const char *secondary, int default_value,
220  const char *ok_text, GCallback ok_cb,
221  const char *cancel_text, GCallback cancel_cb,
222  PurpleAccount *account, const char *who, PurpleConversation *conv,
223  void *user_data, va_list choices)
224 {
225  GntWidget *window, *combo, *box;
226  const char *text;
227  int val;
228 
229  window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_CHOICE);
230 
231  combo = gnt_combo_box_new();
233  while ((text = va_arg(choices, const char *)))
234  {
235  val = va_arg(choices, int);
236  gnt_combo_box_add_data(GNT_COMBO_BOX(combo), GINT_TO_POINTER(val + 1), text);
237  }
238  gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), GINT_TO_POINTER(default_value + 1));
239 
240  box = setup_button_box(window, user_data, request_choice_cb, combo,
241  ok_text, ok_cb, cancel_text, cancel_cb, NULL);
243 
246 
247  return window;
248 }
249 
250 static void
252 {
253  PurpleRequestActionCb callback = g_object_get_data(G_OBJECT(button), "activate-callback");
254  gpointer data = g_object_get_data(G_OBJECT(button), "activate-userdata");
255  int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "activate-id"));
256 
257  if (callback)
258  callback(data, id);
259 
261 }
262 
263 static void*
264 finch_request_action(const char *title, const char *primary,
265  const char *secondary, int default_value,
266  PurpleAccount *account, const char *who, PurpleConversation *conv,
267  void *user_data, size_t actioncount,
268  va_list actions)
269 {
270  GntWidget *window, *box, *button, *focus = NULL;
271  gsize i;
272 
273  window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_ACTION);
274 
275  box = gnt_hbox_new(FALSE);
277  for (i = 0; i < actioncount; i++)
278  {
279  const char *text = va_arg(actions, const char *);
281 
282  button = gnt_button_new(text);
283  gnt_box_add_widget(GNT_BOX(box), button);
284 
285  g_object_set_data(G_OBJECT(button), "activate-callback", callback);
286  g_object_set_data(G_OBJECT(button), "activate-userdata", user_data);
287  g_object_set_data(G_OBJECT(button), "activate-id", GINT_TO_POINTER(i));
288  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(request_action_cb), window);
289 
290  if (default_value >= 0 && i == (gsize)default_value)
291  focus = button;
292  }
293 
295  if (focus)
297 
298  return window;
299 }
300 
301 static void
303 {
304  PurpleRequestFieldsCb callback = g_object_get_data(G_OBJECT(button), "activate-callback");
305  gpointer data = g_object_get_data(G_OBJECT(button), "activate-userdata");
306  GList *list;
307 
308  /* Update the data of the fields. Pidgin does this differently. Instead of
309  * updating the fields at the end like here, it updates the appropriate field
310  * instantly whenever a change is made. That allows it to make sure the
311  * 'required' fields are entered before the user can hit OK. It's not the case
312  * here, althought it can be done. */
313  for (list = purple_request_fields_get_groups(fields); list; list = list->next)
314  {
315  PurpleRequestFieldGroup *group = list->data;
317 
318  for (; fields ; fields = fields->next)
319  {
320  PurpleRequestField *field = fields->data;
323  continue;
325  {
326  GntWidget *check = FINCH_GET_DATA(field);
329  }
330  else if (type == PURPLE_REQUEST_FIELD_STRING)
331  {
332  GntWidget *entry = FINCH_GET_DATA(field);
333  const char *text = gnt_entry_get_text(GNT_ENTRY(entry));
335  }
337  {
338  GntWidget *entry = FINCH_GET_DATA(field);
339  const char *text = gnt_entry_get_text(GNT_ENTRY(entry));
340  int value = (text && *text) ? atoi(text) : 0;
342  }
343  else if (type == PURPLE_REQUEST_FIELD_CHOICE)
344  {
345  GntWidget *combo = FINCH_GET_DATA(field);
346  int id;
347  id = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo)));
349  }
350  else if (type == PURPLE_REQUEST_FIELD_LIST)
351  {
352  GList *list = NULL, *iter;
354  {
355  GntWidget *tree = FINCH_GET_DATA(field);
356 
358  for (; iter; iter = iter->next)
359  {
360  const char *text = iter->data;
361  gpointer key = purple_request_field_list_get_data(field, text);
362  if (gnt_tree_get_choice(GNT_TREE(tree), key))
363  list = g_list_prepend(list, (gpointer)text);
364  }
365  }
366  else
367  {
368  GntWidget *combo = FINCH_GET_DATA(field);
370 
372  for (; iter; iter = iter->next) {
373  const char *text = iter->data;
374  gpointer key = purple_request_field_list_get_data(field, text);
375  if (key == data) {
376  list = g_list_prepend(list, (gpointer)text);
377  break;
378  }
379  }
380  }
381 
383  g_list_free(list);
384  }
386  {
387  GntWidget *combo = FINCH_GET_DATA(field);
390  }
391  }
392  }
393 
395 
396  if (!g_object_get_data(G_OBJECT(button), "cancellation-function") &&
398  purple_notify_error(button, _("Error"),
399  _("You must fill all the required fields."),
400  _("The required fields are underlined."));
401  return;
402  }
403 
404  if (callback)
405  callback(data, fields);
406 
407  while (button->parent)
408  button = button->parent;
409 
411 }
412 
413 static void
414 update_selected_account(GntEntry *username, const char *start, const char *end,
415  GntComboBox *accountlist)
416 {
417  GList *accounts = gnt_tree_get_rows(GNT_TREE(accountlist->dropdown));
418  const char *name = gnt_entry_get_text(username);
419  while (accounts) {
420  if (purple_find_buddy(accounts->data, name)) {
421  gnt_combo_box_set_selected(accountlist, accounts->data);
422  gnt_widget_draw(GNT_WIDGET(accountlist));
423  break;
424  }
425  accounts = accounts->next;
426  }
427 }
428 
429 static GntWidget*
431 {
432  const char *label = purple_request_field_get_label(field);
436  return check;
437 }
438 
439 static GntWidget*
441 {
442  const char *hint = purple_request_field_get_type_hint(field);
443  GntWidget *entry = gnt_entry_new(
447  if (hint && purple_str_has_prefix(hint, "screenname")) {
449  gboolean offline = purple_str_has_suffix(hint, "all");
452  continue;
454  }
456  if (username)
457  *username = entry;
458  } else if (purple_strequal(hint, "group")) {
460  for (node = purple_blist_get_root(); node;
464  }
465  }
466  return entry;
467 }
468 
469 static GntWidget*
471 {
472  char str[256];
474  GntWidget *entry;
475 
476  snprintf(str, sizeof(str), "%d", val);
477  entry = gnt_entry_new(str);
479  return entry;
480 }
481 
482 static GntWidget*
484 {
485  int id;
486  GList *list;
487  GntWidget *combo = gnt_combo_box_new();
488 
490  for (id = 1; list; list = list->next, id++)
491  {
493  GINT_TO_POINTER(id), list->data);
494  }
496  GINT_TO_POINTER(purple_request_field_choice_get_default_value(field)));
497  return combo;
498 }
499 
500 static GntWidget*
502 {
503  GntWidget *ret = NULL;
504  GList *list;
505  gboolean multi = purple_request_field_list_get_multi_select(field);
506  if (multi)
507  {
509 
511  for (; list; list = list->next)
512  {
513  const char *text = list->data;
514  gpointer key = purple_request_field_list_get_data(field, text);
519  }
520  ret = tree;
521  }
522  else
523  {
524  GntWidget *combo = gnt_combo_box_new();
525 
527  for (; list; list = list->next)
528  {
529  const char *text = list->data;
530  gpointer key = purple_request_field_list_get_data(field, text);
534  }
535  ret = combo;
536  }
537  return ret;
538 }
539 
540 static GntWidget*
542 {
543  gboolean all;
544  PurpleAccount *def;
545  GList *list;
546  GntWidget *combo = gnt_combo_box_new();
547 
550  if (!def)
552 
553  if (all)
554  list = purple_accounts_get_all();
555  else
557 
558  for (; list; list = list->next)
559  {
561  char *text;
562 
563  if (all)
564  account = list->data;
565  else
567 
568  text = g_strdup_printf("%s (%s)",
572  g_free(text);
573  if (account == def)
575  }
576  gnt_widget_set_size(combo, 20, 3); /* ew */
577  return combo;
578 }
579 
580 static void *
581 finch_request_fields(const char *title, const char *primary,
582  const char *secondary, PurpleRequestFields *allfields,
583  const char *ok, GCallback ok_cb,
584  const char *cancel, GCallback cancel_cb,
585  PurpleAccount *account, const char *who, PurpleConversation *conv,
586  void *userdata)
587 {
588  GntWidget *window, *box;
589  GList *grlist;
590  GntWidget *username = NULL, *accountlist = NULL;
591 
592  window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_FIELDS);
593 
594  /* This is how it's going to work: the request-groups are going to be
595  * stacked vertically one after the other. A GntLine will be separating
596  * the groups. */
597  box = gnt_vbox_new(FALSE);
598  gnt_box_set_pad(GNT_BOX(box), 0);
600  for (grlist = purple_request_fields_get_groups(allfields); grlist; grlist = grlist->next)
601  {
602  PurpleRequestFieldGroup *group = grlist->data;
604  GntWidget *hbox;
605  const char *title = purple_request_field_group_get_title(group);
606 
607  if (title)
610 
611  for (; fields ; fields = fields->next)
612  {
613  PurpleRequestField *field = fields->data;
615  const char *label = purple_request_field_get_label(field);
616 
618  continue;
619 
620  hbox = gnt_hbox_new(TRUE); /* hrm */
621  gnt_box_add_widget(GNT_BOX(box), hbox);
622 
624  {
625  GntWidget *l;
628  else
629  l = gnt_label_new(label);
630  gnt_widget_set_size(l, 0, 1);
631  gnt_box_add_widget(GNT_BOX(hbox), l);
632  }
633 
635  {
636  FINCH_SET_DATA(field, create_boolean_field(field));
637  }
638  else if (type == PURPLE_REQUEST_FIELD_STRING)
639  {
640  FINCH_SET_DATA(field, create_string_field(field, &username));
641  }
643  {
644  FINCH_SET_DATA(field, create_integer_field(field));
645  }
646  else if (type == PURPLE_REQUEST_FIELD_CHOICE)
647  {
648  FINCH_SET_DATA(field, create_choice_field(field));
649  }
650  else if (type == PURPLE_REQUEST_FIELD_LIST)
651  {
652  FINCH_SET_DATA(field, create_list_field(field));
653  }
655  {
656  accountlist = create_account_field(field);
657  FINCH_SET_DATA(field, accountlist);
658  }
659  else
660  {
661  FINCH_SET_DATA(field, gnt_label_new_with_format(_("Not implemented yet."),
663  }
666  }
667  if (grlist->next)
669  }
671 
672  box = setup_button_box(window, userdata, request_fields_cb, allfields,
673  ok, ok_cb, cancel, cancel_cb, NULL);
675 
678 
679  if (username && accountlist) {
680  g_signal_connect(username, "completion", G_CALLBACK(update_selected_account), accountlist);
681  }
682 
683  g_object_set_data(G_OBJECT(window), "fields", allfields);
684 
685  return window;
686 }
687 
688 static void
689 file_cancel_cb(gpointer fq, GntWidget *wid)
690 {
691  FinchFileRequest *data = fq;
692  if (data->cbs[1] != NULL)
693  ((PurpleRequestFileCb)data->cbs[1])(data->user_data, NULL);
694 
696 }
697 
698 static void
700 {
701  FinchFileRequest *data = fq;
703  char *dir = g_path_get_dirname(file);
704  if (data->cbs[0] != NULL)
705  ((PurpleRequestFileCb)data->cbs[0])(data->user_data, file);
706  g_free(file);
707  purple_prefs_set_path(data->save ? "/finch/filelocations/last_save_folder" :
708  "/finch/filelocations/last_open_folder", dir);
709  g_free(dir);
710 
712 }
713 
714 static void
716 {
717  g_free(data->cbs);
718  g_free(data);
719 }
720 
721 static FinchFileRequest *
722 finch_file_request_window(const char *title, const char *path,
723  GCallback ok_cb, GCallback cancel_cb,
724  void *user_data)
725 {
728  FinchFileRequest *data = g_new0(FinchFileRequest, 1);
729 
730  data->user_data = user_data;
731  data->cbs = g_new0(GCallback, 2);
732  data->cbs[0] = ok_cb;
733  data->cbs[1] = cancel_cb;
734  data->dialog = window;
736 
738 
739  g_signal_connect(G_OBJECT(sel->cancel), "activate",
740  G_CALLBACK(action_performed), window);
741  g_signal_connect(G_OBJECT(sel->select), "activate",
742  G_CALLBACK(action_performed), window);
743  g_signal_connect_swapped(G_OBJECT(sel->cancel), "activate",
744  G_CALLBACK(file_cancel_cb), data);
745  g_signal_connect_swapped(G_OBJECT(sel->select), "activate",
746  G_CALLBACK(file_ok_cb), data);
747 
749  g_object_set_data_full(G_OBJECT(window), "filerequestdata", data,
750  (GDestroyNotify)file_request_destroy);
751 
752  return data;
753 }
754 
755 static void *
756 finch_request_file(const char *title, const char *filename,
757  gboolean savedialog,
758  GCallback ok_cb, GCallback cancel_cb,
759  PurpleAccount *account, const char *who, PurpleConversation *conv,
760  void *user_data)
761 {
763  const char *path;
764 
765  path = purple_prefs_get_path(savedialog ? "/finch/filelocations/last_save_folder" : "/finch/filelocations/last_open_folder");
766  data = finch_file_request_window(title ? title : (savedialog ? _("Save File...") : _("Open File...")), path,
767  ok_cb, cancel_cb, user_data);
768  data->save = savedialog;
769  if (savedialog)
771 
772  gnt_widget_show(data->dialog);
773  return data->dialog;
774 }
775 
776 static void *
777 finch_request_folder(const char *title, const char *dirname, GCallback ok_cb,
778  GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv,
779  void *user_data)
780 {
782 
783  data = finch_file_request_window(title ? title : _("Choose Location..."), dirname,
784  ok_cb, cancel_cb, user_data);
785  data->save = TRUE;
787 
788  gnt_widget_show(data->dialog);
789  return data->dialog;
790 }
791 
793 {
801  NULL,
802  NULL,
803  NULL,
804  NULL
805 };
806 
808 {
809  return &uiops;
810 }
811 
813 {
814 }
815 
817 {
818 }
819 
820 void finch_request_save_in_prefs(gpointer null, PurpleRequestFields *allfields)
821 {
822  GList *list;
823  for (list = purple_request_fields_get_groups(allfields); list; list = list->next) {
824  PurpleRequestFieldGroup *group = list->data;
826 
827  for (; fields ; fields = fields->next) {
828  PurpleRequestField *field = fields->data;
830  PurplePrefType pt;
831  gpointer val = NULL;
832  const char *id = purple_request_field_get_id(field);
833 
834  switch (type) {
836  val = purple_request_field_list_get_selected(field)->data;
837  val = purple_request_field_list_get_data(field, val);
838  break;
840  val = GINT_TO_POINTER(purple_request_field_bool_get_value(field));
841  break;
843  val = GINT_TO_POINTER(purple_request_field_int_get_value(field));
844  break;
846  val = (gpointer)purple_request_field_string_get_value(field);
847  break;
848  default:
849  break;
850  }
851 
852  pt = purple_prefs_get_type(id);
853  switch (pt) {
854  case PURPLE_PREF_INT:
855  {
856  long int tmp = GPOINTER_TO_INT(val);
858  /* Lists always return string */
859  if (sscanf(val, "%ld", &tmp) != 1)
860  tmp = 0;
861  }
862  purple_prefs_set_int(id, (gint)tmp);
863  break;
864  }
865  case PURPLE_PREF_BOOLEAN:
866  purple_prefs_set_bool(id, GPOINTER_TO_INT(val));
867  break;
868  case PURPLE_PREF_STRING:
869  purple_prefs_set_string(id, val);
870  break;
871  default:
872  break;
873  }
874  }
875  }
876 }
877 
879 {
880  GntWidget *ret = NULL;
881  switch (purple_request_field_get_type(field)) {
883  ret = create_boolean_field(field);
884  break;
886  ret = create_string_field(field, NULL);
887  break;
889  ret = create_integer_field(field);
890  break;
892  ret = create_choice_field(field);
893  break;
895  ret = create_list_field(field);
896  break;
898  ret = create_account_field(field);
899  break;
900  default:
901  purple_debug_error("GntRequest", "Unimplemented request-field %d\n", purple_request_field_get_type(field));
902  break;
903  }
904  return ret;
905 }
906 
purple_prefs_set_string
void purple_prefs_set_string(const char *name, const char *value)
Definition: prefs.c:948
check
static int check
Definition: filectl.c:29
gnt_widget_set_size
gboolean gnt_widget_set_size(GntWidget *widget, int width, int height)
Definition: gntwidget.c:515
name
char * name
Definition: gntbindable.c:47
purple_request_field_list_get_items
GList * purple_request_field_list_get_items(const PurpleRequestField *field)
Definition: request.c:984
FinchFileRequest
Definition: gntrequest.c:50
purple_request_field_choice_get_default_value
int purple_request_field_choice_get_default_value(const PurpleRequestField *field)
Definition: request.c:775
purple_request_field_int_get_value
int purple_request_field_int_get_value(const PurpleRequestField *field)
Definition: request.c:664
create_account_field
static GntWidget * create_account_field(PurpleRequestField *field)
Definition: gntrequest.c:541
finch_close_request
static void finch_close_request(PurpleRequestType type, gpointer ui_handle)
Definition: gntrequest.c:188
gnt_box_set_pad
void gnt_box_set_pad(GntBox *box, int pad)
Definition: gntbox.c:695
PURPLE_REQUEST_CHOICE
Definition: request.h:46
purple_blist_node_next
PurpleBlistNode * purple_blist_node_next(PurpleBlistNode *node, gboolean offline)
Definition: blist.c:845
account
static PurpleAccount * account
Definition: raw.c:45
_GntFileSel::cancel
GntWidget * cancel
Definition: gntfilesel.h:60
purple_strequal
gboolean purple_strequal(const gchar *left, const gchar *right)
purple_notify_error
#define purple_notify_error(handle, title, primary, secondary)
Definition: notify.h:756
create_list_field
static GntWidget * create_list_field(PurpleRequestField *field)
Definition: gntrequest.c:501
gnt_file_sel_set_dirs_only
void gnt_file_sel_set_dirs_only(GntFileSel *sel, gboolean dirs)
Definition: gntfilesel.c:719
group
#define group
Definition: module.h:7
purple_request_field_get_label
const char * purple_request_field_get_label(const PurpleRequestField *field)
Definition: request.c:482
purple_notify_close_with_handle
void purple_notify_close_with_handle(void *handle)
Definition: notify.c:747
FINCH_GET_DATA
#define FINCH_GET_DATA(obj)
Definition: gntrequest.c:47
purple_account_get_username
const char * purple_account_get_username(const PurpleAccount *account)
Definition: account.c:2225
gnt_widget_show
void gnt_widget_show(GntWidget *widget)
Definition: gntwidget.c:326
finch_request_field_get_widget
GntWidget * finch_request_field_get_widget(PurpleRequestField *field)
Definition: gntrequest.c:878
finch_request_action
static void * finch_request_action(const char *title, const char *primary, const char *secondary, int default_value, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t actioncount, va_list actions)
Definition: gntrequest.c:264
gntbox.h
gnt_tree_get_choice
gboolean gnt_tree_get_choice(GntTree *tree, void *key)
Definition: gnttree.c:1624
purple_request_field_account_set_value
void purple_request_field_account_set_value(PurpleRequestField *field, PurpleAccount *value)
Definition: request.c:1114
finch_file_request_window
static FinchFileRequest * finch_file_request_window(const char *title, const char *path, GCallback ok_cb, GCallback cancel_cb, void *user_data)
Definition: gntrequest.c:722
gnt_combo_box_new
GntWidget * gnt_combo_box_new()
Definition: gntcombobox.c:350
create_choice_field
static GntWidget * create_choice_field(PurpleRequestField *field)
Definition: gntrequest.c:483
purple_request_field_is_required
gboolean purple_request_field_is_required(const PurpleRequestField *field)
Definition: request.c:506
PURPLE_REQUEST_FILE
Definition: request.h:49
FinchFileRequest::cbs
GCallback * cbs
Definition: gntrequest.c:54
GNT_COMBO_BOX
#define GNT_COMBO_BOX(obj)
Definition: gntcombobox.h:36
purple_request_field_account_get_value
PurpleAccount * purple_request_field_account_get_value(const PurpleRequestField *field)
Definition: request.c:1171
file
char * file
Definition: gnttextview.c:855
FinchFileRequest::dialog
GntWidget * dialog
Definition: gntrequest.c:53
notify_input_cb
static void notify_input_cb(GntWidget *button, GntWidget *entry)
Definition: gntrequest.c:144
PURPLE_PREF_BOOLEAN
Definition: prefs.h:38
finch_request_get_ui_ops
PurpleRequestUiOps * finch_request_get_ui_ops()
Definition: gntrequest.c:807
gnt_label_new
GntWidget * gnt_label_new(const char *text)
Definition: gntlabel.c:186
purple_request_field_int_get_default_value
int purple_request_field_int_get_default_value(const PurpleRequestField *field)
Definition: request.c:655
widget
GtkWidget * widget
Definition: pidgintooltip.c:38
PURPLE_REQUEST_FIELD_ACCOUNT
Definition: request.h:67
_GntWidget
Definition: gntwidget.h:98
file_ok_cb
static void file_ok_cb(gpointer fq, GntWidget *widget)
Definition: gntrequest.c:699
gnt.h
gntrequest.h
purple_debug_error
void purple_debug_error(const char *category, const char *format,...)
Definition: debug.c:145
purple_buddy_get_name
const char * purple_buddy_get_name(const PurpleBuddy *buddy)
Definition: blist.c:1449
purple_group_get_name
const char * purple_group_get_name(PurpleGroup *group)
Definition: blist.c:2808
purple_request_field_get_type
PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field)
Definition: request.c:458
window
GntWidget * window
Definition: gntcertmgr.c:45
PURPLE_PREF_INT
Definition: prefs.h:39
setup_request_window
static GntWidget * setup_request_window(const char *title, const char *primary, const char *secondary, PurpleRequestType type)
Definition: gntrequest.c:59
gnt_tree_new
GntWidget * gnt_tree_new()
Definition: gnttree.c:1194
gnt_vbox_new
#define gnt_vbox_new(homo)
Definition: gntbox.h:96
PURPLE_REQUEST_FIELD_STRING
Definition: request.h:60
purple_request_field_account_get_default_value
PurpleAccount * purple_request_field_account_get_default_value(const PurpleRequestField *field)
Definition: request.c:1162
gnt_combo_box_set_selected
void gnt_combo_box_set_selected(GntComboBox *box, gpointer key)
Definition: gntcombobox.c:370
_
void boot_DynaLoader _((pTHX_ CV *cv))
request_action_cb
static void request_action_cb(GntWidget *button, GntWidget *window)
Definition: gntrequest.c:251
purple_request_field_string_set_value
void purple_request_field_string_set_value(PurpleRequestField *field, const char *value)
Definition: request.c:545
create_boolean_field
static GntWidget * create_boolean_field(PurpleRequestField *field)
Definition: gntrequest.c:430
purple_prefs_get_type
PurplePrefType purple_prefs_get_type(const char *name)
Definition: prefs.c:1096
GNT_BOX
#define GNT_BOX(obj)
Definition: gntbox.h:34
gntentry.h
gnt_file_sel_get_selected_file
char * gnt_file_sel_get_selected_file(GntFileSel *sel)
Definition: gntfilesel.c:735
gnt_box_add_widget
void gnt_box_add_widget(GntBox *b, GntWidget *widget)
Definition: gntbox.c:674
finch_request_init
void finch_request_init()
Definition: gntrequest.c:812
action_performed
static void action_performed(GntWidget *button, gpointer data)
Definition: gntrequest.c:95
gnt_button_new
GntWidget * gnt_button_new(const char *text)
Definition: gntbutton.c:170
PurpleRequestFileCb
void(* PurpleRequestFileCb)(void *, const char *filename)
Definition: request.h:263
_GntComboBox
Definition: gntcombobox.h:50
purple_request_field_account_get_show_all
gboolean purple_request_field_account_get_show_all(const PurpleRequestField *field)
Definition: request.c:1180
uiops
static PurpleRequestUiOps uiops
Definition: gntrequest.c:792
GNT_ALIGN_MID
Definition: gntbox.h:49
create_integer_field
static GntWidget * create_integer_field(PurpleRequestField *field)
Definition: gntrequest.c:470
_GntComboBox::dropdown
GntWidget * dropdown
Definition: gntcombobox.h:54
PurpleRequestActionCb
void(* PurpleRequestActionCb)(void *, int)
Definition: request.h:260
FinchFileRequest::save
gboolean save
Definition: gntrequest.c:55
finch_request_choice
static void * finch_request_choice(const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, va_list choices)
Definition: gntrequest.c:218
actions
static GList * actions(PurplePlugin *plugin, gpointer context)
Definition: idle.c:249
purple_prefs_set_bool
void purple_prefs_set_bool(const char *name, gboolean value)
Definition: prefs.c:898
purple_blist_get_root
PurpleBlistNode * purple_blist_get_root()
Definition: blist.c:769
purple_str_has_prefix
gboolean purple_str_has_prefix(const char *s, const char *p)
str
static char str[256]
Definition: util.c:28
purple_find_buddy
PurpleBuddy * purple_find_buddy(PurpleAccount *account, const char *name)
Definition: blist.c:2427
purple_request_field_get_type_hint
const char * purple_request_field_get_type_hint(const PurpleRequestField *field)
Definition: request.c:498
purple_blist_node_get_sibling_next
PurpleBlistNode * purple_blist_node_get_sibling_next(PurpleBlistNode *node)
Definition: blist.c:870
PurplePrefType
enum _PurplePrefType PurplePrefType
gntlabel.h
data
gpointer data
Definition: gntwm.c:1781
purple_str_has_suffix
gboolean purple_str_has_suffix(const char *s, const char *x)
GNT_TEXT_FLAG_BOLD
Definition: gnttextview.h:71
purple_request_field_bool_get_value
gboolean purple_request_field_bool_get_value(const PurpleRequestField *field)
Definition: request.c:718
request_fields_cb
static void request_fields_cb(GntWidget *button, PurpleRequestFields *fields)
Definition: gntrequest.c:302
finch_request_uninit
void finch_request_uninit()
Definition: gntrequest.c:816
gnt_tree_set_choice
void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set)
Definition: gnttree.c:1612
offline
static PurpleBlistNode offline
Definition: grouping.c:37
NULL
#define NULL
Definition: getopt1.c:52
PURPLE_REQUEST_FIELD_INTEGER
Definition: request.h:61
gnt_tree_get_rows
GList * gnt_tree_get_rows(GntTree *tree)
Definition: gnttree.c:1216
GNT_TREE
#define GNT_TREE(obj)
Definition: gnttree.h:37
gnt_file_sel_set_suggested_filename
void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest)
Definition: gntfilesel.c:729
purple_request_field_list_get_data
void * purple_request_field_list_get_data(const PurpleRequestField *field, const char *text)
Definition: request.c:839
create_string_field
static GntWidget * create_string_field(PurpleRequestField *field, GntWidget **username)
Definition: gntrequest.c:440
GNT_CHECK_BOX
#define GNT_CHECK_BOX(obj)
Definition: gntcheckbox.h:36
gnt_check_box_set_checked
void gnt_check_box_set_checked(GntCheckBox *box, gboolean set)
Definition: gntcheckbox.c:164
PURPLE_PREF_STRING
Definition: prefs.h:40
gntcombobox.h
purple_request_field_string_is_masked
gboolean purple_request_field_string_is_masked(const PurpleRequestField *field)
Definition: request.c:601
gnt_check_box_new
GntWidget * gnt_check_box_new(const char *text)
Definition: gntcheckbox.c:154
gnt_box_give_focus_to_child
void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
Definition: gntbox.c:881
gnt_box_set_toplevel
void gnt_box_set_toplevel(GntBox *box, gboolean set)
Definition: gntbox.c:701
purple_request_field_list_get_multi_select
gboolean purple_request_field_list_get_multi_select(const PurpleRequestField *field)
Definition: request.c:830
purple_request_field_list_is_selected
gboolean purple_request_field_list_is_selected(const PurpleRequestField *field, const char *item)
Definition: request.c:963
FINCH_SET_DATA
#define FINCH_SET_DATA(obj, data)
Definition: gntrequest.c:48
gnt_file_sel_new
GntWidget * gnt_file_sel_new(void)
Definition: gntfilesel.c:691
PurpleRequestFieldType
PurpleRequestFieldType
Definition: request.h:57
gnt_check_box_get_checked
gboolean gnt_check_box_get_checked(GntCheckBox *box)
Definition: gntcheckbox.c:173
gnt_entry_set_masked
void gnt_entry_set_masked(GntEntry *entry, gboolean set)
Definition: gntentry.c:1177
gntbutton.h
GNT_WIDGET
#define GNT_WIDGET(obj)
Definition: gntwidget.h:37
accounts
static FinchAccountList accounts
Definition: gntaccount.c:61
setup_button_box
static GntWidget * setup_button_box(GntWidget *win, gpointer userdata, gpointer cb, gpointer data,...)
Definition: gntrequest.c:113
TRUE
#define TRUE
Definition: protobuf-c.c:56
_PurpleAccount
Definition: account.h:169
purple_request_field_bool_set_value
void purple_request_field_bool_set_value(PurpleRequestField *field, gboolean value)
Definition: request.c:700
dbus-analyze-signals.type
string type
Definition: dbus-analyze-signals.py:42
_PurpleBlistNode
Definition: blist.h:124
purple_prefs_get_path
const char * purple_prefs_get_path(const char *name)
Definition: prefs.c:1204
gnt_tree_add_choice
GntTreeRow * gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro)
Definition: gnttree.c:1584
PURPLE_REQUEST_FIELDS
Definition: request.h:48
gnt_entry_set_always_suggest
void gnt_entry_set_always_suggest(GntEntry *entry, gboolean always)
Definition: gntentry.c:1244
snprintf
#define snprintf
Definition: libc_interface.h:136
GNT_ENTRY_FLAG_INT
Definition: gntentry.h:57
FALSE
#define FALSE
Definition: protobuf-c.c:57
PURPLE_REQUEST_ACTION
Definition: request.h:47
purple_request_fields_get_groups
GList * purple_request_fields_get_groups(const PurpleRequestFields *fields)
Definition: request.c:103
purple_request_close
void purple_request_close(PurpleRequestType type, void *ui_handle)
Definition: request.c:1521
cancel_cb
static void cancel_cb(GntWidget *w, PurpleGntPounceDialog *dialog)
Definition: gntpounce.c:121
gnt_label_new_with_format
GntWidget * gnt_label_new_with_format(const char *text, GntTextFormatFlags flags)
Definition: gntlabel.c:191
purple_request_field_list_set_selected
void purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
Definition: request.c:933
update_selected_account
static void update_selected_account(GntEntry *username, const char *start, const char *end, GntComboBox *accountlist)
Definition: gntrequest.c:414
gnt_box_set_title
void gnt_box_set_title(GntBox *b, const char *title)
Definition: gntbox.c:680
text
static char * text[]
Definition: zephyr_err.c:10
request_choice_cb
static void request_choice_cb(GntWidget *button, GntComboBox *combo)
Definition: gntrequest.c:202
finch_request_save_in_prefs
void finch_request_save_in_prefs(gpointer null, PurpleRequestFields *allfields)
Definition: gntrequest.c:820
label
const char * label
Definition: jabber.c:1321
PURPLE_REQUEST_FIELD_CHOICE
Definition: request.h:63
PURPLE_BLIST_NODE_IS_BUDDY
gboolean PURPLE_BLIST_NODE_IS_BUDDY(PurpleBlistNode *node)
_PurpleGroup
Definition: blist.h:167
purple_prefs_set_path
void purple_prefs_set_path(const char *name, const char *value)
Definition: prefs.c:1019
purple_request_field_get_id
const char * purple_request_field_get_id(const PurpleRequestField *field)
Definition: request.c:474
purple_request_field_choice_set_value
void purple_request_field_choice_set_value(PurpleRequestField *field, int value)
Definition: request.c:765
PurpleRequestChoiceCb
void(* PurpleRequestChoiceCb)(void *, int)
Definition: request.h:261
gnt_combo_box_get_selected_data
gpointer gnt_combo_box_get_selected_data(GntComboBox *box)
Definition: gntcombobox.c:365
purple_connection_get_account
PurpleAccount * purple_connection_get_account(const PurpleConnection *gc)
Definition: connection.c:440
purple_request_field_group_get_fields
GList * purple_request_field_group_get_fields(const PurpleRequestFieldGroup *group)
Definition: request.c:333
GNT_TEXT_FLAG_UNDERLINE
Definition: gnttextview.h:72
_PurpleRequestField
Definition: request.h:103
PURPLE_REQUEST_FIELD_BOOLEAN
Definition: request.h:62
purple_prefs_set_int
void purple_prefs_set_int(const char *name, int value)
Definition: prefs.c:923
purple_account_get_protocol_name
const char * purple_account_get_protocol_name(const PurpleAccount *account)
Definition: account.c:2272
tree
GntWidget * tree
Definition: gntcertmgr.c:46
purple_request_field_group_get_title
const char * purple_request_field_group_get_title(const PurpleRequestFieldGroup *group)
Definition: request.c:325
finch_request_folder
static void * finch_request_folder(const char *title, const char *dirname, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:777
gnt_widget_destroy
void gnt_widget_destroy(GntWidget *obj)
Definition: gntwidget.c:312
PurpleRequestFields
Definition: request.h:74
PurpleRequestFieldGroup
Definition: request.h:89
purple_request_field_int_set_value
void purple_request_field_int_set_value(PurpleRequestField *field, int value)
Definition: request.c:646
purple_home_dir
const gchar * purple_home_dir(void)
gnt_widget_draw
void gnt_widget_draw(GntWidget *widget)
Definition: gntwidget.c:335
purple_request_fields_all_required_filled
gboolean purple_request_fields_all_required_filled(const PurpleRequestFields *fields)
Definition: request.c:160
PurpleRequestType
PurpleRequestType
Definition: request.h:43
GNT_FILE_SEL
#define GNT_FILE_SEL(obj)
Definition: gntfilesel.h:36
purple_accounts_get_all
GList * purple_accounts_get_all(void)
Definition: account.c:3082
gntcheckbox.h
finch_request_input
static void * finch_request_input(const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:160
PURPLE_REQUEST_INPUT
Definition: request.h:45
gnt_hbox_new
#define gnt_hbox_new(homo)
Definition: gntbox.h:97
_GntWidget::parent
GntWidget * parent
Definition: gntwidget.h:102
setup_default_callback
static void setup_default_callback(GntWidget *window, gpointer default_cb, gpointer data)
Definition: gntrequest.c:86
pietray.path
path
Definition: pietray.py:186
_PurpleConversation
Definition: conversation.h:338
gnt_entry_add_suggest
void gnt_entry_add_suggest(GntEntry *entry, const char *text)
Definition: gntentry.c:1249
gnt_entry_get_text
const char * gnt_entry_get_text(GntEntry *entry)
Definition: gntentry.c:1163
finch.h
PURPLE_BLIST_NODE_IS_GROUP
gboolean PURPLE_BLIST_NODE_IS_GROUP(PurpleBlistNode *node)
PURPLE_REQUEST_FIELD_LIST
Definition: request.h:64
purple_request_field_is_visible
gboolean purple_request_field_is_visible(const PurpleRequestField *field)
Definition: request.c:490
gntline.h
value
gpointer value
Definition: gntwm.c:1782
purple_request_fields_destroy
void purple_request_fields_destroy(PurpleRequestFields *fields)
Definition: request.c:60
dbus-buddyicons-example.node
node
Definition: dbus-buddyicons-example.py:32
finch_request_file
static void * finch_request_file(const char *title, const char *filename, gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Definition: gntrequest.c:756
gnttree.h
GNT_ENTRY
#define GNT_ENTRY(obj)
Definition: gntentry.h:36
PurpleRequestInputCb
void(* PurpleRequestInputCb)(void *, const char *)
Definition: request.h:254
gnt_file_sel_set_current_location
gboolean gnt_file_sel_set_current_location(GntFileSel *sel, const char *path)
Definition: gntfilesel.c:697
gnt_tree_create_row
GntTreeRow * gnt_tree_create_row(GntTree *tree,...)
Definition: gnttree.c:1728
purple_request_field_string_get_value
const char * purple_request_field_string_get_value(const PurpleRequestField *field)
Definition: request.c:583
purple_request_field_list_get_selected
GList * purple_request_field_list_get_selected(const PurpleRequestField *field)
Definition: request.c:975
util.h
_PurpleBuddy
Definition: blist.h:138
purple_request_field_bool_get_default_value
gboolean purple_request_field_bool_get_default_value(const PurpleRequestField *field)
Definition: request.c:709
finch_request_fields
static void * finch_request_fields(const char *title, const char *primary, const char *secondary, PurpleRequestFields *allfields, const char *ok, GCallback ok_cb, const char *cancel, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *userdata)
Definition: gntrequest.c:581
gnt_combo_box_add_data
void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text)
Definition: gntcombobox.c:357
purple_connections_get_all
GList * purple_connections_get_all(void)
Definition: connection.c:665
gnt_entry_new
GntWidget * gnt_entry_new(const char *text)
Definition: gntentry.c:1093
purple_request_field_string_get_default_value
const char * purple_request_field_string_get_default_value(const PurpleRequestField *field)
Definition: request.c:574
PurpleRequestFieldsCb
void(* PurpleRequestFieldsCb)(void *, PurpleRequestFields *fields)
Definition: request.h:262
file_cancel_cb
static void file_cancel_cb(gpointer fq, GntWidget *wid)
Definition: gntrequest.c:689
file_request_destroy
static void file_request_destroy(FinchFileRequest *data)
Definition: gntrequest.c:715
gnt_box_set_fill
void gnt_box_set_fill(GntBox *box, gboolean fill)
Definition: gntbox.c:849
_GntFileSel
Definition: gntfilesel.h:51
gnt_entry_set_flag
void gnt_entry_set_flag(GntEntry *entry, GntEntryFlag flag)
Definition: gntentry.c:1157
gnt_box_set_alignment
void gnt_box_set_alignment(GntBox *box, GntAlignment alignment)
Definition: gntbox.c:775
FinchFileRequest::user_data
void * user_data
Definition: gntrequest.c:52
_GntEntry
Definition: gntentry.h:65
gntfilesel.h
_GntFileSel::select
GntWidget * select
Definition: gntfilesel.h:59
purple_request_field_choice_get_labels
GList * purple_request_field_choice_get_labels(const PurpleRequestField *field)
Definition: request.c:793
gnt_hline_new
#define gnt_hline_new()
Definition: gntline.h:74
PurpleRequestUiOps
Definition: request.h:190