Mercurial > pidgin.yaz
comparison pidgin/gtkstatusbox.c @ 15948:5c88d2887cc1
merge of '343dc2d52b5a1cb204359ecc11a1b4d98b984dd0'
and 'f894448f712134780a75dba19622a78626a98231'
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Tue, 27 Mar 2007 03:08:31 +0000 |
parents | d04878ce947b |
children | 07554cc5d090 |
comparison
equal
deleted
inserted
replaced
15947:a0f24a614a9d | 15948:5c88d2887cc1 |
---|---|
277 /* Well, it looks like the drag event was cool. | 277 /* Well, it looks like the drag event was cool. |
278 * Let's do something with it */ | 278 * Let's do something with it */ |
279 if (!g_ascii_strncasecmp(name, "file://", 7)) { | 279 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
280 GError *converr = NULL; | 280 GError *converr = NULL; |
281 gchar *tmp, *rtmp; | 281 gchar *tmp, *rtmp; |
282 | 282 |
283 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | 283 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
284 purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n", | 284 purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n", |
285 (converr ? converr->message : | 285 (converr ? converr->message : |
286 "g_filename_from_uri error")); | 286 "g_filename_from_uri error")); |
287 return; | 287 return; |
557 GtkTreePath *path; | 557 GtkTreePath *path; |
558 gboolean account_status = FALSE; | 558 gboolean account_status = FALSE; |
559 PurpleAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account; | 559 PurpleAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account; |
560 | 560 |
561 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); | 561 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); |
562 | 562 |
563 style = gtk_widget_get_style(GTK_WIDGET(status_box)); | 563 style = gtk_widget_get_style(GTK_WIDGET(status_box)); |
564 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", | 564 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", |
565 style->text_aa[GTK_STATE_NORMAL].red >> 8, | 565 style->text_aa[GTK_STATE_NORMAL].red >> 8, |
566 style->text_aa[GTK_STATE_NORMAL].green >> 8, | 566 style->text_aa[GTK_STATE_NORMAL].green >> 8, |
567 style->text_aa[GTK_STATE_NORMAL].blue >> 8); | 567 style->text_aa[GTK_STATE_NORMAL].blue >> 8); |
582 /* Primary (get the status selected in the dropdown) */ | 582 /* Primary (get the status selected in the dropdown) */ |
583 path = gtk_tree_row_reference_get_path(status_box->active_row); | 583 path = gtk_tree_row_reference_get_path(status_box->active_row); |
584 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) | 584 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) |
585 return; | 585 return; |
586 gtk_tree_path_free(path); | 586 gtk_tree_path_free(path); |
587 | 587 |
588 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, | 588 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, |
589 TYPE_COLUMN, &type, | 589 TYPE_COLUMN, &type, |
590 DATA_COLUMN, &data, | 590 DATA_COLUMN, &data, |
591 -1); | 591 -1); |
592 if (type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE) | 592 if (type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE) |
686 0.5, 0.5, GDK_INTERP_BILINEAR, 255); | 686 0.5, 0.5, GDK_INTERP_BILINEAR, 255); |
687 g_object_unref(G_OBJECT(emblem)); | 687 g_object_unref(G_OBJECT(emblem)); |
688 } | 688 } |
689 } | 689 } |
690 #endif | 690 #endif |
691 | 691 |
692 } | 692 } |
693 | 693 |
694 if (status_box->account != NULL) { | 694 if (status_box->account != NULL) { |
695 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>", | 695 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>", |
696 purple_account_get_username(status_box->account), | 696 purple_account_get_username(status_box->account), |
822 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); | 822 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); |
823 g_free(name); | 823 g_free(name); |
824 break; | 824 break; |
825 } | 825 } |
826 g_free(name); | 826 g_free(name); |
827 | 827 |
828 } else if ((type == PIDGIN_STATUS_BOX_TYPE_POPULAR) && | 828 } else if ((type == PIDGIN_STATUS_BOX_TYPE_POPULAR) && |
829 (GPOINTER_TO_INT(data) == purple_savedstatus_get_creation_time(saved_status))) | 829 (GPOINTER_TO_INT(data) == purple_savedstatus_get_creation_time(saved_status))) |
830 { | 830 { |
831 /* Found! */ | 831 /* Found! */ |
832 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); | 832 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); |
1184 | 1184 |
1185 static void | 1185 static void |
1186 cache_pixbufs(PidginStatusBox *status_box) | 1186 cache_pixbufs(PidginStatusBox *status_box) |
1187 { | 1187 { |
1188 GtkIconSize icon_size; | 1188 GtkIconSize icon_size; |
1189 | 1189 |
1190 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); | 1190 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); |
1191 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); | 1191 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); |
1192 | 1192 |
1193 if (status_box->connecting_pixbufs[0] != NULL) | 1193 if (status_box->connecting_pixbufs[0] != NULL) |
1194 gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); | 1194 gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); |
1309 gint monitor_num; | 1309 gint monitor_num; |
1310 GdkRectangle monitor; | 1310 GdkRectangle monitor; |
1311 #endif | 1311 #endif |
1312 GtkRequisition popup_req; | 1312 GtkRequisition popup_req; |
1313 GtkPolicyType hpolicy, vpolicy; | 1313 GtkPolicyType hpolicy, vpolicy; |
1314 | 1314 |
1315 gdk_window_get_origin (GTK_WIDGET(status_box)->window, x, y); | 1315 gdk_window_get_origin (GTK_WIDGET(status_box)->window, x, y); |
1316 | 1316 |
1317 *x += GTK_WIDGET(status_box)->allocation.x; | 1317 *x += GTK_WIDGET(status_box)->allocation.x; |
1318 *y += GTK_WIDGET(status_box)->allocation.y; | 1318 *y += GTK_WIDGET(status_box)->allocation.y; |
1319 | 1319 |
1320 *width = GTK_WIDGET(status_box)->allocation.width; | 1320 *width = GTK_WIDGET(status_box)->allocation.width; |
1321 | 1321 |
1322 hpolicy = vpolicy = GTK_POLICY_NEVER; | 1322 hpolicy = vpolicy = GTK_POLICY_NEVER; |
1323 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), | 1323 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), |
1324 hpolicy, vpolicy); | 1324 hpolicy, vpolicy); |
1325 gtk_widget_size_request (status_box->popup_frame, &popup_req); | 1325 gtk_widget_size_request (status_box->popup_frame, &popup_req); |
1326 | 1326 |
1334 | 1334 |
1335 *height = popup_req.height; | 1335 *height = popup_req.height; |
1336 | 1336 |
1337 #if GTK_CHECK_VERSION(2,2,0) | 1337 #if GTK_CHECK_VERSION(2,2,0) |
1338 screen = gtk_widget_get_screen (GTK_WIDGET (status_box)); | 1338 screen = gtk_widget_get_screen (GTK_WIDGET (status_box)); |
1339 monitor_num = gdk_screen_get_monitor_at_window (screen, | 1339 monitor_num = gdk_screen_get_monitor_at_window (screen, |
1340 GTK_WIDGET (status_box)->window); | 1340 GTK_WIDGET (status_box)->window); |
1341 gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); | 1341 gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); |
1342 | 1342 |
1343 if (*x < monitor.x) | 1343 if (*x < monitor.x) |
1344 *x = monitor.x; | 1344 *x = monitor.x; |
1345 else if (*x + *width > monitor.x + monitor.width) | 1345 else if (*x + *width > monitor.x + monitor.width) |
1346 *x = monitor.x + monitor.width - *width; | 1346 *x = monitor.x + monitor.width - *width; |
1347 | 1347 |
1348 if (*y + GTK_WIDGET(status_box)->allocation.height + *height <= monitor.y + monitor.height) | 1348 if (*y + GTK_WIDGET(status_box)->allocation.height + *height <= monitor.y + monitor.height) |
1349 *y += GTK_WIDGET(status_box)->allocation.height; | 1349 *y += GTK_WIDGET(status_box)->allocation.height; |
1350 else if (*y - *height >= monitor.y) | 1350 else if (*y - *height >= monitor.y) |
1351 *y -= *height; | 1351 *y -= *height; |
1352 else if (monitor.y + monitor.height - (*y + GTK_WIDGET(status_box)->allocation.height) > *y - monitor.y) | 1352 else if (monitor.y + monitor.height - (*y + GTK_WIDGET(status_box)->allocation.height) > *y - monitor.y) |
1353 { | 1353 { |
1354 *y += GTK_WIDGET(status_box)->allocation.height; | 1354 *y += GTK_WIDGET(status_box)->allocation.height; |
1355 *height = monitor.y + monitor.height - *y; | 1355 *height = monitor.y + monitor.height - *y; |
1356 } | 1356 } |
1357 else | 1357 else |
1358 { | 1358 { |
1359 *height = *y - monitor.y; | 1359 *height = *y - monitor.y; |
1360 *y = monitor.y; | 1360 *y = monitor.y; |
1361 } | 1361 } |
1362 | 1362 |
1363 if (popup_req.height > *height) | 1363 if (popup_req.height > *height) |
1364 { | 1364 { |
1365 vpolicy = GTK_POLICY_ALWAYS; | 1365 vpolicy = GTK_POLICY_ALWAYS; |
1366 | 1366 |
1367 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), | 1367 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), |
1368 hpolicy, vpolicy); | 1368 hpolicy, vpolicy); |
1369 } | 1369 } |
1370 #endif | 1370 #endif |
1371 } | 1371 } |
1404 static void | 1404 static void |
1405 pidgin_status_box_popup(PidginStatusBox *box) | 1405 pidgin_status_box_popup(PidginStatusBox *box) |
1406 { | 1406 { |
1407 int width, height, x, y; | 1407 int width, height, x, y; |
1408 pidgin_status_box_list_position (box, &x, &y, &width, &height); | 1408 pidgin_status_box_list_position (box, &x, &y, &width, &height); |
1409 | 1409 |
1410 gtk_widget_set_size_request (box->popup_window, width, height); | 1410 gtk_widget_set_size_request (box->popup_window, width, height); |
1411 gtk_window_move (GTK_WINDOW (box->popup_window), x, y); | 1411 gtk_window_move (GTK_WINDOW (box->popup_window), x, y); |
1412 gtk_widget_show(box->popup_window); | 1412 gtk_widget_show(box->popup_window); |
1413 gtk_widget_grab_focus (box->tree_view); | 1413 gtk_widget_grab_focus (box->tree_view); |
1414 if (!popup_grab_on_window (box->popup_window->window, | 1414 if (!popup_grab_on_window (box->popup_window->window, |
1415 GDK_CURRENT_TIME, TRUE)) { | 1415 GDK_CURRENT_TIME, TRUE)) { |
1440 | 1440 |
1441 static void | 1441 static void |
1442 toggled_cb(GtkWidget *widget, PidginStatusBox *box) | 1442 toggled_cb(GtkWidget *widget, PidginStatusBox *box) |
1443 { | 1443 { |
1444 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { | 1444 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { |
1445 if (!box->popup_in_progress) | 1445 if (!box->popup_in_progress) |
1446 pidgin_status_box_popup (box); | 1446 pidgin_status_box_popup (box); |
1447 } else { | 1447 } else { |
1448 pidgin_status_box_popdown(box); | 1448 pidgin_status_box_popdown(box); |
1449 } | 1449 } |
1450 } | 1450 } |
1529 static void | 1529 static void |
1530 treeview_activate_current_selection(PidginStatusBox *status_box, GtkTreePath *path) | 1530 treeview_activate_current_selection(PidginStatusBox *status_box, GtkTreePath *path) |
1531 { | 1531 { |
1532 if (status_box->active_row) | 1532 if (status_box->active_row) |
1533 gtk_tree_row_reference_free(status_box->active_row); | 1533 gtk_tree_row_reference_free(status_box->active_row); |
1534 | 1534 |
1535 status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); | 1535 status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); |
1536 | 1536 |
1537 pidgin_status_box_popdown (status_box); | 1537 pidgin_status_box_popdown (status_box); |
1538 pidgin_status_box_changed(status_box); | 1538 pidgin_status_box_changed(status_box); |
1539 } | 1539 } |
1540 | 1540 |
1541 static gboolean | 1541 static gboolean |
1542 treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *status_box) | 1542 treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *status_box) |
1543 { | 1543 { |
1544 GtkTreePath *path = NULL; | 1544 GtkTreePath *path = NULL; |
1545 int ret; | 1545 int ret; |
1546 GtkWidget *ewidget = gtk_get_event_widget ((GdkEvent *)event); | 1546 GtkWidget *ewidget = gtk_get_event_widget ((GdkEvent *)event); |
1547 | 1547 |
1548 if (ewidget != status_box->tree_view) { | 1548 if (ewidget != status_box->tree_view) { |
1549 if (ewidget == status_box->toggle_button && | 1549 if (ewidget == status_box->toggle_button && |
1550 status_box->popup_in_progress && | 1550 status_box->popup_in_progress && |
1551 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (status_box->toggle_button))) { | 1551 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (status_box->toggle_button))) { |
1552 pidgin_status_box_popdown (status_box); | 1552 pidgin_status_box_popdown (status_box); |
1553 return TRUE; | 1553 return TRUE; |
1554 } | 1554 } |
1555 | 1555 |
1556 /* released outside treeview */ | 1556 /* released outside treeview */ |
1557 if (ewidget != status_box->toggle_button) | 1557 if (ewidget != status_box->toggle_button) |
1558 { | 1558 { |
1559 pidgin_status_box_popdown (status_box); | 1559 pidgin_status_box_popdown (status_box); |
1560 return TRUE; | 1560 return TRUE; |
1561 } | 1561 } |
1562 | 1562 |
1563 return FALSE; | 1563 return FALSE; |
1564 } | 1564 } |
1565 | 1565 |
1566 ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view), | 1566 ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view), |
1567 event->x, event->y, | 1567 event->x, event->y, |
1568 &path, | 1568 &path, |
1569 NULL, NULL, NULL); | 1569 NULL, NULL, NULL); |
1570 | 1570 |
1571 if (!ret) | 1571 if (!ret) |
1572 return TRUE; /* clicked outside window? */ | 1572 return TRUE; /* clicked outside window? */ |
1573 | 1573 |
1574 treeview_activate_current_selection(status_box, path); | 1574 treeview_activate_current_selection(status_box, path); |
1575 gtk_tree_path_free (path); | 1575 gtk_tree_path_free (path); |
1576 | 1576 |
1577 return TRUE; | 1577 return TRUE; |
1578 } | 1578 } |
1618 status_box->toggle_button = gtk_toggle_button_new(); | 1618 status_box->toggle_button = gtk_toggle_button_new(); |
1619 status_box->hbox = gtk_hbox_new(FALSE, 6); | 1619 status_box->hbox = gtk_hbox_new(FALSE, 6); |
1620 status_box->cell_view = gtk_cell_view_new(); | 1620 status_box->cell_view = gtk_cell_view_new(); |
1621 status_box->vsep = gtk_vseparator_new(); | 1621 status_box->vsep = gtk_vseparator_new(); |
1622 status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); | 1622 status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); |
1623 | 1623 |
1624 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); | 1624 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
1625 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); | 1625 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
1626 ; | 1626 ; |
1627 gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store)); | 1627 gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store)); |
1628 gtk_list_store_append(status_box->store, &(status_box->iter)); | 1628 gtk_list_store_append(status_box->store, &(status_box->iter)); |
1694 gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); | 1694 gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); |
1695 gtk_widget_show(status_box->tree_view); | 1695 gtk_widget_show(status_box->tree_view); |
1696 gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); | 1696 gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); |
1697 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view), | 1697 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view), |
1698 pidgin_tree_view_search_equal_func, NULL, NULL); | 1698 pidgin_tree_view_search_equal_func, NULL, NULL); |
1699 | 1699 |
1700 #if GTK_CHECK_VERSION(2, 6, 0) | 1700 #if GTK_CHECK_VERSION(2, 6, 0) |
1701 g_object_set(text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | 1701 g_object_set(text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
1702 #endif | 1702 #endif |
1703 | 1703 |
1704 status_box->icon_rend = gtk_cell_renderer_pixbuf_new(); | 1704 status_box->icon_rend = gtk_cell_renderer_pixbuf_new(); |
1905 gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event); | 1905 gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event); |
1906 if (status_box->icon_box && status_box->icon_opaque) { | 1906 if (status_box->icon_box && status_box->icon_opaque) { |
1907 gtk_paint_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, | 1907 gtk_paint_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, |
1908 status_box->icon_box, "button", status_box->icon_box->allocation.x-1, status_box->icon_box->allocation.y-1, | 1908 status_box->icon_box, "button", status_box->icon_box->allocation.x-1, status_box->icon_box->allocation.y-1, |
1909 34, 34); | 1909 34, 34); |
1910 } | 1910 } |
1911 return FALSE; | 1911 return FALSE; |
1912 } | 1912 } |
1913 | 1913 |
1914 static void | 1914 static void |
1915 pidgin_status_box_forall(GtkContainer *container, | 1915 pidgin_status_box_forall(GtkContainer *container, |
2062 if (status_box->buddy_icon == NULL) | 2062 if (status_box->buddy_icon == NULL) |
2063 { | 2063 { |
2064 /* Show a placeholder icon */ | 2064 /* Show a placeholder icon */ |
2065 gchar *filename; | 2065 gchar *filename; |
2066 filename = g_build_filename(DATADIR, "pixmaps", | 2066 filename = g_build_filename(DATADIR, "pixmaps", |
2067 "purple", "insert-image.png", NULL); | 2067 "pidgin", "insert-image.png", NULL); |
2068 status_box->buddy_icon = gdk_pixbuf_new_from_file(filename, NULL); | 2068 status_box->buddy_icon = gdk_pixbuf_new_from_file(filename, NULL); |
2069 g_free(filename); | 2069 g_free(filename); |
2070 } | 2070 } |
2071 | 2071 |
2072 if (status_box->buddy_icon != NULL) { | 2072 if (status_box->buddy_icon != NULL) { |
2136 GtkTreeIter iter; | 2136 GtkTreeIter iter; |
2137 GtkTreePath *path; | 2137 GtkTreePath *path; |
2138 char *message; | 2138 char *message; |
2139 PurpleSavedStatus *saved_status = NULL; | 2139 PurpleSavedStatus *saved_status = NULL; |
2140 gboolean changed = TRUE; | 2140 gboolean changed = TRUE; |
2141 | 2141 |
2142 path = gtk_tree_row_reference_get_path(status_box->active_row); | 2142 path = gtk_tree_row_reference_get_path(status_box->active_row); |
2143 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) | 2143 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) |
2144 return; | 2144 return; |
2145 gtk_tree_path_free(path); | 2145 gtk_tree_path_free(path); |
2146 | 2146 |
2186 gint active; | 2186 gint active; |
2187 PurpleStatus *status; | 2187 PurpleStatus *status; |
2188 const char *id = NULL; | 2188 const char *id = NULL; |
2189 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row); | 2189 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row); |
2190 active = gtk_tree_path_get_indices(path)[0]; | 2190 active = gtk_tree_path_get_indices(path)[0]; |
2191 | 2191 |
2192 gtk_tree_path_free(path); | 2192 gtk_tree_path_free(path); |
2193 | 2193 |
2194 status = purple_account_get_active_status(status_box->token_status_account); | 2194 status = purple_account_get_active_status(status_box->token_status_account); |
2195 | 2195 |
2196 acct_status_type = find_status_type_by_index(status_box->token_status_account, active); | 2196 acct_status_type = find_status_type_by_index(status_box->token_status_account, active); |
2384 PidginStatusBoxItemType type; | 2384 PidginStatusBoxItemType type; |
2385 gpointer data; | 2385 gpointer data; |
2386 GList *accounts = NULL, *node; | 2386 GList *accounts = NULL, *node; |
2387 int active; | 2387 int active; |
2388 | 2388 |
2389 | 2389 |
2390 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) | 2390 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) |
2391 return; | 2391 return; |
2392 active = gtk_tree_path_get_indices(path)[0]; | 2392 active = gtk_tree_path_get_indices(path)[0]; |
2393 gtk_tree_path_free(path); | 2393 gtk_tree_path_free(path); |
2394 g_object_set_data(G_OBJECT(status_box), "active", GINT_TO_POINTER(active)); | 2394 g_object_set_data(G_OBJECT(status_box), "active", GINT_TO_POINTER(active)); |
2395 | 2395 |
2396 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, | 2396 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, |
2397 TYPE_COLUMN, &type, | 2397 TYPE_COLUMN, &type, |
2398 DATA_COLUMN, &data, | 2398 DATA_COLUMN, &data, |
2399 -1); | 2399 -1); |
2400 if (status_box->typing != 0) | 2400 if (status_box->typing != 0) |