Ejemplo n.º 1
0
static void set_tab_compilation_settings(GuPrefsGui* prefs)
{
  /* Setting available typesetters and the active one */
  /* TODO: iterate the available typesetter list and gtk_builder the objects
   * maybe.. or not.. */


  if (pdflatex_detected()) {
    if (pdflatex_active())
      gtk_toggle_button_set_active(prefs->typ_pdflatex, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_pdflatex), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_pdflatex), "");
  }

  if (xelatex_detected()) {
    if (xelatex_active())
      gtk_toggle_button_set_active(prefs->typ_xelatex, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_xelatex), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_xelatex), "");
  }

  if (rubber_detected()) {
    if (rubber_active())
      gtk_toggle_button_set_active(prefs->typ_rubber, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_rubber), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_rubber), "");
  }

  if (latexmk_detected()) {
    if (latexmk_active())
      gtk_toggle_button_set_active(prefs->typ_latexmk, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_latexmk), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_latexmk), "");
  }

  if (latex_method_active("texpdf")) {
    gtk_toggle_button_set_active(prefs->method_texpdf, TRUE);
  } else if (latex_method_active("texdvipdf")) {
    gtk_toggle_button_set_active(prefs->method_texdvipdf, TRUE);
  } else if (latex_method_active("texdvipspdf")) {
    gtk_toggle_button_set_active(prefs->method_texdvipspdf, TRUE);
  }

  if (!latex_use_shellescaping())
    gtk_toggle_button_set_active(prefs->opt_shellescape, FALSE);
  else {
    gtk_toggle_button_set_active(prefs->opt_shellescape, TRUE);
  }

  if (latex_can_synctex()) {
    if (config_get_value("synctex")) {
      gtk_toggle_button_set_active(prefs->opt_synctex, TRUE);
    } else {
      gtk_toggle_button_set_active(prefs->opt_synctex, FALSE);
    }
  }
}
Ejemplo n.º 2
0
Archivo: texlive.c Proyecto: sygi/gummi
gchar* texlive_get_flags (const gchar* method) {
    gchar* flags = g_strdup_printf("-interaction=nonstopmode "
                                      "-file-line-error "
                                      "-halt-on-error");

    if (!latex_use_shellescaping()) {
        gchar* tmp = g_strconcat(flags, " -no-shell-escape", NULL);
        g_free(flags);
        flags = tmp;
    }
    else {
        gchar* tmp = g_strconcat(flags, " -shell-escape", NULL);
        g_free(flags);
        flags = tmp;
    }

    if (config_get_value("synctex")) {
        gchar* tmp = g_strconcat(flags, " -synctex=1", NULL);
        g_free(flags);
        flags = tmp;
    }

    return flags;
}