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;
70 using std::ostringstream;
77 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
79 QPrefs::QPrefs(Dialog & parent)
80 : base_class(parent, _("LyX: Preferences"))
85 Converters & QPrefs::converters()
87 return controller().converters();
91 Formats & QPrefs::formats()
93 return controller().formats();
97 Movers & QPrefs::movers()
99 return controller().movers();
103 void QPrefs::build_dialog()
105 dialog_.reset(new QPrefsDialog(this));
107 bcview().setOK(dialog_->savePB);
108 bcview().setApply(dialog_->applyPB);
109 bcview().setCancel(dialog_->closePB);
110 bcview().setRestore(dialog_->restorePB);
112 dialog_->uiModule->lastfilesSB->setMaxValue(maxlastfiles);
114 QPrefLanguageModule * langmod(dialog_->languageModule);
116 langmod->defaultLanguageCO->clear();
117 // store the lang identifiers for later
118 using lyx::frontend::LanguagePair;
119 vector<LanguagePair> const langs =
120 lyx::frontend::getLanguageData(false);
121 lang_ = getSecond(langs);
123 vector<LanguagePair>::const_iterator lit = langs.begin();
124 vector<LanguagePair>::const_iterator lend = langs.end();
125 for (; lit != lend; ++lit) {
126 langmod->defaultLanguageCO->insertItem(toqstr(lit->first));
129 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
130 spellmod->spellCommandCO->insertItem(qt_("ispell"));
131 spellmod->spellCommandCO->insertItem(qt_("aspell"));
132 spellmod->spellCommandCO->insertItem(qt_("hspell"));
134 spellmod->spellCommandCO->insertItem(qt_("pspell (library)"));
137 spellmod->spellCommandCO->insertItem(qt_("aspell (library)"));
145 LyXRC & rc(controller().rc());
147 QPrefLanguageModule * langmod(dialog_->languageModule);
149 // FIXME: remove rtl_support bool
150 rc.rtl_support = langmod->rtlCB->isChecked();
151 rc.mark_foreign_language = langmod->markForeignCB->isChecked();
152 rc.language_auto_begin = langmod->autoBeginCB->isChecked();
153 rc.language_auto_end = langmod->autoEndCB->isChecked();
154 rc.language_use_babel = langmod->useBabelCB->isChecked();
155 rc.language_global_options = langmod->globalCB->isChecked();
156 rc.language_package = fromqstr(langmod->languagePackageED->text());
157 rc.language_command_begin = fromqstr(langmod->startCommandED->text());
158 rc.language_command_end = fromqstr(langmod->endCommandED->text());
159 rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
161 QPrefUIModule * uimod(dialog_->uiModule);
163 rc.ui_file = fromqstr(uimod->uiFileED->text());
164 rc.bind_file = fromqstr(uimod->bindFileED->text());
165 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
166 rc.wheel_jump = uimod->wheelMouseSB->value();
167 rc.autosave = uimod->autoSaveSB->value() * 60;
168 rc.make_backup = uimod->autoSaveCB->isChecked();
169 rc.num_lastfiles = uimod->lastfilesSB->value();
172 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
174 // FIXME: can derive CB from the two EDs
175 rc.use_kbmap = keymod->keymapCB->isChecked();
176 rc.primary_kbmap = fromqstr(keymod->firstKeymapED->text());
177 rc.secondary_kbmap = fromqstr(keymod->secondKeymapED->text());
180 QPrefAsciiModule * ascmod(dialog_->asciiModule);
182 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
183 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
186 QPrefDateModule * datemod(dialog_->dateModule);
188 rc.date_insert_format = fromqstr(datemod->DateED->text());
190 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
191 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
192 rc.cygwin_path_fix = cygwinmod->pathCB->isChecked();
195 QPrefLatexModule * latexmod(dialog_->latexModule);
197 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
198 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
199 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
200 rc.index_command = fromqstr(latexmod->latexIndexED->text());
201 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
202 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
203 rc.default_papersize =
204 static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
206 QPrefDisplayModule * displaymod(dialog_->displayModule);
208 switch (displaymod->instantPreviewCO->currentItem()) {
210 rc.preview = LyXRC::PREVIEW_OFF;
213 rc.preview = LyXRC::PREVIEW_NO_MATH;
216 rc.preview = LyXRC::PREVIEW_ON;
220 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
222 switch (displaymod->displayGraphicsCO->currentItem()) {
223 case 3: dtype = lyx::graphics::NoDisplay; break;
224 case 2: dtype = lyx::graphics::ColorDisplay; break;
225 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
226 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
228 rc.display_graphics = dtype;
231 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
234 if (old_value != rc.display_graphics) {
235 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
240 QPrefPathsModule * pathsmod(dialog_->pathsModule);
242 rc.document_path = fromqstr(pathsmod->workingDirED->text());
243 rc.template_path = fromqstr(pathsmod->templateDirED->text());
244 rc.backupdir_path = fromqstr(pathsmod->backupDirED->text());
245 rc.tempdir_path = fromqstr(pathsmod->tempDirED->text());
246 rc.path_prefix = fromqstr(pathsmod->pathPrefixED->text());
247 // FIXME: should be a checkbox only
248 rc.lyxpipes = fromqstr(pathsmod->lyxserverDirED->text());
251 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
253 switch (spellmod->spellCommandCO->currentItem()) {
257 rc.use_spell_lib = false;
258 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
261 rc.use_spell_lib = true;
265 // FIXME: remove isp_use_alt_lang
266 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
267 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
268 // FIXME: remove isp_use_esc_chars
269 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
270 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
271 // FIXME: remove isp_use_pers_dict
272 rc.isp_pers_dict = fromqstr(spellmod->persDictionaryED->text());
273 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
274 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
275 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
278 QPrefPrinterModule * printmod(dialog_->printerModule);
280 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
281 rc.print_command = fromqstr(printmod->printerCommandED->text());
282 rc.printer = fromqstr(printmod->printerNameED->text());
284 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
285 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
286 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
287 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
288 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
289 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
290 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
291 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
292 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
293 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
294 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
295 rc.print_to_file = fromqstr(printmod->printerToFileED->text());
296 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
297 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
298 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
301 QPrefIdentityModule * idmod(dialog_->identityModule);
302 rc.user_name = fromqstr(idmod->nameED->text());
303 rc.user_email = fromqstr(idmod->emailED->text());
305 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
307 LyXRC const oldrc(rc);
309 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
310 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
311 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
312 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
313 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
314 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
316 rc.zoom = fontmod->screenZoomSB->value();
317 rc.dpi = fontmod->screenDpiSB->value();
318 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
319 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
320 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
321 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
322 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
323 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
324 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
325 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
326 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
327 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
329 if (rc.font_sizes != oldrc.font_sizes
330 || rc.roman_font_name != oldrc.roman_font_name
331 || rc.sans_font_name != oldrc.sans_font_name
332 || rc.typewriter_font_name != oldrc.typewriter_font_name
333 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
334 controller().updateScreenFonts();
337 QPrefColorsModule * colmod(dialog_->colorsModule);
341 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
342 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
343 QColorItem * ci(static_cast<QColorItem*>(ib));
345 LColor::color const col(dialog_->colors_[i]);
346 QColor const & qcol(lcolorcache.get(col));
348 // FIXME: dubious, but it's what xforms does
349 if (qcol != ci->color()) {
352 ostr << '#' << std::setbase(16) << setfill('0')
353 << setw(2) << ci->color().red()
354 << setw(2) << ci->color().green()
355 << setw(2) << ci->color().blue();
357 string newhex(ostr.str());
358 controller().setColor(col, newhex);
364 // FIXME: move to helper_funcs.h
368 typename std::vector<A>::size_type
369 findPos(std::vector<A> const & vec, A const & val)
371 typedef typename std::vector<A>::const_iterator Cit;
373 Cit it = std::find(vec.begin(), vec.end(), val);
376 return distance(vec.begin(), it);
379 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
381 string const name = makeFontName(family, foundry);
382 for (int i = 0; i < cb->count(); ++i) {
383 if (fromqstr(cb->text(i)) == name) {
384 cb->setCurrentItem(i);
389 // Try matching without foundry name
391 // We count in reverse in order to prefer the Xft foundry
392 for (int i = cb->count() - 1; i >= 0; --i) {
393 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
394 if (compare_no_case(tmp.first, family) == 0) {
395 cb->setCurrentItem(i);
400 // family alone can contain e.g. "Helvetica [Adobe]"
401 pair<string, string> tmpfam = parseFontName(family);
403 // We count in reverse in order to prefer the Xft foundry
404 for (int i = cb->count() - 1; i >= 0; --i) {
405 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
406 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
407 cb->setCurrentItem(i);
412 // Bleh, default fonts, and the names couldn't be found. Hack
413 // for bug 1063. Qt makes baby Jesus cry.
417 if (family == lyx_gui::roman_font_name()) {
418 font.setStyleHint(QFont::Serif);
419 font.setFamily(lyx_gui::roman_font_name().c_str());
420 } else if (family == lyx_gui::sans_font_name()) {
421 font.setStyleHint(QFont::SansSerif);
422 font.setFamily(lyx_gui::sans_font_name().c_str());
423 } else if (family == lyx_gui::typewriter_font_name()) {
424 font.setStyleHint(QFont::TypeWriter);
425 font.setFamily(lyx_gui::typewriter_font_name().c_str());
427 lyxerr << "FAILED to find the default font !"
428 << foundry << ", " << family << endl;
432 QFontInfo info(font);
433 lyxerr << "Apparent font is " << info.family() << endl;
435 for (int i = 0; i < cb->count(); ++i) {
436 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
437 if (compare_no_case(fromqstr(cb->text(i)), fromqstr(info.family())) == 0) {
438 cb->setCurrentItem(i);
443 lyxerr << "FAILED to find the font !"
444 << foundry << ", " << family << endl;
447 } // end namespace anon
450 void QPrefs::update_contents()
452 LyXRC const & rc(controller().rc());
454 QPrefLanguageModule * langmod(dialog_->languageModule);
456 // FIXME: remove rtl_support bool
457 langmod->rtlCB->setChecked(rc.rtl_support);
458 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
459 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
460 langmod->autoEndCB->setChecked(rc.language_auto_end);
461 langmod->useBabelCB->setChecked(rc.language_use_babel);
462 langmod->globalCB->setChecked(rc.language_global_options);
463 langmod->languagePackageED->setText(toqstr(rc.language_package));
464 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
465 langmod->endCommandED->setText(toqstr(rc.language_command_end));
467 int const pos = int(findPos(lang_, rc.default_language));
468 langmod->defaultLanguageCO->setCurrentItem(pos);
470 QPrefUIModule * uimod(dialog_->uiModule);
472 uimod->uiFileED->setText(toqstr(rc.ui_file));
473 uimod->bindFileED->setText(toqstr(rc.bind_file));
474 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
475 uimod->wheelMouseSB->setValue(rc.wheel_jump);
476 // convert to minutes
477 int mins(rc.autosave / 60);
478 if (rc.autosave && !mins)
480 uimod->autoSaveSB->setValue(mins);
481 uimod->autoSaveCB->setChecked(rc.make_backup);
482 uimod->lastfilesSB->setValue(rc.num_lastfiles);
485 QPrefIdentityModule * idmod(dialog_->identityModule);
486 idmod->nameED->setText(toqstr(rc.user_name));
487 idmod->emailED->setText(toqstr(rc.user_email));
490 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
492 // FIXME: can derive CB from the two EDs
493 keymod->keymapCB->setChecked(rc.use_kbmap);
494 // no idea why we need these. Fscking Qt.
495 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
496 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
497 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
498 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
499 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
500 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
501 keymod->firstKeymapED->setText(toqstr(rc.primary_kbmap));
502 keymod->secondKeymapED->setText(toqstr(rc.secondary_kbmap));
505 QPrefAsciiModule * ascmod(dialog_->asciiModule);
507 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
508 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
511 QPrefDateModule * datemod(dialog_->dateModule);
513 datemod->DateED->setText(toqstr(rc.date_insert_format));
515 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
516 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
517 cygwinmod->pathCB->setChecked(rc.cygwin_path_fix);
520 QPrefLatexModule * latexmod(dialog_->latexModule);
522 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
523 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
524 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
525 latexmod->latexIndexED->setText(toqstr(rc.index_command));
526 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
527 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
528 latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
531 QPrefDisplayModule * displaymod(dialog_->displayModule);
533 switch (rc.preview) {
534 case LyXRC::PREVIEW_OFF:
535 displaymod->instantPreviewCO->setCurrentItem(0);
537 case LyXRC::PREVIEW_NO_MATH :
538 displaymod->instantPreviewCO->setCurrentItem(1);
540 case LyXRC::PREVIEW_ON :
541 displaymod->instantPreviewCO->setCurrentItem(2);
547 switch (rc.display_graphics) {
548 case lyx::graphics::NoDisplay: item = 3; break;
549 case lyx::graphics::ColorDisplay: item = 2; break;
550 case lyx::graphics::GrayscaleDisplay: item = 1; break;
551 case lyx::graphics::MonochromeDisplay: item = 0; break;
554 displaymod->displayGraphicsCO->setCurrentItem(item);
557 QPrefPathsModule * pathsmod(dialog_->pathsModule);
559 pathsmod->workingDirED->setText(toqstr(rc.document_path));
560 pathsmod->templateDirED->setText(toqstr(rc.template_path));
561 pathsmod->backupDirED->setText(toqstr(rc.backupdir_path));
562 pathsmod->tempDirED->setText(toqstr(rc.tempdir_path));
563 pathsmod->pathPrefixED->setText(toqstr(rc.path_prefix));
564 // FIXME: should be a checkbox only
565 pathsmod->lyxserverDirED->setText(toqstr(rc.lyxpipes));
567 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
569 spellmod->spellCommandCO->setCurrentItem(0);
571 if (rc.isp_command == "ispell") {
572 spellmod->spellCommandCO->setCurrentItem(0);
573 } else if (rc.isp_command == "aspell") {
574 spellmod->spellCommandCO->setCurrentItem(1);
575 } else if (rc.isp_command == "hspell") {
576 spellmod->spellCommandCO->setCurrentItem(2);
579 if (rc.use_spell_lib) {
580 #if defined(USE_ASPELL) || defined(USE_PSPELL)
581 spellmod->spellCommandCO->setCurrentItem(3);
585 // FIXME: remove isp_use_alt_lang
586 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
587 // FIXME: remove isp_use_esc_chars
588 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
589 // FIXME: remove isp_use_pers_dict
590 spellmod->persDictionaryED->setText(toqstr(rc.isp_pers_dict));
591 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
592 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
595 QPrefPrinterModule * printmod(dialog_->printerModule);
597 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
598 printmod->printerCommandED->setText(toqstr(rc.print_command));
599 printmod->printerNameED->setText(toqstr(rc.printer));
601 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
602 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
603 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
604 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
605 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
606 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
607 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
608 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
609 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
610 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
611 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
612 printmod->printerToFileED->setText(toqstr(rc.print_to_file));
613 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
614 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
615 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
618 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
620 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
621 rc.roman_font_foundry);
622 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
623 rc.sans_font_foundry);
624 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
625 rc.typewriter_font_foundry);
627 dialog_->select_roman(fontmod->screenRomanCO->currentText());
628 dialog_->select_sans(fontmod->screenSansCO->currentText());
629 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
631 fontmod->screenZoomSB->setValue(rc.zoom);
632 fontmod->screenDpiSB->setValue(rc.dpi);
633 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
634 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
635 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
636 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
637 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
638 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
639 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
640 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
641 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
642 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
644 dialog_->updateFormats();
645 dialog_->updateConverters();
646 dialog_->updateCopiers();
649 } // namespace frontend