changeset 14695:fa0c8fa2b5a7

[gaim-migrate @ 17447] Add a "Use" button in the status dialog. This has been sitting here for a while. I can't remember why this was not commited ... seems to work fine. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 08 Oct 2006 04:31:39 +0000
parents 8538993dbb00
children 34083fe39891
files console/gntstatus.c
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/console/gntstatus.c	Sun Oct 08 04:21:20 2006 +0000
+++ b/console/gntstatus.c	Sun Oct 08 04:31:39 2006 +0000
@@ -222,6 +222,25 @@
 }
 
 static void
+use_trans_status_cb(GntWidget *button, EditStatus *edit)
+{
+	const char *message;
+	GaimStatusPrimitive prim;
+	GaimSavedStatus *saved;
+
+	message = gnt_entry_get_text(GNT_ENTRY(edit->message));
+	prim = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(edit->type)));
+
+	saved = gaim_savedstatus_find_transient_by_type_and_message(prim, message);
+	if (saved == NULL) {
+		saved = gaim_savedstatus_new(NULL, prim);
+	}
+	gaim_savedstatus_set_message(saved, message);
+	gaim_savedstatus_activate(saved);
+	gnt_widget_destroy(edit->window);
+}
+
+static void
 save_savedstatus_cb(GntWidget *button, EditStatus *edit)
 {
 	const char *title, *message;
@@ -508,6 +527,11 @@
 	box = gnt_hbox_new(FALSE);
 	gnt_box_add_widget(GNT_BOX(window), box);
 
+	/* Use */
+	button = gnt_button_new(_("Use"));
+	gnt_box_add_widget(GNT_BOX(box), button);
+	g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(use_trans_status_cb), edit);
+
 	/* Save */
 	button = gnt_button_new(_("Save"));
 	gnt_box_add_widget(GNT_BOX(box), button);