| 334 gtk_widget_set_sensitive(dialog->save_button, |
334 gtk_widget_set_sensitive(dialog->save_button, |
| 335 *gtk_entry_get_text(entry) != '\0'); |
335 *gtk_entry_get_text(entry) != '\0'); |
| 336 } |
336 } |
| 337 |
337 |
| 338 void |
338 void |
| 339 gaim_gtkpounce_dialog_show(struct buddy *buddy, |
339 gaim_gtkpounce_dialog_show(GaimAccount *account, const char *name, |
| 340 GaimPounce *cur_pounce) |
340 GaimPounce *cur_pounce) |
| 341 { |
341 { |
| 342 GaimGtkPounceDialog *dialog; |
342 GaimGtkPounceDialog *dialog; |
| 343 GtkWidget *window; |
343 GtkWidget *window; |
| 344 GtkWidget *label; |
344 GtkWidget *label; |
| 357 |
357 |
| 358 if (cur_pounce != NULL) { |
358 if (cur_pounce != NULL) { |
| 359 dialog->pounce = cur_pounce; |
359 dialog->pounce = cur_pounce; |
| 360 dialog->account = gaim_pounce_get_pouncer(cur_pounce); |
360 dialog->account = gaim_pounce_get_pouncer(cur_pounce); |
| 361 } |
361 } |
| 362 else if (buddy != NULL) { |
362 else if (account != NULL) { |
| 363 dialog->pounce = NULL; |
363 dialog->pounce = NULL; |
| 364 dialog->account = buddy->account; |
364 dialog->account = account; |
| 365 } |
365 } |
| 366 else { |
366 else { |
| 367 dialog->pounce = NULL; |
367 dialog->pounce = NULL; |
| 368 dialog->account = gaim_accounts_get_all()->data; |
368 dialog->account = gaim_accounts_get_all()->data; |
| 369 } |
369 } |
| 435 |
435 |
| 436 if (cur_pounce != NULL) { |
436 if (cur_pounce != NULL) { |
| 437 gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), |
437 gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), |
| 438 gaim_pounce_get_pouncee(cur_pounce)); |
438 gaim_pounce_get_pouncee(cur_pounce)); |
| 439 } |
439 } |
| 440 else if (buddy != NULL) { |
440 else if (name != NULL) { |
| 441 gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), buddy->name); |
441 gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), name); |
| 442 } |
442 } |
| 443 |
443 |
| 444 /* Create the "Pounce When" frame. */ |
444 /* Create the "Pounce When" frame. */ |
| 445 frame = gaim_gtk_make_frame(vbox2, _("Pounce When")); |
445 frame = gaim_gtk_make_frame(vbox2, _("Pounce When")); |
| 446 |
446 |
| 718 } |
718 } |
| 719 |
719 |
| 720 static void |
720 static void |
| 721 edit_pounce_cb(GtkWidget *w, GaimPounce *pounce) |
721 edit_pounce_cb(GtkWidget *w, GaimPounce *pounce) |
| 722 { |
722 { |
| 723 struct buddy *buddy; |
723 gaim_gtkpounce_dialog_show(NULL, NULL, pounce); |
| 724 |
|
| 725 buddy = gaim_find_buddy(gaim_pounce_get_pouncer(pounce), |
|
| 726 gaim_pounce_get_pouncee(pounce)); |
|
| 727 |
|
| 728 gaim_gtkpounce_dialog_show(buddy, pounce); |
|
| 729 } |
724 } |
| 730 |
725 |
| 731 static void |
726 static void |
| 732 fill_menu(GtkWidget *menu, GCallback cb) |
727 fill_menu(GtkWidget *menu, GCallback cb) |
| 733 { |
728 { |