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 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
27 #include "ui/QPrefCygwinPathModule.h"
29 #include "ui/QPrefDisplayModule.h"
30 #include "ui/QPrefPathsModule.h"
31 #include "ui/QPrefSpellcheckerModule.h"
32 #include "ui/QPrefLanguageModule.h"
33 #include "ui/QPrefPrinterModule.h"
34 #include "ui/QPrefUIModule.h"
35 #include "ui/QPrefIdentityModule.h"
38 #include "lastfiles.h"
42 #include "support/lstrings.h"
44 #include "controllers/ControlPrefs.h"
45 #include "controllers/frnt_lang.h"
46 #include "controllers/helper_funcs.h"
48 #include "frontends/lyx_gui.h"
50 #include <qcheckbox.h>
51 #include "qcoloritem.h"
52 #include <qcombobox.h>
54 #include <qlineedit.h>
55 #include <qpushbutton.h>
58 #include <boost/tuple/tuple.hpp>
63 using lyx::support::compare_no_case;
64 using lyx::support::strToDbl;
71 using std::ostringstream;
78 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
80 QPrefs::QPrefs(Dialog & parent)
81 : base_class(parent, _("LyX: Preferences"))
86 Converters & QPrefs::converters()
88 return controller().converters();
92 Formats & QPrefs::formats()
94 return controller().formats();
98 Movers & QPrefs::movers()
100 return controller().movers();
104 void QPrefs::build_dialog()
106 dialog_.reset(new QPrefsDialog(this));
108 bcview().setOK(dialog_->savePB);
109 bcview().setApply(dialog_->applyPB);
110 bcview().setCancel(dialog_->closePB);
111 bcview().setRestore(dialog_->restorePB);
113 dialog_->uiModule->lastfilesSB->setMaxValue(maxlastfiles);
115 QPrefLanguageModule * langmod(dialog_->languageModule);
117 langmod->defaultLanguageCO->clear();
118 // store the lang identifiers for later
119 using lyx::frontend::LanguagePair;
120 vector<LanguagePair> const langs =
121 lyx::frontend::getLanguageData(false);
122 lang_ = getSecond(langs);
124 vector<LanguagePair>::const_iterator lit = langs.begin();
125 vector<LanguagePair>::const_iterator lend = langs.end();
126 for (; lit != lend; ++lit) {
127 langmod->defaultLanguageCO->insertItem(toqstr(lit->first));
130 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
131 spellmod->spellCommandCO->insertItem(qt_("ispell"));
132 spellmod->spellCommandCO->insertItem(qt_("aspell"));
133 spellmod->spellCommandCO->insertItem(qt_("hspell"));
135 spellmod->spellCommandCO->insertItem(qt_("pspell (library)"));
138 spellmod->spellCommandCO->insertItem(qt_("aspell (library)"));
146 LyXRC & rc(controller().rc());
148 QPrefLanguageModule * langmod(dialog_->languageModule);
150 // FIXME: remove rtl_support bool
151 rc.rtl_support = langmod->rtlCB->isChecked();
152 rc.mark_foreign_language = langmod->markForeignCB->isChecked();
153 rc.language_auto_begin = langmod->autoBeginCB->isChecked();
154 rc.language_auto_end = langmod->autoEndCB->isChecked();
155 rc.language_use_babel = langmod->useBabelCB->isChecked();
156 rc.language_global_options = langmod->globalCB->isChecked();
157 rc.language_package = fromqstr(langmod->languagePackageED->text());
158 rc.language_command_begin = fromqstr(langmod->startCommandED->text());
159 rc.language_command_end = fromqstr(langmod->endCommandED->text());
160 rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
162 QPrefUIModule * uimod(dialog_->uiModule);
164 rc.ui_file = fromqstr(uimod->uiFileED->text());
165 rc.bind_file = fromqstr(uimod->bindFileED->text());
166 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
167 rc.wheel_jump = uimod->wheelMouseSB->value();
168 rc.autosave = uimod->autoSaveSB->value() * 60;
169 rc.make_backup = uimod->autoSaveCB->isChecked();
170 rc.num_lastfiles = uimod->lastfilesSB->value();
173 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
175 // FIXME: can derive CB from the two EDs
176 rc.use_kbmap = keymod->keymapCB->isChecked();
177 rc.primary_kbmap = fromqstr(keymod->firstKeymapED->text());
178 rc.secondary_kbmap = fromqstr(keymod->secondKeymapED->text());
181 QPrefAsciiModule * ascmod(dialog_->asciiModule);
183 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
184 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
187 QPrefDateModule * datemod(dialog_->dateModule);
189 rc.date_insert_format = fromqstr(datemod->DateED->text());
191 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
192 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
193 rc.cygwin_path_fix = cygwinmod->pathCB->isChecked();
196 QPrefLatexModule * latexmod(dialog_->latexModule);
198 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
199 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
200 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
201 rc.index_command = fromqstr(latexmod->latexIndexED->text());
202 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
203 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
204 rc.default_papersize =
205 static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
207 QPrefDisplayModule * displaymod(dialog_->displayModule);
209 switch (displaymod->instantPreviewCO->currentItem()) {
211 rc.preview = LyXRC::PREVIEW_OFF;
214 rc.preview = LyXRC::PREVIEW_NO_MATH;
217 rc.preview = LyXRC::PREVIEW_ON;
221 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
223 switch (displaymod->displayGraphicsCO->currentItem()) {
224 case 3: dtype = lyx::graphics::NoDisplay; break;
225 case 2: dtype = lyx::graphics::ColorDisplay; break;
226 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
227 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
229 rc.display_graphics = dtype;
232 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
235 if (old_value != rc.display_graphics) {
236 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
241 QPrefPathsModule * pathsmod(dialog_->pathsModule);
243 rc.document_path = fromqstr(pathsmod->workingDirED->text());
244 rc.template_path = fromqstr(pathsmod->templateDirED->text());
245 rc.backupdir_path = fromqstr(pathsmod->backupDirED->text());
246 rc.tempdir_path = fromqstr(pathsmod->tempDirED->text());
247 rc.path_prefix = fromqstr(pathsmod->pathPrefixED->text());
248 // FIXME: should be a checkbox only
249 rc.lyxpipes = fromqstr(pathsmod->lyxserverDirED->text());
252 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
254 switch (spellmod->spellCommandCO->currentItem()) {
258 rc.use_spell_lib = false;
259 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
262 rc.use_spell_lib = true;
266 // FIXME: remove isp_use_alt_lang
267 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
268 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
269 // FIXME: remove isp_use_esc_chars
270 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
271 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
272 // FIXME: remove isp_use_pers_dict
273 rc.isp_pers_dict = fromqstr(spellmod->persDictionaryED->text());
274 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
275 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
276 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
279 QPrefPrinterModule * printmod(dialog_->printerModule);
281 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
282 rc.print_command = fromqstr(printmod->printerCommandED->text());
283 rc.printer = fromqstr(printmod->printerNameED->text());
285 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
286 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
287 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
288 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
289 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
290 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
291 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
292 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
293 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
294 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
295 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
296 rc.print_to_file = fromqstr(printmod->printerToFileED->text());
297 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
298 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
299 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
302 QPrefIdentityModule * idmod(dialog_->identityModule);
303 rc.user_name = fromqstr(idmod->nameED->text());
304 rc.user_email = fromqstr(idmod->emailED->text());
306 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
308 LyXRC const oldrc(rc);
310 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
311 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
312 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
313 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
314 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
315 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
317 rc.zoom = fontmod->screenZoomSB->value();
318 rc.dpi = fontmod->screenDpiSB->value();
319 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
320 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
321 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
322 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
323 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
324 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
325 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
326 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
327 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
328 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
330 if (rc.font_sizes != oldrc.font_sizes
331 || rc.roman_font_name != oldrc.roman_font_name
332 || rc.sans_font_name != oldrc.sans_font_name
333 || rc.typewriter_font_name != oldrc.typewriter_font_name
334 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
335 controller().updateScreenFonts();
338 QPrefColorsModule * colmod(dialog_->colorsModule);
342 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
343 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
344 QColorItem * ci(static_cast<QColorItem*>(ib));
346 LColor::color const col(dialog_->colors_[i]);
347 QColor const & qcol(lcolorcache.get(col));
349 // FIXME: dubious, but it's what xforms does
350 if (qcol != ci->color()) {
353 ostr << '#' << std::setbase(16) << setfill('0')
354 << setw(2) << ci->color().red()
355 << setw(2) << ci->color().green()
356 << setw(2) << ci->color().blue();
358 string newhex(ostr.str());
359 controller().setColor(col, newhex);
365 // FIXME: move to helper_funcs.h
369 typename std::vector<A>::size_type
370 findPos(std::vector<A> const & vec, A const & val)
372 typedef typename std::vector<A>::const_iterator Cit;
374 Cit it = std::find(vec.begin(), vec.end(), val);
377 return distance(vec.begin(), it);
380 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
382 string const name = makeFontName(family, foundry);
383 for (int i = 0; i < cb->count(); ++i) {
384 if (fromqstr(cb->text(i)) == name) {
385 cb->setCurrentItem(i);
390 // Try matching without foundry name
392 // We count in reverse in order to prefer the Xft foundry
393 for (int i = cb->count() - 1; i >= 0; --i) {
394 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
395 if (compare_no_case(tmp.first, family) == 0) {
396 cb->setCurrentItem(i);
401 // family alone can contain e.g. "Helvetica [Adobe]"
402 pair<string, string> tmpfam = parseFontName(family);
404 // We count in reverse in order to prefer the Xft foundry
405 for (int i = cb->count() - 1; i >= 0; --i) {
406 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
407 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
408 cb->setCurrentItem(i);
413 // Bleh, default fonts, and the names couldn't be found. Hack
414 // for bug 1063. Qt makes baby Jesus cry.
418 if (family == lyx_gui::roman_font_name()) {
419 font.setStyleHint(QFont::Serif);
420 font.setFamily(lyx_gui::roman_font_name().c_str());
421 } else if (family == lyx_gui::sans_font_name()) {
422 font.setStyleHint(QFont::SansSerif);
423 font.setFamily(lyx_gui::sans_font_name().c_str());
424 } else if (family == lyx_gui::typewriter_font_name()) {
425 font.setStyleHint(QFont::TypeWriter);
426 font.setFamily(lyx_gui::typewriter_font_name().c_str());
428 lyxerr << "FAILED to find the default font !"
429 << foundry << ", " << family << endl;
433 QFontInfo info(font);
434 lyxerr << "Apparent font is " << info.family() << endl;
436 for (int i = 0; i < cb->count(); ++i) {
437 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
438 if (compare_no_case(fromqstr(cb->text(i)), fromqstr(info.family())) == 0) {
439 cb->setCurrentItem(i);
444 lyxerr << "FAILED to find the font !"
445 << foundry << ", " << family << endl;
448 } // end namespace anon
451 void QPrefs::update_contents()
453 LyXRC const & rc(controller().rc());
455 QPrefLanguageModule * langmod(dialog_->languageModule);
457 // FIXME: remove rtl_support bool
458 langmod->rtlCB->setChecked(rc.rtl_support);
459 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
460 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
461 langmod->autoEndCB->setChecked(rc.language_auto_end);
462 langmod->useBabelCB->setChecked(rc.language_use_babel);
463 langmod->globalCB->setChecked(rc.language_global_options);
464 langmod->languagePackageED->setText(toqstr(rc.language_package));
465 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
466 langmod->endCommandED->setText(toqstr(rc.language_command_end));
468 int const pos = int(findPos(lang_, rc.default_language));
469 langmod->defaultLanguageCO->setCurrentItem(pos);
471 QPrefUIModule * uimod(dialog_->uiModule);
473 uimod->uiFileED->setText(toqstr(rc.ui_file));
474 uimod->bindFileED->setText(toqstr(rc.bind_file));
475 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
476 uimod->wheelMouseSB->setValue(rc.wheel_jump);
477 // convert to minutes
478 int mins(rc.autosave / 60);
479 if (rc.autosave && !mins)
481 uimod->autoSaveSB->setValue(mins);
482 uimod->autoSaveCB->setChecked(rc.make_backup);
483 uimod->lastfilesSB->setValue(rc.num_lastfiles);
486 QPrefIdentityModule * idmod(dialog_->identityModule);
487 idmod->nameED->setText(toqstr(rc.user_name));
488 idmod->emailED->setText(toqstr(rc.user_email));
491 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
493 // FIXME: can derive CB from the two EDs
494 keymod->keymapCB->setChecked(rc.use_kbmap);
495 // no idea why we need these. Fscking Qt.
496 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
497 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
498 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
499 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
500 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
501 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
502 keymod->firstKeymapED->setText(toqstr(rc.primary_kbmap));
503 keymod->secondKeymapED->setText(toqstr(rc.secondary_kbmap));
506 QPrefAsciiModule * ascmod(dialog_->asciiModule);
508 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
509 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
512 QPrefDateModule * datemod(dialog_->dateModule);
514 datemod->DateED->setText(toqstr(rc.date_insert_format));
516 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
517 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
518 cygwinmod->pathCB->setChecked(rc.cygwin_path_fix);
521 QPrefLatexModule * latexmod(dialog_->latexModule);
523 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
524 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
525 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
526 latexmod->latexIndexED->setText(toqstr(rc.index_command));
527 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
528 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
529 latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
532 QPrefDisplayModule * displaymod(dialog_->displayModule);
534 switch (rc.preview) {
535 case LyXRC::PREVIEW_OFF:
536 displaymod->instantPreviewCO->setCurrentItem(0);
538 case LyXRC::PREVIEW_NO_MATH :
539 displaymod->instantPreviewCO->setCurrentItem(1);
541 case LyXRC::PREVIEW_ON :
542 displaymod->instantPreviewCO->setCurrentItem(2);
548 switch (rc.display_graphics) {
549 case lyx::graphics::NoDisplay: item = 3; break;
550 case lyx::graphics::ColorDisplay: item = 2; break;
551 case lyx::graphics::GrayscaleDisplay: item = 1; break;
552 case lyx::graphics::MonochromeDisplay: item = 0; break;
555 displaymod->displayGraphicsCO->setCurrentItem(item);
558 QPrefPathsModule * pathsmod(dialog_->pathsModule);
560 pathsmod->workingDirED->setText(toqstr(rc.document_path));
561 pathsmod->templateDirED->setText(toqstr(rc.template_path));
562 pathsmod->backupDirED->setText(toqstr(rc.backupdir_path));
563 pathsmod->tempDirED->setText(toqstr(rc.tempdir_path));
564 pathsmod->pathPrefixED->setText(toqstr(rc.path_prefix));
565 // FIXME: should be a checkbox only
566 pathsmod->lyxserverDirED->setText(toqstr(rc.lyxpipes));
568 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
570 spellmod->spellCommandCO->setCurrentItem(0);
572 if (rc.isp_command == "ispell") {
573 spellmod->spellCommandCO->setCurrentItem(0);
574 } else if (rc.isp_command == "aspell") {
575 spellmod->spellCommandCO->setCurrentItem(1);
576 } else if (rc.isp_command == "hspell") {
577 spellmod->spellCommandCO->setCurrentItem(2);
580 if (rc.use_spell_lib) {
581 #if defined(USE_ASPELL) || defined(USE_PSPELL)
582 spellmod->spellCommandCO->setCurrentItem(3);
586 // FIXME: remove isp_use_alt_lang
587 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
588 // FIXME: remove isp_use_esc_chars
589 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
590 // FIXME: remove isp_use_pers_dict
591 spellmod->persDictionaryED->setText(toqstr(rc.isp_pers_dict));
592 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
593 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
596 QPrefPrinterModule * printmod(dialog_->printerModule);
598 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
599 printmod->printerCommandED->setText(toqstr(rc.print_command));
600 printmod->printerNameED->setText(toqstr(rc.printer));
602 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
603 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
604 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
605 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
606 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
607 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
608 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
609 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
610 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
611 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
612 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
613 printmod->printerToFileED->setText(toqstr(rc.print_to_file));
614 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
615 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
616 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
619 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
621 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
622 rc.roman_font_foundry);
623 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
624 rc.sans_font_foundry);
625 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
626 rc.typewriter_font_foundry);
628 dialog_->select_roman(fontmod->screenRomanCO->currentText());
629 dialog_->select_sans(fontmod->screenSansCO->currentText());
630 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
632 fontmod->screenZoomSB->setValue(rc.zoom);
633 fontmod->screenDpiSB->setValue(rc.dpi);
634 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
635 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
636 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
637 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
638 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
639 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
640 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
641 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
642 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
643 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
645 dialog_->updateFormats();
646 dialog_->updateConverters();
647 dialog_->updateCopiers();
650 } // namespace frontend