1439 |
return tv->diff_to; |
return tv->diff_to; |
1440 |
} |
} |
1441 |
|
|
1442 |
|
static void |
1443 |
|
_tv_diff_to_unset (AppTranscriptView *tv, gpointer invalid) |
1444 |
|
{ |
1445 |
|
g_return_if_fail (tv->diff_to != invalid); |
1446 |
|
|
1447 |
|
tv->diff_to = NULL; |
1448 |
|
_tv_recalc_diff (tv); |
1449 |
|
} |
1450 |
|
|
1451 |
void |
void |
1452 |
app_transcript_view_set_diff_to (AppTranscriptView *tv, AppTranscript *to) |
app_transcript_view_set_diff_to (AppTranscriptView *tv, AppTranscript *to) |
1453 |
{ |
{ |
1456 |
|
|
1457 |
AppTranscript *tx = _tv_get_model (tv); |
AppTranscript *tx = _tv_get_model (tv); |
1458 |
if (tv->diff_to) { |
if (tv->diff_to) { |
1459 |
|
g_object_weak_unref (G_OBJECT (tv->diff_to), |
1460 |
|
(GWeakNotify)_tv_diff_to_unset, tv); |
1461 |
g_signal_handler_disconnect (tx, tv->diff_change_id[0]); |
g_signal_handler_disconnect (tx, tv->diff_change_id[0]); |
1462 |
if (tx != tv->diff_to) |
if (tx != tv->diff_to) |
1463 |
g_signal_handler_disconnect (tv->diff_to, tv->diff_change_id[1]); |
g_signal_handler_disconnect (tv->diff_to, tv->diff_change_id[1]); |
1467 |
|
|
1468 |
// this can be triggered noninteractively |
// this can be triggered noninteractively |
1469 |
// need to verify that gui is in sync XXX |
// need to verify that gui is in sync XXX |
1470 |
|
// is this still true now that special revert-tracking is removed? |
1471 |
|
|
1472 |
if (to) { |
if (to) { |
1473 |
|
g_object_weak_ref (G_OBJECT (to), (GWeakNotify) _tv_diff_to_unset, tv); |
1474 |
|
|
1475 |
AppTranscriptView *to_view = app_transcript_get_view (to); |
AppTranscriptView *to_view = app_transcript_get_view (to); |
1476 |
if (!to_view) |
if (!to_view) |
1477 |
gtk_widget_show_all (app_transcript_view_new (to)); |
gtk_widget_show_all (app_transcript_view_new (to)); |
1490 |
_tv_show_diff_detail (tv); |
_tv_show_diff_detail (tv); |
1491 |
} |
} |
1492 |
|
|
|
static void |
|
|
_tv_replace_transcript (AppTranscriptView *tv, |
|
|
gpointer from, AppTranscript *to) |
|
|
{ |
|
|
if (from == _tv_get_model (tv)) |
|
|
doc_gui_set_model (DOC_GUI (tv), LEADR_DOC (to)); |
|
|
|
|
|
if (from == tv->diff_to) |
|
|
app_transcript_view_set_diff_to (tv, to); |
|
|
} |
|
|
|
|
|
static void |
|
|
_tv_release_transcript (AppTranscriptView *tv, AppTranscript *tx) |
|
|
{ |
|
|
if (tx == tv->diff_to) |
|
|
app_transcript_view_set_diff_to (tv, NULL); |
|
|
} |
|
|
|
|
1493 |
/* |
/* |
1494 |
static void |
static void |
1495 |
_tv_batch_select_start (AppTranscriptView *tv) |
_tv_batch_select_start (AppTranscriptView *tv) |
2253 |
g_signal_connect_object |
g_signal_connect_object |
2254 |
(Whole, "empathy-changed", |
(Whole, "empathy-changed", |
2255 |
G_CALLBACK (_tv_load_empathy), cx, G_CONNECT_SWAPPED); |
G_CALLBACK (_tv_load_empathy), cx, G_CONNECT_SWAPPED); |
|
g_signal_connect_object |
|
|
(Whole, "replace-transcript", |
|
|
G_CALLBACK (_tv_replace_transcript), cx, G_CONNECT_SWAPPED); |
|
|
g_signal_connect_object |
|
|
(Whole, "release-transcript", |
|
|
G_CALLBACK (_tv_release_transcript), cx, G_CONNECT_SWAPPED); |
|
2256 |
|
|
2257 |
//gtk_accel_map_save ("./accel-test"); |
//gtk_accel_map_save ("./accel-test"); |
2258 |
} |
} |