3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "QPrefsDialog.h"
16 #include "lcolorcache.h"
18 #include "qt_helpers.h"
20 #include "ui/QPrefAsciiModule.h"
21 #include "ui/QPrefDateModule.h"
22 #include "ui/QPrefKeyboardModule.h"
23 #include "ui/QPrefLatexModule.h"
24 #include "ui/QPrefScreenFontsModule.h"
25 #include "ui/QPrefColorsModule.h"
26 #include "ui/QPrefDisplayModule.h"
27 #include "ui/QPrefPathsModule.h"
28 #include "ui/QPrefSpellcheckerModule.h"
29 #include "ui/QPrefLanguageModule.h"
30 #include "ui/QPrefPrinterModule.h"
31 #include "ui/QPrefUIModule.h"
32 #include "ui/QPrefIdentityModule.h"
35 #include "lastfiles.h"
39 #include "support/lstrings.h"
40 #include "support/tostr.h"
42 #include "controllers/ControlPrefs.h"
43 #include "controllers/frnt_lang.h"
44 #include "controllers/helper_funcs.h"
46 #include "frontends/lyx_gui.h"
48 #include <qcheckbox.h>
49 #include "qcoloritem.h"
50 #include <qcombobox.h>
52 #include <qlineedit.h>
53 #include <qpushbutton.h>
56 #include <boost/tuple/tuple.hpp>
61 using lyx::support::compare_no_case;
62 using lyx::support::strToDbl;
69 using std::ostringstream;
76 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
78 QPrefs::QPrefs(Dialog & parent)
79 : base_class(parent, _("LyX: Preferences"))
84 Converters & QPrefs::converters()
86 return controller().converters();
90 Formats & QPrefs::formats()
92 return controller().formats();
96 Movers & QPrefs::movers()
98 return controller().movers();
102 void QPrefs::build_dialog()
104 dialog_.reset(new QPrefsDialog(this));
106 bcview().setOK(dialog_->savePB);
107 bcview().setApply(dialog_->applyPB);
108 bcview().setCancel(dialog_->closePB);
109 bcview().setRestore(dialog_->restorePB);
111 dialog_->uiModule->lastfilesSB->setMaxValue(maxlastfiles);
113 QPrefLanguageModule * langmod(dialog_->languageModule);
115 langmod->defaultLanguageCO->clear();
116 // store the lang identifiers for later
117 using lyx::frontend::LanguagePair;
118 vector<LanguagePair> const langs =
119 lyx::frontend::getLanguageData(false);
120 lang_ = getSecond(langs);
122 vector<LanguagePair>::const_iterator lit = langs.begin();
123 vector<LanguagePair>::const_iterator lend = langs.end();
124 for (; lit != lend; ++lit) {
125 langmod->defaultLanguageCO->insertItem(toqstr(lit->first));
128 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
129 spellmod->spellCommandCO->insertItem(qt_("ispell"));
130 spellmod->spellCommandCO->insertItem(qt_("aspell"));
131 spellmod->spellCommandCO->insertItem(qt_("hspell"));
133 spellmod->spellCommandCO->insertItem(qt_("pspell (library)"));
136 spellmod->spellCommandCO->insertItem(qt_("aspell (library)"));
144 LyXRC & rc(controller().rc());
146 QPrefLanguageModule * langmod(dialog_->languageModule);
148 // FIXME: remove rtl_support bool
149 rc.rtl_support = langmod->rtlCB->isChecked();
150 rc.mark_foreign_language = langmod->markForeignCB->isChecked();
151 rc.language_auto_begin = langmod->autoBeginCB->isChecked();
152 rc.language_auto_end = langmod->autoEndCB->isChecked();
153 rc.language_use_babel = langmod->useBabelCB->isChecked();
154 rc.language_global_options = langmod->globalCB->isChecked();
155 rc.language_package = fromqstr(langmod->languagePackageED->text());
156 rc.language_command_begin = fromqstr(langmod->startCommandED->text());
157 rc.language_command_end = fromqstr(langmod->endCommandED->text());
158 rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
160 QPrefUIModule * uimod(dialog_->uiModule);
162 rc.ui_file = fromqstr(uimod->uiFileED->text());
163 rc.bind_file = fromqstr(uimod->bindFileED->text());
164 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
165 rc.wheel_jump = uimod->wheelMouseSB->value();
166 rc.autosave = uimod->autoSaveSB->value() * 60;
167 rc.make_backup = uimod->autoSaveCB->isChecked();
168 rc.num_lastfiles = uimod->lastfilesSB->value();
171 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
173 // FIXME: can derive CB from the two EDs
174 rc.use_kbmap = keymod->keymapCB->isChecked();
175 rc.primary_kbmap = fromqstr(keymod->firstKeymapED->text());
176 rc.secondary_kbmap = fromqstr(keymod->secondKeymapED->text());
179 QPrefAsciiModule * ascmod(dialog_->asciiModule);
181 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
182 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
185 QPrefDateModule * datemod(dialog_->dateModule);
187 rc.date_insert_format = fromqstr(datemod->DateED->text());
190 QPrefLatexModule * latexmod(dialog_->latexModule);
192 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
193 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
194 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
195 rc.index_command = fromqstr(latexmod->latexIndexED->text());
196 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
197 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
198 rc.default_papersize =
199 static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
201 QPrefDisplayModule * displaymod(dialog_->displayModule);
203 switch (displaymod->instantPreviewCO->currentItem()) {
205 rc.preview = LyXRC::PREVIEW_OFF;
208 rc.preview = LyXRC::PREVIEW_NO_MATH;
211 rc.preview = LyXRC::PREVIEW_ON;
215 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
217 switch (displaymod->displayGraphicsCO->currentItem()) {
218 case 3: dtype = lyx::graphics::NoDisplay; break;
219 case 2: dtype = lyx::graphics::ColorDisplay; break;
220 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
221 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
223 rc.display_graphics = dtype;
226 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
229 if (old_value != rc.display_graphics) {
230 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
235 QPrefPathsModule * pathsmod(dialog_->pathsModule);
237 rc.document_path = fromqstr(pathsmod->workingDirED->text());
238 rc.template_path = fromqstr(pathsmod->templateDirED->text());
239 rc.backupdir_path = fromqstr(pathsmod->backupDirED->text());
240 rc.tempdir_path = fromqstr(pathsmod->tempDirED->text());
241 // FIXME: should be a checkbox only
242 rc.lyxpipes = fromqstr(pathsmod->lyxserverDirED->text());
245 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
247 switch (spellmod->spellCommandCO->currentItem()) {
251 rc.use_spell_lib = false;
252 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
255 rc.use_spell_lib = true;
259 // FIXME: remove isp_use_alt_lang
260 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
261 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
262 // FIXME: remove isp_use_esc_chars
263 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
264 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
265 // FIXME: remove isp_use_pers_dict
266 rc.isp_pers_dict = fromqstr(spellmod->persDictionaryED->text());
267 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
268 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
269 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
272 QPrefPrinterModule * printmod(dialog_->printerModule);
274 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
275 rc.print_command = fromqstr(printmod->printerCommandED->text());
276 rc.printer = fromqstr(printmod->printerNameED->text());
278 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
279 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
280 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
281 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
282 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
283 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
284 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
285 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
286 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
287 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
288 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
289 rc.print_to_file = fromqstr(printmod->printerToFileED->text());
290 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
291 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
292 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
295 QPrefIdentityModule * idmod(dialog_->identityModule);
296 rc.user_name = fromqstr(idmod->nameED->text());
297 rc.user_email = fromqstr(idmod->emailED->text());
299 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
301 LyXRC const oldrc(rc);
303 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
304 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
305 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
306 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
307 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
308 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
310 rc.zoom = fontmod->screenZoomSB->value();
311 rc.dpi = fontmod->screenDpiSB->value();
312 rc.font_sizes[LyXFont::SIZE_TINY] = strToDbl(fromqstr(fontmod->screenTinyED->text()));
313 rc.font_sizes[LyXFont::SIZE_SCRIPT] = strToDbl(fromqstr(fontmod->screenSmallestED->text()));
314 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = strToDbl(fromqstr(fontmod->screenSmallerED->text()));
315 rc.font_sizes[LyXFont::SIZE_SMALL] = strToDbl(fromqstr(fontmod->screenSmallED->text()));
316 rc.font_sizes[LyXFont::SIZE_NORMAL] = strToDbl(fromqstr(fontmod->screenNormalED->text()));
317 rc.font_sizes[LyXFont::SIZE_LARGE] = strToDbl(fromqstr(fontmod->screenLargeED->text()));
318 rc.font_sizes[LyXFont::SIZE_LARGER] = strToDbl(fromqstr(fontmod->screenLargerED->text()));
319 rc.font_sizes[LyXFont::SIZE_LARGEST] = strToDbl(fromqstr(fontmod->screenLargestED->text()));
320 rc.font_sizes[LyXFont::SIZE_HUGE] = strToDbl(fromqstr(fontmod->screenHugeED->text()));
321 rc.font_sizes[LyXFont::SIZE_HUGER] = strToDbl(fromqstr(fontmod->screenHugerED->text()));
323 if (rc.font_sizes != oldrc.font_sizes
324 || rc.roman_font_name != oldrc.roman_font_name
325 || rc.sans_font_name != oldrc.sans_font_name
326 || rc.typewriter_font_name != oldrc.typewriter_font_name
327 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
328 controller().updateScreenFonts();
331 QPrefColorsModule * colmod(dialog_->colorsModule);
335 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
336 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
337 QColorItem * ci(static_cast<QColorItem*>(ib));
339 LColor::color const col(dialog_->colors_[i]);
340 QColor const & qcol(lcolorcache.get(col));
342 // FIXME: dubious, but it's what xforms does
343 if (qcol != ci->color()) {
346 ostr << '#' << std::setbase(16) << setfill('0')
347 << setw(2) << ci->color().red()
348 << setw(2) << ci->color().green()
349 << setw(2) << ci->color().blue();
351 string newhex(ostr.str());
352 controller().setColor(col, newhex);
358 // FIXME: move to helper_funcs.h
362 typename std::vector<A>::size_type
363 findPos(std::vector<A> const & vec, A const & val)
365 typedef typename std::vector<A>::const_iterator Cit;
367 Cit it = std::find(vec.begin(), vec.end(), val);
370 return distance(vec.begin(), it);
373 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
375 string const name = makeFontName(family, foundry);
376 for (int i = 0; i < cb->count(); ++i) {
377 if (fromqstr(cb->text(i)) == name) {
378 cb->setCurrentItem(i);
383 // Try matching without foundry name
385 // We count in reverse in order to prefer the Xft foundry
386 for (int i = cb->count() - 1; i >= 0; --i) {
387 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
388 if (compare_no_case(tmp.first, family) == 0) {
389 cb->setCurrentItem(i);
394 // family alone can contain e.g. "Helvetica [Adobe]"
395 pair<string, string> tmpfam = parseFontName(family);
397 // We count in reverse in order to prefer the Xft foundry
398 for (int i = cb->count() - 1; i >= 0; --i) {
399 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
400 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
401 cb->setCurrentItem(i);
406 // Bleh, default fonts, and the names couldn't be found. Hack
407 // for bug 1063. Qt makes baby Jesus cry.
411 if (family == lyx_gui::roman_font_name()) {
412 font.setStyleHint(QFont::Serif);
413 font.setFamily(lyx_gui::roman_font_name().c_str());
414 } else if (family == lyx_gui::sans_font_name()) {
415 font.setStyleHint(QFont::SansSerif);
416 font.setFamily(lyx_gui::sans_font_name().c_str());
417 } else if (family == lyx_gui::typewriter_font_name()) {
418 font.setStyleHint(QFont::TypeWriter);
419 font.setFamily(lyx_gui::typewriter_font_name().c_str());
421 lyxerr << "FAILED to find the default font !"
422 << foundry << ", " << family << endl;
426 QFontInfo info(font);
427 lyxerr << "Apparent font is " << info.family() << endl;
429 for (int i = 0; i < cb->count(); ++i) {
430 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
431 if (compare_no_case(fromqstr(cb->text(i)), fromqstr(info.family())) == 0) {
432 cb->setCurrentItem(i);
437 lyxerr << "FAILED to find the font !"
438 << foundry << ", " << family << endl;
441 } // end namespace anon
444 void QPrefs::update_contents()
446 LyXRC const & rc(controller().rc());
448 QPrefLanguageModule * langmod(dialog_->languageModule);
450 // FIXME: remove rtl_support bool
451 langmod->rtlCB->setChecked(rc.rtl_support);
452 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
453 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
454 langmod->autoEndCB->setChecked(rc.language_auto_end);
455 langmod->useBabelCB->setChecked(rc.language_use_babel);
456 langmod->globalCB->setChecked(rc.language_global_options);
457 langmod->languagePackageED->setText(toqstr(rc.language_package));
458 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
459 langmod->endCommandED->setText(toqstr(rc.language_command_end));
461 int const pos = int(findPos(lang_, rc.default_language));
462 langmod->defaultLanguageCO->setCurrentItem(pos);
464 QPrefUIModule * uimod(dialog_->uiModule);
466 uimod->uiFileED->setText(toqstr(rc.ui_file));
467 uimod->bindFileED->setText(toqstr(rc.bind_file));
468 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
469 uimod->wheelMouseSB->setValue(rc.wheel_jump);
470 // convert to minutes
471 int mins(rc.autosave / 60);
472 if (rc.autosave && !mins)
474 uimod->autoSaveSB->setValue(mins);
475 uimod->autoSaveCB->setChecked(rc.make_backup);
476 uimod->lastfilesSB->setValue(rc.num_lastfiles);
479 QPrefIdentityModule * idmod(dialog_->identityModule);
480 idmod->nameED->setText(toqstr(rc.user_name));
481 idmod->emailED->setText(toqstr(rc.user_email));
484 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
486 // FIXME: can derive CB from the two EDs
487 keymod->keymapCB->setChecked(rc.use_kbmap);
488 // no idea why we need these. Fscking Qt.
489 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
490 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
491 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
492 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
493 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
494 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
495 keymod->firstKeymapED->setText(toqstr(rc.primary_kbmap));
496 keymod->secondKeymapED->setText(toqstr(rc.secondary_kbmap));
499 QPrefAsciiModule * ascmod(dialog_->asciiModule);
501 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
502 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
505 QPrefDateModule * datemod(dialog_->dateModule);
507 datemod->DateED->setText(toqstr(rc.date_insert_format));
510 QPrefLatexModule * latexmod(dialog_->latexModule);
512 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
513 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
514 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
515 latexmod->latexIndexED->setText(toqstr(rc.index_command));
516 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
517 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
518 latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
521 QPrefDisplayModule * displaymod(dialog_->displayModule);
523 switch (rc.preview) {
524 case LyXRC::PREVIEW_OFF:
525 displaymod->instantPreviewCO->setCurrentItem(0);
527 case LyXRC::PREVIEW_NO_MATH :
528 displaymod->instantPreviewCO->setCurrentItem(1);
530 case LyXRC::PREVIEW_ON :
531 displaymod->instantPreviewCO->setCurrentItem(2);
537 switch (rc.display_graphics) {
538 case lyx::graphics::NoDisplay: item = 3; break;
539 case lyx::graphics::ColorDisplay: item = 2; break;
540 case lyx::graphics::GrayscaleDisplay: item = 1; break;
541 case lyx::graphics::MonochromeDisplay: item = 0; break;
544 displaymod->displayGraphicsCO->setCurrentItem(item);
547 QPrefPathsModule * pathsmod(dialog_->pathsModule);
549 pathsmod->workingDirED->setText(toqstr(rc.document_path));
550 pathsmod->templateDirED->setText(toqstr(rc.template_path));
551 pathsmod->backupDirED->setText(toqstr(rc.backupdir_path));
552 pathsmod->tempDirED->setText(toqstr(rc.tempdir_path));
553 // FIXME: should be a checkbox only
554 pathsmod->lyxserverDirED->setText(toqstr(rc.lyxpipes));
557 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
559 spellmod->spellCommandCO->setCurrentItem(0);
561 if (rc.isp_command == "ispell") {
562 spellmod->spellCommandCO->setCurrentItem(0);
563 } else if (rc.isp_command == "aspell") {
564 spellmod->spellCommandCO->setCurrentItem(1);
565 } else if (rc.isp_command == "hspell") {
566 spellmod->spellCommandCO->setCurrentItem(2);
569 if (rc.use_spell_lib) {
570 #if defined(USE_ASPELL) || defined(USE_PSPELL)
571 spellmod->spellCommandCO->setCurrentItem(3);
575 // FIXME: remove isp_use_alt_lang
576 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
577 // FIXME: remove isp_use_esc_chars
578 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
579 // FIXME: remove isp_use_pers_dict
580 spellmod->persDictionaryED->setText(toqstr(rc.isp_pers_dict));
581 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
582 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
585 QPrefPrinterModule * printmod(dialog_->printerModule);
587 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
588 printmod->printerCommandED->setText(toqstr(rc.print_command));
589 printmod->printerNameED->setText(toqstr(rc.printer));
591 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
592 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
593 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
594 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
595 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
596 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
597 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
598 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
599 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
600 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
601 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
602 printmod->printerToFileED->setText(toqstr(rc.print_to_file));
603 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
604 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
605 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
608 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
610 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
611 rc.roman_font_foundry);
612 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
613 rc.sans_font_foundry);
614 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
615 rc.typewriter_font_foundry);
617 dialog_->select_roman(fontmod->screenRomanCO->currentText());
618 dialog_->select_sans(fontmod->screenSansCO->currentText());
619 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
621 fontmod->screenZoomSB->setValue(rc.zoom);
622 fontmod->screenDpiSB->setValue(int(rc.dpi));
623 fontmod->screenTinyED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_TINY])));
624 fontmod->screenSmallestED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_SCRIPT])));
625 fontmod->screenSmallerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE])));
626 fontmod->screenSmallED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_SMALL])));
627 fontmod->screenNormalED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_NORMAL])));
628 fontmod->screenLargeED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGE])));
629 fontmod->screenLargerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGER])));
630 fontmod->screenLargestED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGEST])));
631 fontmod->screenHugeED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_HUGE])));
632 fontmod->screenHugerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_HUGER])));
634 dialog_->updateFormats();
635 dialog_->updateConverters();
636 dialog_->updateCopiers();
639 } // namespace frontend