comparison gtk/gtkstatusbox.c @ 15154:7696f5dec7d8

[gaim-migrate @ 17940] Make the per-account statusboxes work. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 10 Dec 2006 09:02:47 +0000
parents 63d554c2675d
children 96f3a7286375
comparison
equal deleted inserted replaced
15153:38cdfbb371b1 15154:7696f5dec7d8
762 { 762 {
763 /* Found! */ 763 /* Found! */
764 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); 764 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter);
765 break; 765 break;
766 } 766 }
767 } 767 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(status_box->dropdown_store), &iter));
768 while (gtk_tree_model_iter_next(GTK_TREE_MODEL(status_box->dropdown_store), &iter));
769 } 768 }
770 } 769 }
771 770
772 if (status_box->active_row) 771 if (status_box->active_row)
773 gtk_tree_row_reference_free(status_box->active_row); 772 gtk_tree_row_reference_free(status_box->active_row);
2152 GaimStatus *status; 2151 GaimStatus *status;
2153 const char *id = NULL; 2152 const char *id = NULL;
2154 2153
2155 status = gaim_account_get_active_status(status_box->account); 2154 status = gaim_account_get_active_status(status_box->account);
2156 2155
2157 g_object_get(G_OBJECT(status_box), "active", &active, NULL); 2156 active = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(status_box), "active"));
2158 2157
2159 status_type = find_status_type_by_index(status_box->account, active); 2158 status_type = find_status_type_by_index(status_box->account, active);
2160 id = gaim_status_type_get_id(status_type); 2159 id = gaim_status_type_get_id(status_type);
2161 2160
2162 if (strncmp(id, gaim_status_get_id(status), strlen(id)) == 0) 2161 if (strncmp(id, gaim_status_get_id(status), strlen(id)) == 0)
2248 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row); 2247 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row);
2249 GtkTreeIter iter; 2248 GtkTreeIter iter;
2250 GtkGaimStatusBoxItemType type; 2249 GtkGaimStatusBoxItemType type;
2251 gpointer data; 2250 gpointer data;
2252 GList *accounts = NULL, *node; 2251 GList *accounts = NULL, *node;
2252 int active;
2253 2253
2254 2254
2255 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) 2255 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path))
2256 return; 2256 return;
2257 active = gtk_tree_path_get_indices(path)[0];
2257 gtk_tree_path_free(path); 2258 gtk_tree_path_free(path);
2259 g_object_set_data(G_OBJECT(status_box), "active", GINT_TO_POINTER(active));
2258 2260
2259 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, 2261 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
2260 TYPE_COLUMN, &type, 2262 TYPE_COLUMN, &type,
2261 DATA_COLUMN, &data, 2263 DATA_COLUMN, &data,
2262 -1); 2264 -1);