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/Application.h"
50 #include "frontends/lyx_gui.h"
52 #include <qcheckbox.h>
53 #include "qcoloritem.h"
54 #include <qcombobox.h>
56 #include <qlineedit.h>
57 #include <qpushbutton.h>
60 #include <boost/tuple/tuple.hpp>
65 using lyx::support::compare_no_case;
72 using std::ostringstream;
79 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
81 QPrefs::QPrefs(Dialog & parent)
82 : base_class(parent, _("Preferences"))
87 Converters & QPrefs::converters()
89 return controller().converters();
93 Formats & QPrefs::formats()
95 return controller().formats();
99 Movers & QPrefs::movers()
101 return controller().movers();
105 void QPrefs::build_dialog()
107 dialog_.reset(new QPrefsDialog(this));
109 bcview().setOK(dialog_->savePB);
110 bcview().setApply(dialog_->applyPB);
111 bcview().setCancel(dialog_->closePB);
112 bcview().setRestore(dialog_->restorePB);
114 dialog_->uiModule->lastfilesSB->setMaxValue(maxlastfiles);
116 QPrefLanguageModule * langmod(dialog_->languageModule);
118 langmod->defaultLanguageCO->clear();
119 // store the lang identifiers for later
120 using lyx::frontend::LanguagePair;
121 vector<LanguagePair> const langs =
122 lyx::frontend::getLanguageData(false);
123 lang_ = getSecond(langs);
125 vector<LanguagePair>::const_iterator lit = langs.begin();
126 vector<LanguagePair>::const_iterator lend = langs.end();
127 for (; lit != lend; ++lit) {
128 langmod->defaultLanguageCO->insertItem(toqstr(lit->first));
131 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
132 spellmod->spellCommandCO->insertItem(qt_("ispell"));
133 spellmod->spellCommandCO->insertItem(qt_("aspell"));
134 spellmod->spellCommandCO->insertItem(qt_("hspell"));
136 spellmod->spellCommandCO->insertItem(qt_("pspell (library)"));
139 spellmod->spellCommandCO->insertItem(qt_("aspell (library)"));
147 string const internal_path(QString const & input)
149 return lyx::support::os::internal_path(fromqstr(input));
152 string const internal_path_list(QString const & input)
154 return lyx::support::os::internal_path_list(fromqstr(input));
162 LyXRC & rc(controller().rc());
164 QPrefLanguageModule * langmod(dialog_->languageModule);
166 // FIXME: remove rtl_support bool
167 rc.rtl_support = langmod->rtlCB->isChecked();
168 rc.mark_foreign_language = langmod->markForeignCB->isChecked();
169 rc.language_auto_begin = langmod->autoBeginCB->isChecked();
170 rc.language_auto_end = langmod->autoEndCB->isChecked();
171 rc.language_use_babel = langmod->useBabelCB->isChecked();
172 rc.language_global_options = langmod->globalCB->isChecked();
173 rc.language_package = fromqstr(langmod->languagePackageED->text());
174 rc.language_command_begin = fromqstr(langmod->startCommandED->text());
175 rc.language_command_end = fromqstr(langmod->endCommandED->text());
176 rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
178 QPrefUIModule * uimod(dialog_->uiModule);
180 rc.ui_file = internal_path(uimod->uiFileED->text());
181 rc.bind_file = internal_path(uimod->bindFileED->text());
182 rc.use_lastfilepos = uimod->restoreCursorCB->isChecked();
183 rc.load_session = uimod->loadSessionCB->isChecked();
184 if (uimod->loadWindowSizeCB->isChecked()) {
185 rc.geometry_width = 0;
186 rc.geometry_height = 0;
188 rc.geometry_width = uimod->windowWidthSB->value();
189 rc.geometry_height = uimod->windowHeightSB->value();
191 rc.geometry_xysaved = uimod->loadWindowLocationCB->isChecked();
192 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
193 rc.autosave = uimod->autoSaveSB->value() * 60;
194 rc.make_backup = uimod->autoSaveCB->isChecked();
195 rc.num_lastfiles = uimod->lastfilesSB->value();
198 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
200 // FIXME: can derive CB from the two EDs
201 rc.use_kbmap = keymod->keymapCB->isChecked();
202 rc.primary_kbmap = internal_path(keymod->firstKeymapED->text());
203 rc.secondary_kbmap = internal_path(keymod->secondKeymapED->text());
206 QPrefAsciiModule * ascmod(dialog_->asciiModule);
208 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
209 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
212 QPrefDateModule * datemod(dialog_->dateModule);
214 rc.date_insert_format = fromqstr(datemod->DateED->text());
216 #if defined(__CYGWIN__) || defined(_WIN32)
217 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
218 rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
221 QPrefLatexModule * latexmod(dialog_->latexModule);
223 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
224 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
225 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
226 rc.index_command = fromqstr(latexmod->latexIndexED->text());
227 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
228 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
229 rc.default_papersize =
230 controller().toPaperSize(latexmod->latexPaperSizeCO->currentItem());
232 QPrefDisplayModule * displaymod(dialog_->displayModule);
234 switch (displaymod->instantPreviewCO->currentItem()) {
236 rc.preview = LyXRC::PREVIEW_OFF;
239 rc.preview = LyXRC::PREVIEW_NO_MATH;
242 rc.preview = LyXRC::PREVIEW_ON;
246 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
248 switch (displaymod->displayGraphicsCO->currentItem()) {
249 case 3: dtype = lyx::graphics::NoDisplay; break;
250 case 2: dtype = lyx::graphics::ColorDisplay; break;
251 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
252 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
254 rc.display_graphics = dtype;
257 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
260 if (old_value != rc.display_graphics) {
261 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
266 QPrefPathsModule * pathsmod(dialog_->pathsModule);
268 rc.document_path = internal_path(pathsmod->workingDirED->text());
269 rc.template_path = internal_path(pathsmod->templateDirED->text());
270 rc.backupdir_path = internal_path(pathsmod->backupDirED->text());
271 rc.tempdir_path = internal_path(pathsmod->tempDirED->text());
272 rc.path_prefix = internal_path_list(pathsmod->pathPrefixED->text());
273 // FIXME: should be a checkbox only
274 rc.lyxpipes = internal_path(pathsmod->lyxserverDirED->text());
277 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
279 switch (spellmod->spellCommandCO->currentItem()) {
283 rc.use_spell_lib = false;
284 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
287 rc.use_spell_lib = true;
291 // FIXME: remove isp_use_alt_lang
292 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
293 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
294 // FIXME: remove isp_use_esc_chars
295 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
296 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
297 // FIXME: remove isp_use_pers_dict
298 rc.isp_pers_dict = internal_path(spellmod->persDictionaryED->text());
299 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
300 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
301 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
304 QPrefPrinterModule * printmod(dialog_->printerModule);
306 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
307 rc.print_command = fromqstr(printmod->printerCommandED->text());
308 rc.printer = fromqstr(printmod->printerNameED->text());
310 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
311 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
312 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
313 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
314 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
315 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
316 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
317 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
318 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
319 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
320 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
321 rc.print_to_file = internal_path(printmod->printerToFileED->text());
322 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
323 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
324 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
327 QPrefIdentityModule * idmod(dialog_->identityModule);
328 rc.user_name = fromqstr(idmod->nameED->text());
329 rc.user_email = fromqstr(idmod->emailED->text());
331 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
333 LyXRC const oldrc(rc);
335 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
336 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
337 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
338 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
339 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
340 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
342 rc.zoom = fontmod->screenZoomSB->value();
343 rc.dpi = fontmod->screenDpiSB->value();
344 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
345 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
346 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
347 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
348 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
349 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
350 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
351 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
352 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
353 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
355 if (rc.font_sizes != oldrc.font_sizes
356 || rc.roman_font_name != oldrc.roman_font_name
357 || rc.sans_font_name != oldrc.sans_font_name
358 || rc.typewriter_font_name != oldrc.typewriter_font_name
359 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
360 controller().updateScreenFonts();
363 QPrefColorsModule * colmod(dialog_->colorsModule);
367 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
368 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
369 QColorItem * ci(static_cast<QColorItem*>(ib));
371 LColor::color const col(dialog_->colors_[i]);
372 QColor const & qcol(lcolorcache.get(col));
374 // FIXME: dubious, but it's what xforms did
375 if (qcol != ci->color()) {
378 ostr << '#' << std::setbase(16) << setfill('0')
379 << setw(2) << ci->color().red()
380 << setw(2) << ci->color().green()
381 << setw(2) << ci->color().blue();
383 string newhex(ostr.str());
384 controller().setColor(col, newhex);
390 // FIXME: move to helper_funcs.h
394 typename std::vector<A>::size_type
395 findPos(std::vector<A> const & vec, A const & val)
397 typedef typename std::vector<A>::const_iterator Cit;
399 Cit it = std::find(vec.begin(), vec.end(), val);
402 return distance(vec.begin(), it);
405 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
407 string const name = makeFontName(family, foundry);
408 for (int i = 0; i < cb->count(); ++i) {
409 if (fromqstr(cb->text(i)) == name) {
410 cb->setCurrentItem(i);
415 // Try matching without foundry name
417 // We count in reverse in order to prefer the Xft foundry
418 for (int i = cb->count() - 1; i >= 0; --i) {
419 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
420 if (compare_no_case(tmp.first, family) == 0) {
421 cb->setCurrentItem(i);
426 // family alone can contain e.g. "Helvetica [Adobe]"
427 pair<string, string> tmpfam = parseFontName(family);
429 // We count in reverse in order to prefer the Xft foundry
430 for (int i = cb->count() - 1; i >= 0; --i) {
431 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
432 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
433 cb->setCurrentItem(i);
438 // Bleh, default fonts, and the names couldn't be found. Hack
439 // for bug 1063. Qt makes baby Jesus cry.
443 if (family == theApp->romanFontName()) {
444 font.setStyleHint(QFont::Serif);
445 font.setFamily(family.c_str());
446 } else if (family == theApp->sansFontName()) {
447 font.setStyleHint(QFont::SansSerif);
448 font.setFamily(family.c_str());
449 } else if (family == theApp->typewriterFontName()) {
450 font.setStyleHint(QFont::TypeWriter);
451 font.setFamily(family.c_str());
453 lyxerr << "FAILED to find the default font: '"
454 << foundry << "', '" << family << '\''<< endl;
458 QFontInfo info(font);
459 pair<string, string> tmp = parseFontName(fromqstr(info.family()));
460 string const & default_font_name = tmp.first;
461 lyxerr << "Apparent font is " << default_font_name << endl;
463 for (int i = 0; i < cb->count(); ++i) {
464 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
465 if (compare_no_case(fromqstr(cb->text(i)),
466 default_font_name) == 0) {
467 cb->setCurrentItem(i);
472 lyxerr << "FAILED to find the font: '"
473 << foundry << "', '" << family << '\'' <<endl;
476 } // end namespace anon
481 QString const external_path(string const & input)
483 return toqstr(lyx::support::os::external_path(input));
486 QString const external_path_list(string const & input)
488 return toqstr(lyx::support::os::external_path_list(input));
494 void QPrefs::update_contents()
496 LyXRC const & rc(controller().rc());
498 QPrefLanguageModule * langmod(dialog_->languageModule);
500 // FIXME: remove rtl_support bool
501 langmod->rtlCB->setChecked(rc.rtl_support);
502 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
503 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
504 langmod->autoEndCB->setChecked(rc.language_auto_end);
505 langmod->useBabelCB->setChecked(rc.language_use_babel);
506 langmod->globalCB->setChecked(rc.language_global_options);
507 langmod->languagePackageED->setText(toqstr(rc.language_package));
508 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
509 langmod->endCommandED->setText(toqstr(rc.language_command_end));
511 int const pos = int(findPos(lang_, rc.default_language));
512 langmod->defaultLanguageCO->setCurrentItem(pos);
514 QPrefUIModule * uimod(dialog_->uiModule);
516 uimod->uiFileED->setText(external_path(rc.ui_file));
517 uimod->bindFileED->setText(external_path(rc.bind_file));
518 uimod->restoreCursorCB->setChecked(rc.use_lastfilepos);
519 uimod->loadSessionCB->setChecked(rc.load_session);
520 bool loadWindowSize = rc.geometry_width == 0 && rc.geometry_height == 0;
521 uimod->loadWindowSizeCB->setChecked(loadWindowSize);
522 uimod->windowWidthSB->setEnabled(!loadWindowSize);
523 uimod->windowHeightSB->setEnabled(!loadWindowSize);
524 uimod->windowWidthLA->setEnabled(!loadWindowSize);
525 uimod->windowHeightLA->setEnabled(!loadWindowSize);
526 if (!loadWindowSize) {
527 uimod->windowWidthSB->setValue(rc.geometry_width);
528 uimod->windowHeightSB->setValue(rc.geometry_height);
530 uimod->loadWindowLocationCB->setChecked(rc.geometry_xysaved);
531 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
532 // convert to minutes
533 int mins(rc.autosave / 60);
534 if (rc.autosave && !mins)
536 uimod->autoSaveSB->setValue(mins);
537 uimod->autoSaveCB->setChecked(rc.make_backup);
538 uimod->lastfilesSB->setValue(rc.num_lastfiles);
541 QPrefIdentityModule * idmod(dialog_->identityModule);
542 idmod->nameED->setText(toqstr(rc.user_name));
543 idmod->emailED->setText(toqstr(rc.user_email));
546 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
548 // FIXME: can derive CB from the two EDs
549 keymod->keymapCB->setChecked(rc.use_kbmap);
550 // no idea why we need these. Fscking Qt.
551 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
552 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
553 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
554 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
555 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
556 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
557 keymod->firstKeymapED->setText(external_path(rc.primary_kbmap));
558 keymod->secondKeymapED->setText(external_path(rc.secondary_kbmap));
561 QPrefAsciiModule * ascmod(dialog_->asciiModule);
563 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
564 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
567 QPrefDateModule * datemod(dialog_->dateModule);
569 datemod->DateED->setText(toqstr(rc.date_insert_format));
571 #if defined(__CYGWIN__) || defined(_WIN32)
572 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
573 cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
576 QPrefLatexModule * latexmod(dialog_->latexModule);
578 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
579 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
580 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
581 latexmod->latexIndexED->setText(toqstr(rc.index_command));
582 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
583 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
584 latexmod->latexPaperSizeCO->setCurrentItem(
585 controller().fromPaperSize(rc.default_papersize));
588 QPrefDisplayModule * displaymod(dialog_->displayModule);
590 switch (rc.preview) {
591 case LyXRC::PREVIEW_OFF:
592 displaymod->instantPreviewCO->setCurrentItem(0);
594 case LyXRC::PREVIEW_NO_MATH :
595 displaymod->instantPreviewCO->setCurrentItem(1);
597 case LyXRC::PREVIEW_ON :
598 displaymod->instantPreviewCO->setCurrentItem(2);
604 switch (rc.display_graphics) {
605 case lyx::graphics::NoDisplay: item = 3; break;
606 case lyx::graphics::ColorDisplay: item = 2; break;
607 case lyx::graphics::GrayscaleDisplay: item = 1; break;
608 case lyx::graphics::MonochromeDisplay: item = 0; break;
611 displaymod->displayGraphicsCO->setCurrentItem(item);
614 QPrefPathsModule * pathsmod(dialog_->pathsModule);
616 pathsmod->workingDirED->setText(external_path(rc.document_path));
617 pathsmod->templateDirED->setText(external_path(rc.template_path));
618 pathsmod->backupDirED->setText(external_path(rc.backupdir_path));
619 pathsmod->tempDirED->setText(external_path(rc.tempdir_path));
620 pathsmod->pathPrefixED->setText(external_path_list(rc.path_prefix));
621 // FIXME: should be a checkbox only
622 pathsmod->lyxserverDirED->setText(external_path(rc.lyxpipes));
624 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
626 spellmod->spellCommandCO->setCurrentItem(0);
628 if (rc.isp_command == "ispell") {
629 spellmod->spellCommandCO->setCurrentItem(0);
630 } else if (rc.isp_command == "aspell") {
631 spellmod->spellCommandCO->setCurrentItem(1);
632 } else if (rc.isp_command == "hspell") {
633 spellmod->spellCommandCO->setCurrentItem(2);
636 if (rc.use_spell_lib) {
637 #if defined(USE_ASPELL) || defined(USE_PSPELL)
638 spellmod->spellCommandCO->setCurrentItem(3);
642 // FIXME: remove isp_use_alt_lang
643 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
644 // FIXME: remove isp_use_esc_chars
645 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
646 // FIXME: remove isp_use_pers_dict
647 spellmod->persDictionaryED->setText(external_path(rc.isp_pers_dict));
648 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
649 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
652 QPrefPrinterModule * printmod(dialog_->printerModule);
654 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
655 printmod->printerCommandED->setText(toqstr(rc.print_command));
656 printmod->printerNameED->setText(toqstr(rc.printer));
658 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
659 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
660 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
661 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
662 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
663 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
664 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
665 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
666 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
667 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
668 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
669 printmod->printerToFileED->setText(external_path(rc.print_to_file));
670 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
671 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
672 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
675 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
677 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
678 rc.roman_font_foundry);
679 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
680 rc.sans_font_foundry);
681 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
682 rc.typewriter_font_foundry);
684 dialog_->select_roman(fontmod->screenRomanCO->currentText());
685 dialog_->select_sans(fontmod->screenSansCO->currentText());
686 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
688 fontmod->screenZoomSB->setValue(rc.zoom);
689 fontmod->screenDpiSB->setValue(rc.dpi);
690 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
691 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
692 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
693 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
694 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
695 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
696 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
697 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
698 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
699 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
701 dialog_->updateFormats();
702 dialog_->updateConverters();
703 dialog_->updateCopiers();
706 } // namespace frontend