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, lyx::to_utf8(_("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 if (uimod->loadWindowSizeCB->isChecked()) {
184 rc.geometry_width = 0;
185 rc.geometry_height = 0;
187 rc.geometry_width = uimod->windowWidthSB->value();
188 rc.geometry_height = uimod->windowHeightSB->value();
190 rc.geometry_xysaved = uimod->loadWindowLocationCB->isChecked();
191 rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
192 rc.autosave = uimod->autoSaveSB->value() * 60;
193 rc.make_backup = uimod->autoSaveCB->isChecked();
194 rc.num_lastfiles = uimod->lastfilesSB->value();
197 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
199 // FIXME: can derive CB from the two EDs
200 rc.use_kbmap = keymod->keymapCB->isChecked();
201 rc.primary_kbmap = internal_path(keymod->firstKeymapED->text());
202 rc.secondary_kbmap = internal_path(keymod->secondKeymapED->text());
205 QPrefAsciiModule * ascmod(dialog_->asciiModule);
207 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
208 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
211 QPrefDateModule * datemod(dialog_->dateModule);
213 rc.date_insert_format = fromqstr(datemod->DateED->text());
215 #if defined(__CYGWIN__) || defined(_WIN32)
216 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
217 rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
220 QPrefLatexModule * latexmod(dialog_->latexModule);
222 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
223 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
224 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
225 rc.index_command = fromqstr(latexmod->latexIndexED->text());
226 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
227 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
228 rc.default_papersize =
229 controller().toPaperSize(latexmod->latexPaperSizeCO->currentItem());
231 QPrefDisplayModule * displaymod(dialog_->displayModule);
233 switch (displaymod->instantPreviewCO->currentItem()) {
235 rc.preview = LyXRC::PREVIEW_OFF;
238 rc.preview = LyXRC::PREVIEW_NO_MATH;
241 rc.preview = LyXRC::PREVIEW_ON;
245 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
247 switch (displaymod->displayGraphicsCO->currentItem()) {
248 case 3: dtype = lyx::graphics::NoDisplay; break;
249 case 2: dtype = lyx::graphics::ColorDisplay; break;
250 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
251 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
253 rc.display_graphics = dtype;
256 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
259 if (old_value != rc.display_graphics) {
260 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
265 QPrefPathsModule * pathsmod(dialog_->pathsModule);
267 rc.document_path = internal_path(pathsmod->workingDirED->text());
268 rc.template_path = internal_path(pathsmod->templateDirED->text());
269 rc.backupdir_path = internal_path(pathsmod->backupDirED->text());
270 rc.tempdir_path = internal_path(pathsmod->tempDirED->text());
271 rc.path_prefix = internal_path_list(pathsmod->pathPrefixED->text());
272 // FIXME: should be a checkbox only
273 rc.lyxpipes = internal_path(pathsmod->lyxserverDirED->text());
276 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
278 switch (spellmod->spellCommandCO->currentItem()) {
282 rc.use_spell_lib = false;
283 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
286 rc.use_spell_lib = true;
290 // FIXME: remove isp_use_alt_lang
291 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
292 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
293 // FIXME: remove isp_use_esc_chars
294 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
295 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
296 // FIXME: remove isp_use_pers_dict
297 rc.isp_pers_dict = internal_path(spellmod->persDictionaryED->text());
298 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
299 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
300 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
303 QPrefPrinterModule * printmod(dialog_->printerModule);
305 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
306 rc.print_command = fromqstr(printmod->printerCommandED->text());
307 rc.printer = fromqstr(printmod->printerNameED->text());
309 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
310 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
311 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
312 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
313 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
314 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
315 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
316 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
317 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
318 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
319 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
320 rc.print_to_file = internal_path(printmod->printerToFileED->text());
321 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
322 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
323 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
326 QPrefIdentityModule * idmod(dialog_->identityModule);
327 rc.user_name = fromqstr(idmod->nameED->text());
328 rc.user_email = fromqstr(idmod->emailED->text());
330 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
332 LyXRC const oldrc(rc);
334 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
335 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
336 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
337 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
338 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
339 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
341 rc.zoom = fontmod->screenZoomSB->value();
342 rc.dpi = fontmod->screenDpiSB->value();
343 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
344 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
345 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
346 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
347 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
348 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
349 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
350 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
351 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
352 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
354 if (rc.font_sizes != oldrc.font_sizes
355 || rc.roman_font_name != oldrc.roman_font_name
356 || rc.sans_font_name != oldrc.sans_font_name
357 || rc.typewriter_font_name != oldrc.typewriter_font_name
358 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
359 controller().updateScreenFonts();
362 QPrefColorsModule * colmod(dialog_->colorsModule);
366 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
367 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
368 QColorItem * ci(static_cast<QColorItem*>(ib));
370 LColor::color const col(dialog_->colors_[i]);
371 QColor const & qcol(lcolorcache.get(col));
373 // FIXME: dubious, but it's what xforms did
374 if (qcol != ci->color()) {
377 ostr << '#' << std::setbase(16) << setfill('0')
378 << setw(2) << ci->color().red()
379 << setw(2) << ci->color().green()
380 << setw(2) << ci->color().blue();
382 string newhex(ostr.str());
383 controller().setColor(col, newhex);
389 // FIXME: move to helper_funcs.h
393 typename std::vector<A>::size_type
394 findPos(std::vector<A> const & vec, A const & val)
396 typedef typename std::vector<A>::const_iterator Cit;
398 Cit it = std::find(vec.begin(), vec.end(), val);
401 return distance(vec.begin(), it);
404 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
406 string const name = makeFontName(family, foundry);
407 for (int i = 0; i < cb->count(); ++i) {
408 if (fromqstr(cb->text(i)) == name) {
409 cb->setCurrentItem(i);
414 // Try matching without foundry name
416 // We count in reverse in order to prefer the Xft foundry
417 for (int i = cb->count() - 1; i >= 0; --i) {
418 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
419 if (compare_no_case(tmp.first, family) == 0) {
420 cb->setCurrentItem(i);
425 // family alone can contain e.g. "Helvetica [Adobe]"
426 pair<string, string> tmpfam = parseFontName(family);
428 // We count in reverse in order to prefer the Xft foundry
429 for (int i = cb->count() - 1; i >= 0; --i) {
430 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
431 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
432 cb->setCurrentItem(i);
437 // Bleh, default fonts, and the names couldn't be found. Hack
438 // for bug 1063. Qt makes baby Jesus cry.
442 if (family == theApp->romanFontName()) {
443 font.setStyleHint(QFont::Serif);
444 font.setFamily(family.c_str());
445 } else if (family == theApp->sansFontName()) {
446 font.setStyleHint(QFont::SansSerif);
447 font.setFamily(family.c_str());
448 } else if (family == theApp->typewriterFontName()) {
449 font.setStyleHint(QFont::TypeWriter);
450 font.setFamily(family.c_str());
452 lyxerr << "FAILED to find the default font: '"
453 << foundry << "', '" << family << '\''<< endl;
457 QFontInfo info(font);
458 pair<string, string> tmp = parseFontName(fromqstr(info.family()));
459 string const & default_font_name = tmp.first;
460 lyxerr << "Apparent font is " << default_font_name << endl;
462 for (int i = 0; i < cb->count(); ++i) {
463 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
464 if (compare_no_case(fromqstr(cb->text(i)),
465 default_font_name) == 0) {
466 cb->setCurrentItem(i);
471 lyxerr << "FAILED to find the font: '"
472 << foundry << "', '" << family << '\'' <<endl;
475 } // end namespace anon
480 QString const external_path(string const & input)
482 return toqstr(lyx::support::os::external_path(input));
485 QString const external_path_list(string const & input)
487 return toqstr(lyx::support::os::external_path_list(input));
493 void QPrefs::update_contents()
495 LyXRC const & rc(controller().rc());
497 QPrefLanguageModule * langmod(dialog_->languageModule);
499 // FIXME: remove rtl_support bool
500 langmod->rtlCB->setChecked(rc.rtl_support);
501 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
502 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
503 langmod->autoEndCB->setChecked(rc.language_auto_end);
504 langmod->useBabelCB->setChecked(rc.language_use_babel);
505 langmod->globalCB->setChecked(rc.language_global_options);
506 langmod->languagePackageED->setText(toqstr(rc.language_package));
507 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
508 langmod->endCommandED->setText(toqstr(rc.language_command_end));
510 int const pos = int(findPos(lang_, rc.default_language));
511 langmod->defaultLanguageCO->setCurrentItem(pos);
513 QPrefUIModule * uimod(dialog_->uiModule);
515 uimod->uiFileED->setText(external_path(rc.ui_file));
516 uimod->bindFileED->setText(external_path(rc.bind_file));
517 uimod->restoreCursorCB->setChecked(rc.use_lastfilepos);
518 uimod->loadSessionCB->setChecked(rc.load_session);
519 bool loadWindowSize = rc.geometry_width == 0 && rc.geometry_height == 0;
520 uimod->loadWindowSizeCB->setChecked(loadWindowSize);
521 uimod->windowWidthSB->setEnabled(!loadWindowSize);
522 uimod->windowHeightSB->setEnabled(!loadWindowSize);
523 uimod->windowWidthLA->setEnabled(!loadWindowSize);
524 uimod->windowHeightLA->setEnabled(!loadWindowSize);
525 if (!loadWindowSize) {
526 uimod->windowWidthSB->setValue(rc.geometry_width);
527 uimod->windowHeightSB->setValue(rc.geometry_height);
529 uimod->loadWindowLocationCB->setChecked(rc.geometry_xysaved);
530 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
531 // convert to minutes
532 int mins(rc.autosave / 60);
533 if (rc.autosave && !mins)
535 uimod->autoSaveSB->setValue(mins);
536 uimod->autoSaveCB->setChecked(rc.make_backup);
537 uimod->lastfilesSB->setValue(rc.num_lastfiles);
540 QPrefIdentityModule * idmod(dialog_->identityModule);
541 idmod->nameED->setText(toqstr(rc.user_name));
542 idmod->emailED->setText(toqstr(rc.user_email));
545 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
547 // FIXME: can derive CB from the two EDs
548 keymod->keymapCB->setChecked(rc.use_kbmap);
549 // no idea why we need these. Fscking Qt.
550 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
551 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
552 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
553 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
554 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
555 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
556 keymod->firstKeymapED->setText(external_path(rc.primary_kbmap));
557 keymod->secondKeymapED->setText(external_path(rc.secondary_kbmap));
560 QPrefAsciiModule * ascmod(dialog_->asciiModule);
562 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
563 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
566 QPrefDateModule * datemod(dialog_->dateModule);
568 datemod->DateED->setText(toqstr(rc.date_insert_format));
570 #if defined(__CYGWIN__) || defined(_WIN32)
571 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
572 cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
575 QPrefLatexModule * latexmod(dialog_->latexModule);
577 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
578 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
579 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
580 latexmod->latexIndexED->setText(toqstr(rc.index_command));
581 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
582 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
583 latexmod->latexPaperSizeCO->setCurrentItem(
584 controller().fromPaperSize(rc.default_papersize));
587 QPrefDisplayModule * displaymod(dialog_->displayModule);
589 switch (rc.preview) {
590 case LyXRC::PREVIEW_OFF:
591 displaymod->instantPreviewCO->setCurrentItem(0);
593 case LyXRC::PREVIEW_NO_MATH :
594 displaymod->instantPreviewCO->setCurrentItem(1);
596 case LyXRC::PREVIEW_ON :
597 displaymod->instantPreviewCO->setCurrentItem(2);
603 switch (rc.display_graphics) {
604 case lyx::graphics::NoDisplay: item = 3; break;
605 case lyx::graphics::ColorDisplay: item = 2; break;
606 case lyx::graphics::GrayscaleDisplay: item = 1; break;
607 case lyx::graphics::MonochromeDisplay: item = 0; break;
610 displaymod->displayGraphicsCO->setCurrentItem(item);
613 QPrefPathsModule * pathsmod(dialog_->pathsModule);
615 pathsmod->workingDirED->setText(external_path(rc.document_path));
616 pathsmod->templateDirED->setText(external_path(rc.template_path));
617 pathsmod->backupDirED->setText(external_path(rc.backupdir_path));
618 pathsmod->tempDirED->setText(external_path(rc.tempdir_path));
619 pathsmod->pathPrefixED->setText(external_path_list(rc.path_prefix));
620 // FIXME: should be a checkbox only
621 pathsmod->lyxserverDirED->setText(external_path(rc.lyxpipes));
623 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
625 spellmod->spellCommandCO->setCurrentItem(0);
627 if (rc.isp_command == "ispell") {
628 spellmod->spellCommandCO->setCurrentItem(0);
629 } else if (rc.isp_command == "aspell") {
630 spellmod->spellCommandCO->setCurrentItem(1);
631 } else if (rc.isp_command == "hspell") {
632 spellmod->spellCommandCO->setCurrentItem(2);
635 if (rc.use_spell_lib) {
636 #if defined(USE_ASPELL) || defined(USE_PSPELL)
637 spellmod->spellCommandCO->setCurrentItem(3);
641 // FIXME: remove isp_use_alt_lang
642 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
643 // FIXME: remove isp_use_esc_chars
644 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
645 // FIXME: remove isp_use_pers_dict
646 spellmod->persDictionaryED->setText(external_path(rc.isp_pers_dict));
647 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
648 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
651 QPrefPrinterModule * printmod(dialog_->printerModule);
653 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
654 printmod->printerCommandED->setText(toqstr(rc.print_command));
655 printmod->printerNameED->setText(toqstr(rc.printer));
657 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
658 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
659 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
660 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
661 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
662 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
663 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
664 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
665 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
666 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
667 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
668 printmod->printerToFileED->setText(external_path(rc.print_to_file));
669 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
670 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
671 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
674 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
676 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
677 rc.roman_font_foundry);
678 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
679 rc.sans_font_foundry);
680 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
681 rc.typewriter_font_foundry);
683 dialog_->select_roman(fontmod->screenRomanCO->currentText());
684 dialog_->select_sans(fontmod->screenSansCO->currentText());
685 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
687 fontmod->screenZoomSB->setValue(rc.zoom);
688 fontmod->screenDpiSB->setValue(rc.dpi);
689 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
690 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
691 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
692 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
693 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
694 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
695 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
696 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
697 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
698 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
700 dialog_->updateFormats();
701 dialog_->updateConverters();
702 dialog_->updateCopiers();
705 } // namespace frontend