Mercurial > pidgin
comparison src/gtkaccount.c @ 5573:5e7de337a053
[gaim-migrate @ 5976]
Account saving and loading _mostly_ works.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 30 May 2003 23:57:11 +0000 |
parents | 5d2911d6d38e |
children | 3a9b54f260e3 |
comparison
equal
deleted
inserted
replaced
5572:dfdea22a7153 | 5573:5e7de337a053 |
---|---|
140 G_CALLBACK(__online_cb), dialog); | 140 G_CALLBACK(__online_cb), dialog); |
141 | 141 |
142 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | 142 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), |
143 -1, _("Online"), | 143 -1, _("Online"), |
144 renderer, | 144 renderer, |
145 "text", COLUMN_ONLINE, | 145 "active", COLUMN_ONLINE, |
146 NULL); | 146 NULL); |
147 | 147 |
148 | 148 |
149 /* Auto-login? */ | 149 /* Auto-login? */ |
150 renderer = gtk_cell_renderer_toggle_new(); | 150 renderer = gtk_cell_renderer_toggle_new(); |
153 G_CALLBACK(__autologin_cb), dialog); | 153 G_CALLBACK(__autologin_cb), dialog); |
154 | 154 |
155 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | 155 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), |
156 -1, _("Auto-login"), | 156 -1, _("Auto-login"), |
157 renderer, | 157 renderer, |
158 "text", COLUMN_AUTOLOGIN, | 158 "active", COLUMN_AUTOLOGIN, |
159 NULL); | 159 NULL); |
160 | 160 |
161 | 161 |
162 /* Protocol description */ | 162 /* Protocol description */ |
163 renderer = gtk_cell_renderer_text_new(); | 163 renderer = gtk_cell_renderer_text_new(); |
180 gtk_list_store_clear(dialog->model); | 180 gtk_list_store_clear(dialog->model); |
181 | 181 |
182 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { | 182 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { |
183 account = l->data; | 183 account = l->data; |
184 | 184 |
185 scale = NULL; | |
186 | |
185 pixbuf = create_prpl_icon(account); | 187 pixbuf = create_prpl_icon(account); |
186 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); | 188 |
189 if (pixbuf != NULL) | |
190 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, | |
191 GDK_INTERP_BILINEAR); | |
187 | 192 |
188 gtk_list_store_append(dialog->model, &iter); | 193 gtk_list_store_append(dialog->model, &iter); |
189 gtk_list_store_set(dialog->model, &iter, | 194 gtk_list_store_set(dialog->model, &iter, |
190 COLUMN_ICON, scale, | 195 COLUMN_ICON, scale, |
191 COLUMN_SCREENNAME, gaim_account_get_username(account), | 196 COLUMN_SCREENNAME, gaim_account_get_username(account), |
193 COLUMN_AUTOLOGIN, FALSE, | 198 COLUMN_AUTOLOGIN, FALSE, |
194 COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol(account)), | 199 COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol(account)), |
195 COLUMN_DATA, account, | 200 COLUMN_DATA, account, |
196 -1); | 201 -1); |
197 | 202 |
198 g_object_unref(G_OBJECT(pixbuf)); | 203 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); |
199 g_object_unref(G_OBJECT(scale)); | 204 if (scale != NULL) g_object_unref(G_OBJECT(scale)); |
200 } | 205 } |
201 } | 206 } |
202 | 207 |
203 static GtkWidget * | 208 static GtkWidget * |
204 __create_accounts_list(AccountsDialog *dialog) | 209 __create_accounts_list(AccountsDialog *dialog) |
214 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), | 219 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
215 GTK_SHADOW_IN); | 220 GTK_SHADOW_IN); |
216 gtk_widget_show(sw); | 221 gtk_widget_show(sw); |
217 | 222 |
218 /* Create the list model. */ | 223 /* Create the list model. */ |
219 dialog->model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_POINTER, | 224 dialog->model = gtk_list_store_new(NUM_COLUMNS, GDK_TYPE_PIXBUF, |
220 G_TYPE_STRING, G_TYPE_BOOLEAN, | 225 G_TYPE_STRING, G_TYPE_BOOLEAN, |
221 G_TYPE_BOOLEAN, G_TYPE_STRING, | 226 G_TYPE_BOOLEAN, G_TYPE_STRING, |
222 G_TYPE_POINTER); | 227 G_TYPE_POINTER); |
223 | 228 |
224 /* And now the actual treeview */ | 229 /* And now the actual treeview */ |