Mercurial > pidgin.yaz
comparison src/gtkaccount.c @ 5779:758fa27534b3
[gaim-migrate @ 6204]
Auto-login support is back in, and we have UI-specific settings, and some
bugs were fixed in the account editor (including a crash on gtk 2.0, I
hope!)
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 07 Jun 2003 00:30:09 +0000 |
parents | e8f6209c4f59 |
children | c8837160add6 |
comparison
equal
deleted
inserted
replaced
5778:a6947aef5f13 | 5779:758fa27534b3 |
---|---|
43 #include <string.h> | 43 #include <string.h> |
44 | 44 |
45 enum | 45 enum |
46 { | 46 { |
47 COLUMN_ICON, | 47 COLUMN_ICON, |
48 COLUMN_SCREENNAME, | |
48 COLUMN_PROTOCOL, | 49 COLUMN_PROTOCOL, |
49 COLUMN_SCREENNAME, | |
50 COLUMN_ONLINE, | 50 COLUMN_ONLINE, |
51 COLUMN_AUTOLOGIN, | 51 COLUMN_AUTOLOGIN, |
52 COLUMN_DATA, | 52 COLUMN_DATA, |
53 NUM_COLUMNS | 53 NUM_COLUMNS |
54 }; | 54 }; |
1378 | 1378 |
1379 static void | 1379 static void |
1380 autologin_cb(GtkCellRendererToggle *renderer, gchar *path_str, | 1380 autologin_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
1381 gpointer data) | 1381 gpointer data) |
1382 { | 1382 { |
1383 | 1383 AccountsDialog *dialog = (AccountsDialog *)data; |
1384 GaimAccount *account; | |
1385 GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); | |
1386 GtkTreeIter iter; | |
1387 gboolean autologin; | |
1388 | |
1389 gtk_tree_model_get_iter_from_string(model, &iter, path_str); | |
1390 gtk_tree_model_get(model, &iter, | |
1391 COLUMN_DATA, &account, | |
1392 COLUMN_AUTOLOGIN, &autologin, | |
1393 -1); | |
1394 | |
1395 gaim_account_set_auto_login(account, GAIM_GTK_UI, !autologin); | |
1396 | |
1397 gtk_list_store_set(dialog->model, &iter, | |
1398 COLUMN_AUTOLOGIN, !autologin, | |
1399 -1); | |
1384 } | 1400 } |
1385 | 1401 |
1386 static void | 1402 static void |
1387 add_columns(GtkWidget *treeview, AccountsDialog *dialog) | 1403 add_columns(GtkWidget *treeview, AccountsDialog *dialog) |
1388 { | 1404 { |
1389 GtkCellRenderer *renderer; | 1405 GtkCellRenderer *renderer; |
1390 GtkTreeViewColumn *column; | 1406 GtkTreeViewColumn *column; |
1391 | 1407 |
1392 /* Protocol */ | 1408 /* Screen name column */ |
1393 column = gtk_tree_view_column_new(); | 1409 column = gtk_tree_view_column_new(); |
1394 gtk_tree_view_column_set_title(column, _("Screenname")); | 1410 gtk_tree_view_column_set_title(column, _("Screenname")); |
1395 gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview), column, -1); | 1411 gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview), column, -1); |
1396 | 1412 |
1397 /* Icon text */ | 1413 /* Icon */ |
1398 renderer = gtk_cell_renderer_pixbuf_new(); | 1414 renderer = gtk_cell_renderer_pixbuf_new(); |
1399 gtk_tree_view_column_pack_start(column, renderer, FALSE); | 1415 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
1400 gtk_tree_view_column_add_attribute(column, renderer, | 1416 gtk_tree_view_column_add_attribute(column, renderer, |
1401 "pixbuf", COLUMN_ICON); | 1417 "pixbuf", COLUMN_ICON); |
1402 | 1418 |
1403 /* Screennames */ | 1419 /* Screen name */ |
1404 renderer = gtk_cell_renderer_text_new(); | 1420 renderer = gtk_cell_renderer_text_new(); |
1405 gtk_tree_view_column_pack_start(column, renderer, TRUE); | 1421 gtk_tree_view_column_pack_start(column, renderer, TRUE); |
1406 gtk_tree_view_column_add_attribute(column, renderer, | 1422 gtk_tree_view_column_add_attribute(column, renderer, |
1407 "text", COLUMN_SCREENNAME); | 1423 "text", COLUMN_SCREENNAME); |
1408 dialog->screenname_col = column; | 1424 dialog->screenname_col = column; |
1454 pixbuf = create_prpl_icon(account); | 1470 pixbuf = create_prpl_icon(account); |
1455 | 1471 |
1456 if (pixbuf != NULL) | 1472 if (pixbuf != NULL) |
1457 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); | 1473 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); |
1458 | 1474 |
1475 gaim_debug(GAIM_DEBUG_MISC, "gtkaccount", "auto-login for %s: %d\n", | |
1476 gaim_account_get_username(account), | |
1477 gaim_account_get_auto_login(account, GAIM_GTK_UI)); | |
1478 | |
1459 gtk_list_store_set(store, iter, | 1479 gtk_list_store_set(store, iter, |
1460 COLUMN_ICON, scale, | 1480 COLUMN_ICON, scale, |
1461 COLUMN_SCREENNAME, gaim_account_get_username(account), | 1481 COLUMN_SCREENNAME, gaim_account_get_username(account), |
1462 COLUMN_ONLINE, gaim_account_is_connected(account), | 1482 COLUMN_ONLINE, gaim_account_is_connected(account), |
1463 COLUMN_AUTOLOGIN, FALSE, | 1483 COLUMN_AUTOLOGIN, gaim_account_get_auto_login(account, GAIM_GTK_UI), |
1464 COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol(account)), | 1484 COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol(account)), |
1465 COLUMN_DATA, account, | 1485 COLUMN_DATA, account, |
1466 -1); | 1486 -1); |
1467 | 1487 |
1468 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); | 1488 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); |
1540 G_CALLBACK(account_selected_cb), dialog); | 1560 G_CALLBACK(account_selected_cb), dialog); |
1541 | 1561 |
1542 /* Setup DND. I wanna be an orc! */ | 1562 /* Setup DND. I wanna be an orc! */ |
1543 gtk_tree_view_enable_model_drag_source( | 1563 gtk_tree_view_enable_model_drag_source( |
1544 GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, | 1564 GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, |
1545 2, GDK_ACTION_COPY); | 1565 1, GDK_ACTION_COPY); |
1546 gtk_tree_view_enable_model_drag_dest( | 1566 gtk_tree_view_enable_model_drag_dest( |
1547 GTK_TREE_VIEW(treeview), gte, 2, | 1567 GTK_TREE_VIEW(treeview), gte, 1, |
1548 GDK_ACTION_COPY | GDK_ACTION_MOVE); | 1568 GDK_ACTION_COPY | GDK_ACTION_MOVE); |
1549 | 1569 |
1550 g_signal_connect(G_OBJECT(treeview), "drag-data-received", | 1570 g_signal_connect(G_OBJECT(treeview), "drag-data-received", |
1551 G_CALLBACK(drag_data_received_cb), dialog); | 1571 G_CALLBACK(drag_data_received_cb), dialog); |
1552 g_signal_connect(G_OBJECT(treeview), "drag-data-get", | 1572 g_signal_connect(G_OBJECT(treeview), "drag-data-get", |