コード例 #1
0
void RevertDialog::on_radiobutton (GtkToggleButton *togglebutton)
{
  // Bail out if the toggle button gets inactive.
  if (togglebutton)
    if (!gtk_toggle_button_get_active (togglebutton))
      return;
  
  // Clear view.
  changes_gui->clear ();
  
  // Load current text.
  ustring current_text_filename = project_data_filename_chapter(project, book_get(), chapter_get(), false);
  ReadText rt (current_text_filename, true, false);
  
  // View current text?
  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radiobutton_current))) {
    changes_gui->display (rt.lines);
    return;
  }

  // Bail out if no revison has been loaded yet.
  if (!revisionloaded)
    return;
    
  // View history?
  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radiobutton_previous))) {
    changes_gui->display (history_data);
    return;
  }
  
  // View comparison.
  vector <ustring> comparison;
  compare_usfm_text (rt.lines, history_data, comparison, true);
  changes_gui->display (comparison);
}
コード例 #2
0
ファイル: windowmerge.cpp プロジェクト: alerque/bibledit
void WindowMerge::show_comparison()
// Shows the comparison.
{
  ParseLine parseline_main(main_project_data);
  ParseLine parseline_edited(edited_project_data);
  vector < ustring > comparison;
  compare_usfm_text(parseline_main.lines, parseline_edited.lines, comparison, true);
  display_changes_gui->display (comparison);
}