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)  

gntstatus.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 <gntcombobox.h>
32 #include <gntentry.h>
33 #include <gntlabel.h>
34 #include <gntline.h>
35 #include <gnttree.h>
36 #include <gntutils.h>
37 
38 #include "finch.h"
39 
40 #include <notify.h>
41 #include <request.h>
42 
43 #include "gntstatus.h"
44 
45 static struct
46 {
49 } statuses;
50 
51 typedef struct
52 {
59  GHashTable *hash; /* list of windows for substatuses */
60 } EditStatus;
61 
62 typedef struct
63 {
66  char *message;
67 } RowInfo;
68 
69 typedef struct
70 {
74 
78 
79 static GList *edits; /* List of opened edit-status dialogs */
80 
81 static void
83 {
84  statuses.window = NULL;
85  statuses.tree = NULL;
86 }
87 
88 static void
90 {
91  GList *list;
92 
93  for (list = purple_savedstatuses_get_all(); list; list = list->next)
94  {
95  PurpleSavedStatus *saved = list->data;
96  const char *title, *type, *message;
97 
99  continue;
100 
101  title = purple_savedstatus_get_title(saved);
103  message = purple_savedstatus_get_message(saved); /* XXX: Strip possible markups */
104 
106  gnt_tree_create_row(tree, title, type, message), NULL);
107  }
108 }
109 
110 static void
112 {
113  GList *iter;
114 
115  for (iter = edits; iter; iter = iter->next)
116  {
117  EditStatus *edit = iter->data;
118  if (edit->saved == saved)
119  {
120  gnt_widget_destroy(edit->window);
121  break;
122  }
123  }
124 
125  if (statuses.tree)
126  gnt_tree_remove(GNT_TREE(statuses.tree), saved);
127 
129 }
130 
131 static void
132 ask_before_delete(GntWidget *button, gpointer null)
133 {
134  char *ask;
135  PurpleSavedStatus *saved;
136 
137  g_return_if_fail(statuses.tree != NULL);
138 
140  ask = g_strdup_printf(_("Are you sure you want to delete \"%s\""),
142 
143  purple_request_action(saved, _("Delete Status"), ask, NULL, 0,
144  NULL, NULL, NULL,
145  saved, 2,
146  _("Delete"), really_delete_status,
147  _("Cancel"), NULL);
148  g_free(ask);
149 }
150 
151 static void
153 {
154  g_return_if_fail(statuses.tree != NULL);
155 
157 }
158 
159 static void
161 {
162  g_return_if_fail(statuses.tree != NULL);
163 
165 }
166 
168 {
169  GntWidget *window, *tree, *box, *button;
170  int widths[] = {25, 12, 35};
171  if (statuses.window) {
173  return;
174  }
175 
176  statuses.window = window = gnt_vbox_new(FALSE);
178  gnt_box_set_title(GNT_BOX(window), _("Saved Statuses"));
182 
183  /* XXX: Add some sorting function to sort alphabetically, perhaps */
185  gnt_tree_set_column_titles(GNT_TREE(tree), _("Title"), _("Type"), _("Message"));
188  gnt_widget_set_size(tree, 72, 0);
190 
192 
193  box = gnt_hbox_new(FALSE);
195 
196  button = gnt_button_new(_("Use"));
197  gnt_box_add_widget(GNT_BOX(box), button);
198  g_signal_connect(G_OBJECT(button), "activate",
199  G_CALLBACK(use_savedstatus_cb), NULL);
200 
201  button = gnt_button_new(_("Add"));
202  gnt_box_add_widget(GNT_BOX(box), button);
204  g_signal_connect_swapped(G_OBJECT(button), "activate",
205  G_CALLBACK(finch_savedstatus_edit), NULL);
206 
207  button = gnt_button_new(_("Edit"));
208  gnt_box_add_widget(GNT_BOX(box), button);
209  g_signal_connect(G_OBJECT(button), "activate",
210  G_CALLBACK(edit_savedstatus_cb), NULL);
211 
212  button = gnt_button_new(_("Delete"));
213  gnt_box_add_widget(GNT_BOX(box), button);
215  g_signal_connect(G_OBJECT(button), "activate",
216  G_CALLBACK(ask_before_delete), NULL);
217 
218  button = gnt_button_new(_("Close"));
219  gnt_box_add_widget(GNT_BOX(box), button);
220  g_signal_connect_swapped(G_OBJECT(button), "activate",
221  G_CALLBACK(gnt_widget_destroy), window);
222 
223  g_signal_connect(G_OBJECT(window), "destroy",
224  G_CALLBACK(reset_status_window), NULL);
226 }
227 
228 static void
230 {
231  gnt_widget_destroy(sub->window); /* the "destroy" callback will remove entry from the hashtable */
232 }
233 
234 static void
235 free_key(gpointer key, gpointer n)
236 {
237  RowInfo *row = key;
238  g_free(row->message);
239  g_free(key);
240 }
241 
242 
243 static void
245 {
246  edits = g_list_remove(edits, edit);
248  g_hash_table_foreach(edit->hash, (GHFunc)destroy_substatus_win, NULL);
249  g_list_foreach((GList*)gnt_tree_get_rows(GNT_TREE(edit->tree)), free_key, NULL);
250  g_free(edit);
251 }
252 
253 static void
255 {
256  GList *iter;
257  for (iter = gnt_tree_get_rows(GNT_TREE(edit->tree)); iter; iter = iter->next) {
258  RowInfo *key = iter->data;
259  if (gnt_tree_get_choice(GNT_TREE(edit->tree), key)) {
260  purple_savedstatus_set_substatus(edit->saved, key->account, key->type, key->message);
261  }
262  }
263 }
264 
265 
266 static void
268 {
269  const char *message;
271  PurpleSavedStatus *saved;
272 
273  message = gnt_entry_get_text(GNT_ENTRY(edit->message));
274  prim = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(edit->type)));
275 
277  if (saved == NULL) {
278  saved = purple_savedstatus_new(NULL, prim);
279  edit->saved = saved;
280  set_substatuses(edit);
281  }
282  purple_savedstatus_set_message(saved, message);
284  gnt_widget_destroy(edit->window);
285 }
286 
287 static void
289 {
290  const char *title, *message;
292  PurpleSavedStatus *find;
293 
294  title = gnt_entry_get_text(GNT_ENTRY(edit->title));
295  message = gnt_entry_get_text(GNT_ENTRY(edit->message));
296  if (!message || !*message)
297  message = NULL;
298 
299  prim = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(edit->type)));
300 
301  if (!title || !*title)
302  {
303  purple_notify_error(edit, _("Error"), _("Invalid title"),
304  _("Please enter a non-empty title for the status."));
306  return;
307  }
308 
309  find = purple_savedstatus_find(title);
310  if (find && find != edit->saved)
311  {
312  purple_notify_error(edit, _("Error"), _("Duplicate title"),
313  _("Please enter a different title for the status."));
315  return;
316  }
317 
318  if (edit->saved == NULL)
319  {
320  edit->saved = purple_savedstatus_new(title, prim);
321  purple_savedstatus_set_message(edit->saved, message);
322  set_substatuses(edit);
323  if (statuses.tree)
326  purple_primitive_get_name_from_type(prim), message), NULL);
327  }
328  else
329  {
330  purple_savedstatus_set_title(edit->saved, title);
331  purple_savedstatus_set_type(edit->saved, prim);
332  purple_savedstatus_set_message(edit->saved, message);
333  if (statuses.tree)
334  {
335  gnt_tree_change_text(GNT_TREE(statuses.tree), edit->saved, 0, title);
338  gnt_tree_change_text(GNT_TREE(statuses.tree), edit->saved, 2, message);
339  }
340  }
341 
342  if (g_object_get_data(G_OBJECT(button), "use"))
344 
345  gnt_widget_destroy(edit->window);
346 }
347 
348 static void
350 {
351  char *name;
352  const char *type = NULL, *message = NULL;
353  PurpleSavedStatusSub *sub = NULL;
354  RowInfo *key;
355 
356  if (!edit || !edit->tree)
357  return;
358 
359  if (edit->saved)
361 
362  key = g_new0(RowInfo, 1);
363  key->account = account;
364 
365  if (sub)
366  {
370  key->message = g_strdup(message);
371  }
372 
373  name = g_strdup_printf("%s (%s)", purple_account_get_username(account),
375  gnt_tree_add_choice(GNT_TREE(edit->tree), key,
377  name, type ? type : "", message ? message : ""), NULL, NULL);
378 
379  if (sub)
380  gnt_tree_set_choice(GNT_TREE(edit->tree), key, TRUE);
381  g_free(name);
382 }
383 
384 static void
386 {
387  g_hash_table_remove(sub->parent->hash, sub->key->account);
388  g_free(sub);
389 }
390 
391 static void
393 {
394  PurpleSavedStatus *saved = sub->parent->saved;
395  RowInfo *row = sub->key;
396  const char *message;
398 
400  message = gnt_entry_get_text(GNT_ENTRY(sub->message));
401 
402  row->type = type;
403  row->message = g_strdup(message);
404 
405  if (saved) /* Save the substatus if the savedstatus actually exists. */
406  purple_savedstatus_set_substatus(saved, row->account, type, message);
407 
409  gnt_tree_change_text(GNT_TREE(sub->parent->tree), row, 1,
411  gnt_tree_change_text(GNT_TREE(sub->parent->tree), row, 2, message);
412 
414 }
415 
416 static gboolean
417 popup_substatus(GntTree *tree, const char *key, EditStatus *edit)
418 {
419  if (key[0] == ' ' && key[1] == 0)
420  {
421  EditSubStatus *sub;
422  GntWidget *window, *combo, *entry, *box, *button, *l;
423  PurpleSavedStatusSub *substatus = NULL;
424  GList *iter;
425  char *name;
427  PurpleAccount *account = selected->account;
428 
429  if (gnt_tree_get_choice(tree, selected))
430  {
431  /* There was a savedstatus for this account. Now remove it. */
432  g_free(selected->message);
433  selected->type = NULL;
434  selected->message = NULL;
435  /* XXX: should we really be saving it right now? */
439  return FALSE;
440  }
441 
442  if (g_hash_table_lookup(edit->hash, account))
443  return TRUE;
444 
445  if (edit->saved)
446  substatus = purple_savedstatus_get_substatus(edit->saved, account);
447 
448  sub = g_new0(EditSubStatus, 1);
449  sub->parent = edit;
450  sub->key = selected;
451 
452  sub->window = window = gnt_vbox_new(FALSE);
454  gnt_box_set_title(GNT_BOX(window), _("Substatus")); /* XXX: a better title */
456 
457  box = gnt_hbox_new(FALSE);
458  gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Account:")));
459  name = g_strdup_printf("%s (%s)", purple_account_get_username(account),
462  g_free(name);
464 
465  box = gnt_hbox_new(FALSE);
466  gnt_box_add_widget(GNT_BOX(box), (l = gnt_label_new(_("Status:"))));
467  gnt_widget_set_size(l, 0, 1); /* I don't like having to do this */
468  sub->type = combo = gnt_combo_box_new();
469  gnt_box_add_widget(GNT_BOX(box), combo);
471 
472  for (iter = purple_account_get_status_types(account); iter; iter = iter->next)
473  {
474  PurpleStatusType *type = iter->data;
476  continue;
478  }
479 
480  box = gnt_hbox_new(FALSE);
481  gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Message:")));
482  sub->message = entry = gnt_entry_new(substatus ? purple_savedstatus_substatus_get_message(substatus) : NULL);
483  gnt_box_add_widget(GNT_BOX(box), entry);
485 
486  box = gnt_hbox_new(FALSE);
487  button = gnt_button_new(_("Cancel"));
488  g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), window);
489  gnt_box_add_widget(GNT_BOX(box), button);
490  button = gnt_button_new(_("Save"));
491  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(save_substatus_cb), sub);
492  gnt_box_add_widget(GNT_BOX(box), button);
494 
496 
497  g_hash_table_insert(edit->hash, account, sub);
498 
499  g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(substatus_window_destroy_cb), sub);
500 
501  return TRUE;
502  }
503  return FALSE;
504 }
505 
507 {
508  EditStatus *edit;
509  GntWidget *window, *box, *button, *entry, *combo, *label, *tree;
512  GList *iter;
513  int i;
514 
515  if (saved)
516  {
517  GList *iter;
518  for (iter = edits; iter; iter = iter->next)
519  {
520  edit = iter->data;
521  if (edit->saved == saved)
522  return;
523  }
524  }
525 
526  edit = g_new0(EditStatus, 1);
527  edit->saved = saved;
528  edit->window = window = gnt_vbox_new(FALSE);
530  gnt_box_set_title(GNT_BOX(window), _("Edit Status"));
534 
535  edits = g_list_append(edits, edit);
536 
537  /* Title */
538  box = gnt_hbox_new(FALSE);
541  gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Title")));
542 
543  edit->title = entry = gnt_entry_new(saved ? purple_savedstatus_get_title(saved) : NULL);
544  gnt_box_add_widget(GNT_BOX(box), entry);
545 
546  /* Type */
547  box = gnt_hbox_new(FALSE);
549  gnt_box_add_widget(GNT_BOX(box), label = gnt_label_new(_("Status")));
550  gnt_widget_set_size(label, 0, 1);
551 
552  edit->type = combo = gnt_combo_box_new();
553  gnt_box_add_widget(GNT_BOX(box), combo);
554  current = saved ? purple_savedstatus_get_type(saved) : PURPLE_STATUS_UNSET;
555  for (i = 0; prims[i] != PURPLE_STATUS_UNSET; i++)
556  {
557  gnt_combo_box_add_data(GNT_COMBO_BOX(combo), GINT_TO_POINTER(prims[i]),
559  if (prims[i] == current)
560  gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), GINT_TO_POINTER(current));
561  }
562 
563  /* Message */
564  box = gnt_hbox_new(FALSE);
566  gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Message")));
567 
568  edit->message = entry = gnt_entry_new(saved ? purple_savedstatus_get_message(saved) : NULL);
570 
572  gnt_box_add_widget(GNT_BOX(window), gnt_label_new(_("Use a different status for some accounts")));
573 
574  edit->hash = g_hash_table_new(g_direct_hash, g_direct_equal);
575  edit->tree = tree = gnt_tree_new_with_columns(3);
578  gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("Status"), _("Message"));
582 
583  for (iter = purple_accounts_get_all(); iter; iter = iter->next)
584  {
585  add_substatus(edit, iter->data);
586  }
587 
588  g_signal_connect(G_OBJECT(tree), "key_pressed", G_CALLBACK(popup_substatus), edit);
589 
590  /* The buttons */
591  box = gnt_hbox_new(FALSE);
593 
594  /* Use */
595  button = gnt_button_new(_("Use"));
596  gnt_box_add_widget(GNT_BOX(box), button);
597  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(use_trans_status_cb), edit);
598 
599  /* Save */
600  button = gnt_button_new(_("Save"));
601  gnt_box_add_widget(GNT_BOX(box), button);
602  g_object_set_data(G_OBJECT(button), "use", NULL);
603  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(save_savedstatus_cb), edit);
604 
605  /* Save and Use */
606  button = gnt_button_new(_("Save and Use"));
607  gnt_box_add_widget(GNT_BOX(box), button);
608  g_object_set_data(G_OBJECT(button), "use", GINT_TO_POINTER(TRUE));
609  g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(save_savedstatus_cb), edit);
610 
611  /* Cancel */
612  button = gnt_button_new(_("Cancel"));
613  gnt_box_add_widget(GNT_BOX(box), button);
614  g_signal_connect_swapped(G_OBJECT(button), "activate",
615  G_CALLBACK(gnt_widget_destroy), window);
616 
617  g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(update_edit_list), edit);
618 
620 }
621 
gnt_widget_set_size
gboolean gnt_widget_set_size(GntWidget *widget, int width, int height)
Definition: gntwidget.c:515
purple_request_action
void * purple_request_action(void *handle, const char *title, const char *primary, const char *secondary, int default_action, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t action_count,...)
Definition: request.c:1300
purple_savedstatus_get_message
const char * purple_savedstatus_get_message(const PurpleSavedStatus *saved_status)
Definition: savedstatuses.c:1041
name
char * name
Definition: gntbindable.c:47
purple_savedstatus_set_message
void purple_savedstatus_set_message(PurpleSavedStatus *status, const char *message)
Definition: savedstatuses.c:611
statuses
static struct @9 statuses
gnt_box_set_pad
void gnt_box_set_pad(GntBox *box, int pad)
Definition: gntbox.c:695
EditStatus::window
GntWidget * window
Definition: gntstatus.c:54
account
static PurpleAccount * account
Definition: raw.c:45
RowInfo::account
PurpleAccount * account
Definition: gntstatus.c:64
purple_notify_error
#define purple_notify_error(handle, title, primary, secondary)
Definition: notify.h:756
EditSubStatus::message
GntWidget * message
Definition: gntstatus.c:73
destroy_substatus_win
static void destroy_substatus_win(PurpleAccount *account, EditSubStatus *sub, gpointer null)
Definition: gntstatus.c:229
purple_notify_close_with_handle
void purple_notify_close_with_handle(void *handle)
Definition: notify.c:747
RowInfo
Definition: gntstatus.c:62
use_trans_status_cb
static void use_trans_status_cb(GntWidget *button, EditStatus *edit)
Definition: gntstatus.c:267
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
gntbox.h
purple_savedstatus_new
PurpleSavedStatus * purple_savedstatus_new(const char *title, PurpleStatusPrimitive type)
Definition: savedstatuses.c:557
gnt_tree_get_choice
gboolean gnt_tree_get_choice(GntTree *tree, void *key)
Definition: gnttree.c:1624
purple_savedstatus_set_substatus
void purple_savedstatus_set_substatus(PurpleSavedStatus *saved_status, const PurpleAccount *account, const PurpleStatusType *type, const char *message)
Definition: savedstatuses.c:628
gnt_combo_box_new
GntWidget * gnt_combo_box_new()
Definition: gntcombobox.c:350
purple_status_type_is_user_settable
gboolean purple_status_type_is_user_settable(const PurpleStatusType *status_type)
Definition: status.c:401
GNT_COMBO_BOX
#define GNT_COMBO_BOX(obj)
Definition: gntcombobox.h:36
notify.h
gnt_label_new
GntWidget * gnt_label_new(const char *text)
Definition: gntlabel.c:186
gnt_tree_remove
void gnt_tree_remove(GntTree *tree, gpointer key)
Definition: gnttree.c:1479
widget
GtkWidget * widget
Definition: pidgintooltip.c:38
_GntWidget
Definition: gntwidget.h:98
gnt.h
EditStatus
Definition: gntstatus.c:51
RowInfo::type
const PurpleStatusType * type
Definition: gntstatus.c:65
finch_savedstatus_edit
void finch_savedstatus_edit(PurpleSavedStatus *saved)
Definition: gntstatus.c:506
purple_savedstatus_substatus_get_type
const PurpleStatusType * purple_savedstatus_substatus_get_type(const PurpleSavedStatusSub *substatus)
Definition: savedstatuses.c:1085
gnt_vbox_new
#define gnt_vbox_new(homo)
Definition: gntbox.h:96
purple_status_type_get_name
const char * purple_status_type_get_name(const PurpleStatusType *status_type)
Definition: status.c:385
gntutils.h
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))
gnt_util_set_trigger_widget
void gnt_util_set_trigger_widget(GntWidget *wid, const char *text, GntWidget *button)
Definition: gntutils.c:496
purple_savedstatuses_get_all
GList * purple_savedstatuses_get_all(void)
Definition: savedstatuses.c:754
EditSubStatus::type
GntWidget * type
Definition: gntstatus.c:72
purple_savedstatus_delete
gboolean purple_savedstatus_delete(const char *title)
Definition: savedstatuses.c:736
gnt_window_present
void gnt_window_present(GntWidget *window)
Definition: gntmain.c:548
GNT_BOX
#define GNT_BOX(obj)
Definition: gntbox.h:34
gntentry.h
gnt_box_add_widget
void gnt_box_add_widget(GntBox *b, GntWidget *widget)
Definition: gntbox.c:674
purple_savedstatus_set_title
void purple_savedstatus_set_title(PurpleSavedStatus *status, const char *title)
Definition: savedstatuses.c:582
purple_account_get_status_types
GList * purple_account_get_status_types(const PurpleAccount *account)
Definition: account.c:2441
gnt_button_new
GntWidget * gnt_button_new(const char *text)
Definition: gntbutton.c:170
gnt_tree_add_row_last
GntTreeRow * gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent)
Definition: gnttree.c:1420
GNT_ALIGN_MID
Definition: gntbox.h:49
gntstatus.h
edits
static GList * edits
Definition: gntstatus.c:79
gnt_tree_change_text
void gnt_tree_change_text(GntTree *tree, gpointer key, int colno, const char *text)
Definition: gnttree.c:1560
gntlabel.h
EditSubStatus::window
GntWidget * window
Definition: gntstatus.c:71
RowInfo::message
char * message
Definition: gntstatus.c:66
gnt_tree_set_choice
void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set)
Definition: gnttree.c:1612
edit_savedstatus_cb
static void edit_savedstatus_cb(GntWidget *widget, gpointer null)
Definition: gntstatus.c:160
NULL
#define NULL
Definition: getopt1.c:52
_PurpleSavedStatusSub
Definition: savedstatuses.c:81
_GntTree
Definition: gnttree.h:57
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
purple_savedstatus_substatus_get_message
const char * purple_savedstatus_substatus_get_message(const PurpleSavedStatusSub *substatus)
Definition: savedstatuses.c:1093
PURPLE_STATUS_INVISIBLE
Definition: status.h:123
EditSubStatus::key
RowInfo * key
Definition: gntstatus.c:76
purple_savedstatus_get_type
PurpleStatusPrimitive purple_savedstatus_get_type(const PurpleSavedStatus *saved_status)
Definition: savedstatuses.c:1033
gnt_tree_set_column_titles
void gnt_tree_set_column_titles(GntTree *tree,...)
Definition: gnttree.c:1763
update_edit_list
static void update_edit_list(GntWidget *widget, EditStatus *edit)
Definition: gntstatus.c:244
gntcombobox.h
gnt_box_give_focus_to_child
void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
Definition: gntbox.c:881
purple_savedstatus_get_substatus
PurpleSavedStatusSub * purple_savedstatus_get_substatus(const PurpleSavedStatus *saved_status, const PurpleAccount *account)
Definition: savedstatuses.c:1065
EditStatus::type
GntWidget * type
Definition: gntstatus.c:56
gnt_box_set_toplevel
void gnt_box_set_toplevel(GntBox *box, gboolean set)
Definition: gntbox.c:701
purple_savedstatus_unset_substatus
void purple_savedstatus_unset_substatus(PurpleSavedStatus *saved_status, const PurpleAccount *account)
Definition: savedstatuses.c:659
gntbutton.h
PURPLE_STATUS_AWAY
Definition: status.h:124
TRUE
#define TRUE
Definition: protobuf-c.c:56
_PurpleAccount
Definition: account.h:169
dbus-analyze-signals.type
string type
Definition: dbus-analyze-signals.py:42
finch_savedstatus_show_all
void finch_savedstatus_show_all()
Definition: gntstatus.c:167
gnt_tree_add_choice
GntTreeRow * gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro)
Definition: gnttree.c:1584
FALSE
#define FALSE
Definition: protobuf-c.c:57
purple_savedstatus_set_type
void purple_savedstatus_set_type(PurpleSavedStatus *status, PurpleStatusPrimitive type)
Definition: savedstatuses.c:599
request.h
EditStatus::hash
GHashTable * hash
Definition: gntstatus.c:59
PurpleStatusPrimitive
PurpleStatusPrimitive
Definition: status.h:117
purple_savedstatus_is_transient
gboolean purple_savedstatus_is_transient(const PurpleSavedStatus *saved_status)
Definition: savedstatuses.c:986
gnt_box_set_title
void gnt_box_set_title(GntBox *b, const char *title)
Definition: gntbox.c:680
popup_substatus
static gboolean popup_substatus(GntTree *tree, const char *key, EditStatus *edit)
Definition: gntstatus.c:417
window
GntWidget * window
Definition: gntstatus.c:47
label
const char * label
Definition: jabber.c:1321
purple_savedstatus_activate
void purple_savedstatus_activate(PurpleSavedStatus *saved_status)
Definition: savedstatuses.c:1101
really_delete_status
static void really_delete_status(PurpleSavedStatus *saved)
Definition: gntstatus.c:111
GNT_KEY_DEL
#define GNT_KEY_DEL
Definition: gntkeys.h:66
purple_primitive_get_name_from_type
const char * purple_primitive_get_name_from_type(PurpleStatusPrimitive type)
Definition: status.c:187
substatus_window_destroy_cb
static void substatus_window_destroy_cb(GntWidget *window, EditSubStatus *sub)
Definition: gntstatus.c:385
PURPLE_STATUS_OFFLINE
Definition: status.h:120
add_substatus
static void add_substatus(EditStatus *edit, PurpleAccount *account)
Definition: gntstatus.c:349
gnt_combo_box_get_selected_data
gpointer gnt_combo_box_get_selected_data(GntComboBox *box)
Definition: gntcombobox.c:365
gnt_tree_new_with_columns
GntWidget * gnt_tree_new_with_columns(int col)
Definition: gnttree.c:1694
PURPLE_STATUS_AVAILABLE
Definition: status.h:121
purple_account_get_protocol_name
const char * purple_account_get_protocol_name(const PurpleAccount *account)
Definition: account.c:2272
EditSubStatus
Definition: gntstatus.c:69
gnt_widget_destroy
void gnt_widget_destroy(GntWidget *obj)
Definition: gntwidget.c:312
ask_before_delete
static void ask_before_delete(GntWidget *button, gpointer null)
Definition: gntstatus.c:132
save_savedstatus_cb
static void save_savedstatus_cb(GntWidget *button, EditStatus *edit)
Definition: gntstatus.c:288
EditStatus::saved
PurpleSavedStatus * saved
Definition: gntstatus.c:53
gnt_tree_set_col_width
void gnt_tree_set_col_width(GntTree *tree, int col, int width)
Definition: gnttree.c:1748
EditSubStatus::parent
EditStatus * parent
Definition: gntstatus.c:75
gnt_tree_set_show_title
void gnt_tree_set_show_title(GntTree *tree, gboolean set)
Definition: gnttree.c:1777
set_substatuses
static void set_substatuses(EditStatus *edit)
Definition: gntstatus.c:254
purple_accounts_get_all
GList * purple_accounts_get_all(void)
Definition: account.c:3082
reset_status_window
static void reset_status_window(GntWidget *widget, gpointer null)
Definition: gntstatus.c:82
purple_savedstatus_find_transient_by_type_and_message
PurpleSavedStatus * purple_savedstatus_find_transient_by_type_and_message(PurpleStatusPrimitive type, const char *message)
Definition: savedstatuses.c:965
EditStatus::message
GntWidget * message
Definition: gntstatus.c:57
save_substatus_cb
static void save_substatus_cb(GntWidget *widget, EditSubStatus *sub)
Definition: gntstatus.c:392
gnt_hbox_new
#define gnt_hbox_new(homo)
Definition: gntbox.h:97
gnt_entry_get_text
const char * gnt_entry_get_text(GntEntry *entry)
Definition: gntentry.c:1163
PURPLE_STATUS_UNSET
Definition: status.h:119
finch.h
EditStatus::tree
GntWidget * tree
Definition: gntstatus.c:58
EditStatus::title
GntWidget * title
Definition: gntstatus.c:55
populate_statuses
static void populate_statuses(GntTree *tree)
Definition: gntstatus.c:89
gntline.h
_PurpleStatusType
Definition: status.c:41
gnt_tree_set_column_width_ratio
void gnt_tree_set_column_width_ratio(GntTree *tree, int cols[])
Definition: gnttree.c:1896
purple_savedstatus_get_title
const char * purple_savedstatus_get_title(const PurpleSavedStatus *saved_status)
Definition: savedstatuses.c:994
GNT_ALIGN_LEFT
Definition: gntbox.h:46
gnttree.h
GNT_ENTRY
#define GNT_ENTRY(obj)
Definition: gntentry.h:36
free_key
static void free_key(gpointer key, gpointer n)
Definition: gntstatus.c:235
gnt_tree_create_row
GntTreeRow * gnt_tree_create_row(GntTree *tree,...)
Definition: gnttree.c:1728
gnt_combo_box_add_data
void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text)
Definition: gntcombobox.c:357
gnt_tree_get_selection_data
gpointer gnt_tree_get_selection_data(GntTree *tree)
Definition: gnttree.c:1441
gnt_entry_new
GntWidget * gnt_entry_new(const char *text)
Definition: gntentry.c:1093
_PurpleSavedStatus
Definition: savedstatuses.c:61
gnt_box_set_fill
void gnt_box_set_fill(GntBox *box, gboolean fill)
Definition: gntbox.c:849
GNT_KEY_INS
#define GNT_KEY_INS
Definition: gntkeys.h:67
purple_savedstatus_find
PurpleSavedStatus * purple_savedstatus_find(const char *title)
Definition: savedstatuses.c:931
gnt_box_set_alignment
void gnt_box_set_alignment(GntBox *box, GntAlignment alignment)
Definition: gntbox.c:775
tree
GntWidget * tree
Definition: gntstatus.c:48
gnt_hline_new
#define gnt_hline_new()
Definition: gntline.h:74
use_savedstatus_cb
static void use_savedstatus_cb(GntWidget *widget, gpointer null)
Definition: gntstatus.c:152