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(_WIN32)
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"
42 #include "support/lstrings.h"
43 #include "support/os.h"
45 #include "controllers/ControlPrefs.h"
46 #include "controllers/frnt_lang.h"
47 #include "controllers/helper_funcs.h"
49 #include "frontends/lyx_gui.h"
51 #include <qcheckbox.h>
52 #include "qcoloritem.h"
53 #include <qcombobox.h>
55 #include <qlineedit.h>
56 #include <qpushbutton.h>
59 #include <boost/tuple/tuple.hpp>
64 using lyx::support::compare_no_case;
71 using std::ostringstream;
78 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
80 QPrefs::QPrefs(Dialog & parent)
81 : base_class(parent, _("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 string const internal_path(QString const & input)
148 return lyx::support::os::internal_path(fromqstr(input));
151 string const internal_path_list(QString const & input)
153 return lyx::support::os::internal_path_list(fromqstr(input));
161 LyXRC & rc(controller().rc());
163 QPrefLanguageModule * langmod(dialog_->languageModule);
165 // FIXME: remove rtl_support bool
166 rc.rtl_support = langmod->rtlCB->isChecked();
167 rc.mark_foreign_language = langmod->markForeignCB->isChecked();
168 rc.language_auto_begin = langmod->autoBeginCB->isChecked();
169 rc.language_auto_end = langmod->autoEndCB->isChecked();
170 rc.language_use_babel = langmod->useBabelCB->isChecked();
171 rc.language_global_options = langmod->globalCB->isChecked();
172 rc.language_package = fromqstr(langmod->languagePackageED->text());
173 rc.language_command_begin = fromqstr(langmod->startCommandED->text());
174 rc.language_command_end = fromqstr(langmod->endCommandED->text());
175 rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
177 QPrefUIModule * uimod(dialog_->uiModule);
179 rc.ui_file = internal_path(uimod->uiFileED->text());
180 rc.bind_file = internal_path(uimod->bindFileED->text());
181 rc.use_lastfilepos = uimod->restoreCursorCB->isChecked();
182 rc.load_session = uimod->loadSessionCB->isChecked();
183 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
184 rc.autosave = uimod->autoSaveSB->value() * 60;
185 rc.make_backup = uimod->autoSaveCB->isChecked();
186 rc.num_lastfiles = uimod->lastfilesSB->value();
189 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
191 // FIXME: can derive CB from the two EDs
192 rc.use_kbmap = keymod->keymapCB->isChecked();
193 rc.primary_kbmap = internal_path(keymod->firstKeymapED->text());
194 rc.secondary_kbmap = internal_path(keymod->secondKeymapED->text());
197 QPrefAsciiModule * ascmod(dialog_->asciiModule);
199 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
200 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
203 QPrefDateModule * datemod(dialog_->dateModule);
205 rc.date_insert_format = fromqstr(datemod->DateED->text());
207 #if defined(__CYGWIN__) || defined(_WIN32)
208 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
209 rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
212 QPrefLatexModule * latexmod(dialog_->latexModule);
214 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
215 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
216 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
217 rc.index_command = fromqstr(latexmod->latexIndexED->text());
218 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
219 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
220 rc.default_papersize =
221 controller().toPaperSize(latexmod->latexPaperSizeCO->currentItem());
223 QPrefDisplayModule * displaymod(dialog_->displayModule);
225 switch (displaymod->instantPreviewCO->currentItem()) {
227 rc.preview = LyXRC::PREVIEW_OFF;
230 rc.preview = LyXRC::PREVIEW_NO_MATH;
233 rc.preview = LyXRC::PREVIEW_ON;
237 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
239 switch (displaymod->displayGraphicsCO->currentItem()) {
240 case 3: dtype = lyx::graphics::NoDisplay; break;
241 case 2: dtype = lyx::graphics::ColorDisplay; break;
242 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
243 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
245 rc.display_graphics = dtype;
248 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
251 if (old_value != rc.display_graphics) {
252 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
257 QPrefPathsModule * pathsmod(dialog_->pathsModule);
259 rc.document_path = internal_path(pathsmod->workingDirED->text());
260 rc.template_path = internal_path(pathsmod->templateDirED->text());
261 rc.backupdir_path = internal_path(pathsmod->backupDirED->text());
262 rc.tempdir_path = internal_path(pathsmod->tempDirED->text());
263 rc.path_prefix = internal_path_list(pathsmod->pathPrefixED->text());
264 // FIXME: should be a checkbox only
265 rc.lyxpipes = internal_path(pathsmod->lyxserverDirED->text());
268 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
270 switch (spellmod->spellCommandCO->currentItem()) {
274 rc.use_spell_lib = false;
275 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
278 rc.use_spell_lib = true;
282 // FIXME: remove isp_use_alt_lang
283 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
284 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
285 // FIXME: remove isp_use_esc_chars
286 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
287 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
288 // FIXME: remove isp_use_pers_dict
289 rc.isp_pers_dict = internal_path(spellmod->persDictionaryED->text());
290 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
291 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
292 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
295 QPrefPrinterModule * printmod(dialog_->printerModule);
297 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
298 rc.print_command = fromqstr(printmod->printerCommandED->text());
299 rc.printer = fromqstr(printmod->printerNameED->text());
301 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
302 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
303 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
304 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
305 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
306 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
307 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
308 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
309 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
310 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
311 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
312 rc.print_to_file = internal_path(printmod->printerToFileED->text());
313 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
314 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
315 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
318 QPrefIdentityModule * idmod(dialog_->identityModule);
319 rc.user_name = fromqstr(idmod->nameED->text());
320 rc.user_email = fromqstr(idmod->emailED->text());
322 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
324 LyXRC const oldrc(rc);
326 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
327 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
328 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
329 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
330 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
331 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
333 rc.zoom = fontmod->screenZoomSB->value();
334 rc.dpi = fontmod->screenDpiSB->value();
335 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
336 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
337 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
338 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
339 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
340 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
341 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
342 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
343 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
344 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
346 if (rc.font_sizes != oldrc.font_sizes
347 || rc.roman_font_name != oldrc.roman_font_name
348 || rc.sans_font_name != oldrc.sans_font_name
349 || rc.typewriter_font_name != oldrc.typewriter_font_name
350 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
351 controller().updateScreenFonts();
354 QPrefColorsModule * colmod(dialog_->colorsModule);
358 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
359 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
360 QColorItem * ci(static_cast<QColorItem*>(ib));
362 LColor::color const col(dialog_->colors_[i]);
363 QColor const & qcol(lcolorcache.get(col));
365 // FIXME: dubious, but it's what xforms did
366 if (qcol != ci->color()) {
369 ostr << '#' << std::setbase(16) << setfill('0')
370 << setw(2) << ci->color().red()
371 << setw(2) << ci->color().green()
372 << setw(2) << ci->color().blue();
374 string newhex(ostr.str());
375 controller().setColor(col, newhex);
381 // FIXME: move to helper_funcs.h
385 typename std::vector<A>::size_type
386 findPos(std::vector<A> const & vec, A const & val)
388 typedef typename std::vector<A>::const_iterator Cit;
390 Cit it = std::find(vec.begin(), vec.end(), val);
393 return distance(vec.begin(), it);
396 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
398 string const name = makeFontName(family, foundry);
399 for (int i = 0; i < cb->count(); ++i) {
400 if (fromqstr(cb->text(i)) == name) {
401 cb->setCurrentItem(i);
406 // Try matching without foundry name
408 // We count in reverse in order to prefer the Xft foundry
409 for (int i = cb->count() - 1; i >= 0; --i) {
410 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
411 if (compare_no_case(tmp.first, family) == 0) {
412 cb->setCurrentItem(i);
417 // family alone can contain e.g. "Helvetica [Adobe]"
418 pair<string, string> tmpfam = parseFontName(family);
420 // We count in reverse in order to prefer the Xft foundry
421 for (int i = cb->count() - 1; i >= 0; --i) {
422 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
423 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
424 cb->setCurrentItem(i);
429 // Bleh, default fonts, and the names couldn't be found. Hack
430 // for bug 1063. Qt makes baby Jesus cry.
434 if (family == lyx_gui::roman_font_name()) {
435 font.setStyleHint(QFont::Serif);
436 font.setFamily(family.c_str());
437 } else if (family == lyx_gui::sans_font_name()) {
438 font.setStyleHint(QFont::SansSerif);
439 font.setFamily(family.c_str());
440 } else if (family == lyx_gui::typewriter_font_name()) {
441 font.setStyleHint(QFont::TypeWriter);
442 font.setFamily(family.c_str());
444 lyxerr << "FAILED to find the default font: '"
445 << foundry << "', '" << family << '\''<< endl;
449 QFontInfo info(font);
450 pair<string, string> tmp = parseFontName(fromqstr(info.family()));
451 string const & default_font_name = tmp.first;
452 lyxerr << "Apparent font is " << default_font_name << endl;
454 for (int i = 0; i < cb->count(); ++i) {
455 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
456 if (compare_no_case(fromqstr(cb->text(i)),
457 default_font_name) == 0) {
458 cb->setCurrentItem(i);
463 lyxerr << "FAILED to find the font: '"
464 << foundry << "', '" << family << '\'' <<endl;
467 } // end namespace anon
472 QString const external_path(string const & input)
474 return toqstr(lyx::support::os::external_path(input));
477 QString const external_path_list(string const & input)
479 return toqstr(lyx::support::os::external_path_list(input));
485 void QPrefs::update_contents()
487 LyXRC const & rc(controller().rc());
489 QPrefLanguageModule * langmod(dialog_->languageModule);
491 // FIXME: remove rtl_support bool
492 langmod->rtlCB->setChecked(rc.rtl_support);
493 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
494 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
495 langmod->autoEndCB->setChecked(rc.language_auto_end);
496 langmod->useBabelCB->setChecked(rc.language_use_babel);
497 langmod->globalCB->setChecked(rc.language_global_options);
498 langmod->languagePackageED->setText(toqstr(rc.language_package));
499 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
500 langmod->endCommandED->setText(toqstr(rc.language_command_end));
502 int const pos = int(findPos(lang_, rc.default_language));
503 langmod->defaultLanguageCO->setCurrentItem(pos);
505 QPrefUIModule * uimod(dialog_->uiModule);
507 uimod->uiFileED->setText(external_path(rc.ui_file));
508 uimod->bindFileED->setText(external_path(rc.bind_file));
509 uimod->restoreCursorCB->setChecked(rc.use_lastfilepos);
510 uimod->loadSessionCB->setChecked(rc.load_session);
511 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
512 // convert to minutes
513 int mins(rc.autosave / 60);
514 if (rc.autosave && !mins)
516 uimod->autoSaveSB->setValue(mins);
517 uimod->autoSaveCB->setChecked(rc.make_backup);
518 uimod->lastfilesSB->setValue(rc.num_lastfiles);
521 QPrefIdentityModule * idmod(dialog_->identityModule);
522 idmod->nameED->setText(toqstr(rc.user_name));
523 idmod->emailED->setText(toqstr(rc.user_email));
526 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
528 // FIXME: can derive CB from the two EDs
529 keymod->keymapCB->setChecked(rc.use_kbmap);
530 // no idea why we need these. Fscking Qt.
531 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
532 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
533 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
534 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
535 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
536 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
537 keymod->firstKeymapED->setText(external_path(rc.primary_kbmap));
538 keymod->secondKeymapED->setText(external_path(rc.secondary_kbmap));
541 QPrefAsciiModule * ascmod(dialog_->asciiModule);
543 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
544 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
547 QPrefDateModule * datemod(dialog_->dateModule);
549 datemod->DateED->setText(toqstr(rc.date_insert_format));
551 #if defined(__CYGWIN__) || defined(_WIN32)
552 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
553 cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
556 QPrefLatexModule * latexmod(dialog_->latexModule);
558 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
559 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
560 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
561 latexmod->latexIndexED->setText(toqstr(rc.index_command));
562 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
563 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
564 latexmod->latexPaperSizeCO->setCurrentItem(
565 controller().fromPaperSize(rc.default_papersize));
568 QPrefDisplayModule * displaymod(dialog_->displayModule);
570 switch (rc.preview) {
571 case LyXRC::PREVIEW_OFF:
572 displaymod->instantPreviewCO->setCurrentItem(0);
574 case LyXRC::PREVIEW_NO_MATH :
575 displaymod->instantPreviewCO->setCurrentItem(1);
577 case LyXRC::PREVIEW_ON :
578 displaymod->instantPreviewCO->setCurrentItem(2);
584 switch (rc.display_graphics) {
585 case lyx::graphics::NoDisplay: item = 3; break;
586 case lyx::graphics::ColorDisplay: item = 2; break;
587 case lyx::graphics::GrayscaleDisplay: item = 1; break;
588 case lyx::graphics::MonochromeDisplay: item = 0; break;
591 displaymod->displayGraphicsCO->setCurrentItem(item);
594 QPrefPathsModule * pathsmod(dialog_->pathsModule);
596 pathsmod->workingDirED->setText(external_path(rc.document_path));
597 pathsmod->templateDirED->setText(external_path(rc.template_path));
598 pathsmod->backupDirED->setText(external_path(rc.backupdir_path));
599 pathsmod->tempDirED->setText(external_path(rc.tempdir_path));
600 pathsmod->pathPrefixED->setText(external_path_list(rc.path_prefix));
601 // FIXME: should be a checkbox only
602 pathsmod->lyxserverDirED->setText(external_path(rc.lyxpipes));
604 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
606 spellmod->spellCommandCO->setCurrentItem(0);
608 if (rc.isp_command == "ispell") {
609 spellmod->spellCommandCO->setCurrentItem(0);
610 } else if (rc.isp_command == "aspell") {
611 spellmod->spellCommandCO->setCurrentItem(1);
612 } else if (rc.isp_command == "hspell") {
613 spellmod->spellCommandCO->setCurrentItem(2);
616 if (rc.use_spell_lib) {
617 #if defined(USE_ASPELL) || defined(USE_PSPELL)
618 spellmod->spellCommandCO->setCurrentItem(3);
622 // FIXME: remove isp_use_alt_lang
623 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
624 // FIXME: remove isp_use_esc_chars
625 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
626 // FIXME: remove isp_use_pers_dict
627 spellmod->persDictionaryED->setText(external_path(rc.isp_pers_dict));
628 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
629 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
632 QPrefPrinterModule * printmod(dialog_->printerModule);
634 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
635 printmod->printerCommandED->setText(toqstr(rc.print_command));
636 printmod->printerNameED->setText(toqstr(rc.printer));
638 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
639 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
640 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
641 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
642 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
643 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
644 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
645 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
646 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
647 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
648 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
649 printmod->printerToFileED->setText(external_path(rc.print_to_file));
650 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
651 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
652 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
655 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
657 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
658 rc.roman_font_foundry);
659 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
660 rc.sans_font_foundry);
661 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
662 rc.typewriter_font_foundry);
664 dialog_->select_roman(fontmod->screenRomanCO->currentText());
665 dialog_->select_sans(fontmod->screenSansCO->currentText());
666 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
668 fontmod->screenZoomSB->setValue(rc.zoom);
669 fontmod->screenDpiSB->setValue(rc.dpi);
670 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
671 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
672 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
673 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
674 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
675 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
676 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
677 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
678 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
679 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
681 dialog_->updateFormats();
682 dialog_->updateConverters();
683 dialog_->updateCopiers();
686 } // namespace frontend