Mercurial > pidgin.yaz
changeset 29806:0aafa5cc2628
Remove extra enumeration.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 20 Feb 2010 04:33:31 +0000 |
parents | ded4c63c39a9 |
children | a4167f67d118 |
files | pidgin/gtksavedstatuses.c |
diffstat | 1 files changed, 20 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtksavedstatuses.c Fri Feb 19 07:40:34 2010 +0000 +++ b/pidgin/gtksavedstatuses.c Sat Feb 20 04:33:31 2010 +0000 @@ -85,17 +85,16 @@ }; /** - * These are used in the GtkComboBox to select the specific - * PurpleStatusType when setting a substatus for a particular saved - * status. + * These are used in the GtkComboBox to select the specific PurpleStatusType + * when setting a (sub)status for a particular saved status. */ enum { - SUBSTATUS_COLUMN_ICON, + STATUS_COLUMN_ICON, /** A hidden column containing the ID of this PurpleStatusType. */ - SUBSTATUS_COLUMN_STATUS_ID, - SUBSTATUS_COLUMN_STATUS_NAME, - SUBSTATUS_NUM_COLUMNS + STATUS_COLUMN_STATUS_ID, + STATUS_COLUMN_STATUS_NAME, + STATUS_NUM_COLUMNS }; typedef struct @@ -836,12 +835,6 @@ gtk_widget_set_sensitive(GTK_WIDGET(dialog->save_button), (*text != '\0')); } -enum { - STATUS_MENU_STOCK_ICON, - STATUS_MENU_NAME, - STATUS_MENU_COUNT -}; - static GtkWidget * create_status_type_menu(PurpleStatusPrimitive type) { @@ -851,7 +844,7 @@ GtkTreeIter iter; GtkCellRenderer *renderer; - store = gtk_list_store_new(STATUS_MENU_COUNT, G_TYPE_STRING, G_TYPE_STRING); + store = gtk_list_store_new(STATUS_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); for (i = PURPLE_STATUS_UNSET + 1; i < PURPLE_STATUS_NUM_PRIMITIVES; i++) { @@ -863,10 +856,10 @@ continue; gtk_list_store_append(store, &iter); - /* TODO: how's this get the right size (since it seems to work fine)? */ gtk_list_store_set(store, &iter, - STATUS_MENU_STOCK_ICON, get_stock_icon_from_primitive(i), - STATUS_MENU_NAME, purple_primitive_get_name_from_type(i), + STATUS_COLUMN_ICON, get_stock_icon_from_primitive(i), + STATUS_COLUMN_STATUS_ID, purple_primitive_get_id_from_type(i), + STATUS_COLUMN_STATUS_NAME, purple_primitive_get_name_from_type(i), -1); } @@ -875,13 +868,13 @@ renderer = gtk_cell_renderer_pixbuf_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, - "stock-id", STATUS_MENU_STOCK_ICON, + "stock-id", STATUS_COLUMN_ICON, NULL); renderer = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, - "text", STATUS_MENU_NAME, + "text", STATUS_COLUMN_STATUS_NAME, NULL); gtk_combo_box_set_active(GTK_COMBO_BOX(dropdown), @@ -1270,7 +1263,7 @@ if (!gtk_combo_box_get_active_iter(box, &iter)) return; gtk_tree_model_get(GTK_TREE_MODEL(select->model), &iter, - SUBSTATUS_COLUMN_STATUS_ID, &id, + STATUS_COLUMN_STATUS_ID, &id, -1); type = purple_account_get_status_type(select->account, id); g_free(id); @@ -1361,7 +1354,7 @@ } gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, - SUBSTATUS_COLUMN_STATUS_ID, &id, + STATUS_COLUMN_STATUS_ID, &id, -1); type = purple_account_get_status_type(dialog->account, id); if (purple_status_type_get_attr(type, "message") != NULL) @@ -1451,7 +1444,7 @@ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_size_group_add_widget(sg, label); - dialog->model = gtk_list_store_new(SUBSTATUS_NUM_COLUMNS, + dialog->model = gtk_list_store_new(STATUS_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); @@ -1464,12 +1457,12 @@ NULL); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend, - "stock-id", SUBSTATUS_COLUMN_ICON, NULL); + "stock-id", STATUS_COLUMN_ICON, NULL); rend = GTK_CELL_RENDERER(gtk_cell_renderer_text_new()); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend, - "text", SUBSTATUS_COLUMN_STATUS_NAME, NULL); + "text", STATUS_COLUMN_STATUS_NAME, NULL); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(substatus_selection_changed_cb), dialog); @@ -1545,9 +1538,9 @@ gtk_list_store_append(dialog->model, &iter); gtk_list_store_set(dialog->model, &iter, - SUBSTATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim), - SUBSTATUS_COLUMN_STATUS_ID, id, - SUBSTATUS_COLUMN_STATUS_NAME, name, + STATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim), + STATUS_COLUMN_STATUS_ID, id, + STATUS_COLUMN_STATUS_NAME, name, -1); if ((status_id != NULL) && !strcmp(status_id, id)) {