| 52 | |
| 53 | |
| 54 | FontBuilder::FontBuilder(QWidget *parent) : |
| 55 | QMainWindow(parent), |
| 56 | ui(new Ui::FontBuilder), |
| 57 | m_image_writer(0) |
| 58 | { |
| 59 | ui->setupUi(this); |
| 60 | |
| 61 | |
| 62 | |
| 63 | m_font_config = new FontConfig(this); |
| 64 | bool font_config_block = m_font_config->blockSignals(true); |
| 65 | connect(m_font_config,SIGNAL(nameChanged()),this,SLOT(onFontNameChanged())); |
| 66 | connect(m_font_config,SIGNAL(sizeChanged()),this,SLOT(onFontNameChanged())); |
| 67 | |
| 68 | m_font_renderer = new FontRenderer(this,m_font_config); |
| 69 | |
| 70 | connect(m_font_renderer,SIGNAL(imagesChanged()),this,SLOT(onRenderedChanged())); |
| 71 | |
| 72 | m_layout_config = new LayoutConfig(this); |
| 73 | m_layout_data = new LayoutData(this); |
| 74 | |
| 75 | connect(m_layout_data,SIGNAL(layoutChanged()),this,SLOT(onLayoutChanged())); |
| 76 | |
| 77 | m_layouter = 0; |
| 78 | m_layouter_factory = new LayouterFactory(this); |
| 79 | |
| 80 | bool b = ui->comboBoxLayouter->blockSignals(true); |
| 81 | ui->comboBoxLayouter->clear(); |
| 82 | ui->comboBoxLayouter->addItems(m_layouter_factory->names()); |
| 83 | |
| 84 | m_output_config = new OutputConfig(this); |
| 85 | |
| 86 | QSettings settings; |
| 87 | restoreGeometry(settings.value("geometry").toByteArray()); |
| 88 | readConfig(settings,"fontconfig",m_font_config); |
| 89 | m_font_config->normalize(); |
| 90 | readConfig(settings,"layoutconfig",m_layout_config); |
| 91 | readConfig(settings,"outputconfig",m_output_config); |
| 92 | ui->checkBoxDrawGrid->setChecked(settings.value("draw_grid").toBool()); |
| 93 | ui->widgetFontPreview->setDrawGrid(ui->checkBoxDrawGrid->isChecked()); |
| 94 | connect(ui->checkBoxDrawGrid,SIGNAL(toggled(bool)),this,SLOT(on_checkBoxDrawGrid_toggled(bool))); |
| 95 | |
| 96 | ui->frameCharacters->setConfig(m_font_config); |
| 97 | ui->frameFontOptions->setConfig(m_font_config); |
| 98 | if (!m_layout_config->layouter().isEmpty()) { |
| 99 | for (int i=0;i<ui->comboBoxLayouter->count();i++) |
| 100 | if (ui->comboBoxLayouter->itemText(i)==m_layout_config->layouter()) |
| 101 | ui->comboBoxLayouter->setCurrentIndex(i); |
| 102 | } |
| 103 | ui->frameLayoutConfig->setConfig(m_layout_config); |
| 104 | |
| 105 | |
| 106 | m_exporter_factory = new ExporterFactory(this); |
| 107 | ui->frameOutput->setExporters(m_exporter_factory->names()); |
| 108 | |
| 109 | m_image_writer_factory = new ImageWriterFactory(this); |
| 110 | ui->frameOutput->setImageWriters(m_image_writer_factory->names()); |
| 111 |
nothing calls this directly
no test coverage detected