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"
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.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
182 rc.autosave = uimod->autoSaveSB->value() * 60;
183 rc.make_backup = uimod->autoSaveCB->isChecked();
184 rc.num_lastfiles = uimod->lastfilesSB->value();
187 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
189 // FIXME: can derive CB from the two EDs
190 rc.use_kbmap = keymod->keymapCB->isChecked();
191 rc.primary_kbmap = internal_path(keymod->firstKeymapED->text());
192 rc.secondary_kbmap = internal_path(keymod->secondKeymapED->text());
195 QPrefAsciiModule * ascmod(dialog_->asciiModule);
197 rc.ascii_linelen = ascmod->asciiLinelengthSB->value();
198 rc.ascii_roff_command = fromqstr(ascmod->asciiRoffED->text());
201 QPrefDateModule * datemod(dialog_->dateModule);
203 rc.date_insert_format = fromqstr(datemod->DateED->text());
205 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
206 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
207 rc.cygwin_path_fix = !cygwinmod->pathCB->isChecked();
210 QPrefLatexModule * latexmod(dialog_->latexModule);
212 rc.fontenc = fromqstr(latexmod->latexEncodingED->text());
213 rc.chktex_command = fromqstr(latexmod->latexChecktexED->text());
214 rc.bibtex_command = fromqstr(latexmod->latexBibtexED->text());
215 rc.index_command = fromqstr(latexmod->latexIndexED->text());
216 rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
217 rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
218 rc.default_papersize =
219 controller().toPaperSize(latexmod->latexPaperSizeCO->currentItem());
221 QPrefDisplayModule * displaymod(dialog_->displayModule);
223 switch (displaymod->instantPreviewCO->currentItem()) {
225 rc.preview = LyXRC::PREVIEW_OFF;
228 rc.preview = LyXRC::PREVIEW_NO_MATH;
231 rc.preview = LyXRC::PREVIEW_ON;
235 lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
237 switch (displaymod->displayGraphicsCO->currentItem()) {
238 case 3: dtype = lyx::graphics::NoDisplay; break;
239 case 2: dtype = lyx::graphics::ColorDisplay; break;
240 case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
241 case 0: dtype = lyx::graphics::MonochromeDisplay; break;
243 rc.display_graphics = dtype;
246 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
249 if (old_value != rc.display_graphics) {
250 lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
255 QPrefPathsModule * pathsmod(dialog_->pathsModule);
257 rc.document_path = internal_path(pathsmod->workingDirED->text());
258 rc.template_path = internal_path(pathsmod->templateDirED->text());
259 rc.backupdir_path = internal_path(pathsmod->backupDirED->text());
260 rc.tempdir_path = internal_path(pathsmod->tempDirED->text());
261 rc.path_prefix = internal_path_list(pathsmod->pathPrefixED->text());
262 // FIXME: should be a checkbox only
263 rc.lyxpipes = internal_path(pathsmod->lyxserverDirED->text());
266 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
268 switch (spellmod->spellCommandCO->currentItem()) {
272 rc.use_spell_lib = false;
273 rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
276 rc.use_spell_lib = true;
280 // FIXME: remove isp_use_alt_lang
281 rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
282 rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
283 // FIXME: remove isp_use_esc_chars
284 rc.isp_esc_chars = fromqstr(spellmod->escapeCharactersED->text());
285 rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
286 // FIXME: remove isp_use_pers_dict
287 rc.isp_pers_dict = internal_path(spellmod->persDictionaryED->text());
288 rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
289 rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
290 rc.isp_use_input_encoding = spellmod->inputEncodingCB->isChecked();
293 QPrefPrinterModule * printmod(dialog_->printerModule);
295 rc.print_adapt_output = printmod->printerAdaptCB->isChecked();
296 rc.print_command = fromqstr(printmod->printerCommandED->text());
297 rc.printer = fromqstr(printmod->printerNameED->text());
299 rc.print_pagerange_flag = fromqstr(printmod->printerPageRangeED->text());
300 rc.print_copies_flag = fromqstr(printmod->printerCopiesED->text());
301 rc.print_reverse_flag = fromqstr(printmod->printerReverseED->text());
302 rc.print_to_printer = fromqstr(printmod->printerToPrinterED->text());
303 rc.print_file_extension = fromqstr(printmod->printerExtensionED->text());
304 rc.print_spool_command = fromqstr(printmod->printerSpoolCommandED->text());
305 rc.print_paper_flag = fromqstr(printmod->printerPaperTypeED->text());
306 rc.print_evenpage_flag = fromqstr(printmod->printerEvenED->text());
307 rc.print_oddpage_flag = fromqstr(printmod->printerOddED->text());
308 rc.print_collcopies_flag = fromqstr(printmod->printerCollatedED->text());
309 rc.print_landscape_flag = fromqstr(printmod->printerLandscapeED->text());
310 rc.print_to_file = internal_path(printmod->printerToFileED->text());
311 rc.print_extra_options = fromqstr(printmod->printerExtraED->text());
312 rc.print_spool_printerprefix = fromqstr(printmod->printerSpoolPrefixED->text());
313 rc.print_paper_dimension_flag = fromqstr(printmod->printerPaperSizeED->text());
316 QPrefIdentityModule * idmod(dialog_->identityModule);
317 rc.user_name = fromqstr(idmod->nameED->text());
318 rc.user_email = fromqstr(idmod->emailED->text());
320 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
322 LyXRC const oldrc(rc);
324 boost::tie(rc.roman_font_name, rc.roman_font_foundry)
325 = parseFontName(fromqstr(fontmod->screenRomanCO->currentText()));
326 boost::tie(rc.sans_font_name, rc.sans_font_foundry) =
327 parseFontName(fromqstr(fontmod->screenSansCO->currentText()));
328 boost::tie(rc.typewriter_font_name, rc.typewriter_font_foundry) =
329 parseFontName(fromqstr(fontmod->screenTypewriterCO->currentText()));
331 rc.zoom = fontmod->screenZoomSB->value();
332 rc.dpi = fontmod->screenDpiSB->value();
333 rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
334 rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
335 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
336 rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
337 rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
338 rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
339 rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
340 rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
341 rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
342 rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
344 if (rc.font_sizes != oldrc.font_sizes
345 || rc.roman_font_name != oldrc.roman_font_name
346 || rc.sans_font_name != oldrc.sans_font_name
347 || rc.typewriter_font_name != oldrc.typewriter_font_name
348 || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
349 controller().updateScreenFonts();
352 QPrefColorsModule * colmod(dialog_->colorsModule);
356 for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
357 QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
358 QColorItem * ci(static_cast<QColorItem*>(ib));
360 LColor::color const col(dialog_->colors_[i]);
361 QColor const & qcol(lcolorcache.get(col));
363 // FIXME: dubious, but it's what xforms does
364 if (qcol != ci->color()) {
367 ostr << '#' << std::setbase(16) << setfill('0')
368 << setw(2) << ci->color().red()
369 << setw(2) << ci->color().green()
370 << setw(2) << ci->color().blue();
372 string newhex(ostr.str());
373 controller().setColor(col, newhex);
379 // FIXME: move to helper_funcs.h
383 typename std::vector<A>::size_type
384 findPos(std::vector<A> const & vec, A const & val)
386 typedef typename std::vector<A>::const_iterator Cit;
388 Cit it = std::find(vec.begin(), vec.end(), val);
391 return distance(vec.begin(), it);
394 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
396 string const name = makeFontName(family, foundry);
397 for (int i = 0; i < cb->count(); ++i) {
398 if (fromqstr(cb->text(i)) == name) {
399 cb->setCurrentItem(i);
404 // Try matching without foundry name
406 // We count in reverse in order to prefer the Xft foundry
407 for (int i = cb->count() - 1; i >= 0; --i) {
408 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
409 if (compare_no_case(tmp.first, family) == 0) {
410 cb->setCurrentItem(i);
415 // family alone can contain e.g. "Helvetica [Adobe]"
416 pair<string, string> tmpfam = parseFontName(family);
418 // We count in reverse in order to prefer the Xft foundry
419 for (int i = cb->count() - 1; i >= 0; --i) {
420 pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
421 if (compare_no_case(tmp.first, tmpfam.first) == 0) {
422 cb->setCurrentItem(i);
427 // Bleh, default fonts, and the names couldn't be found. Hack
428 // for bug 1063. Qt makes baby Jesus cry.
432 if (family == lyx_gui::roman_font_name()) {
433 font.setStyleHint(QFont::Serif);
434 font.setFamily(family.c_str());
435 } else if (family == lyx_gui::sans_font_name()) {
436 font.setStyleHint(QFont::SansSerif);
437 font.setFamily(family.c_str());
438 } else if (family == lyx_gui::typewriter_font_name()) {
439 font.setStyleHint(QFont::TypeWriter);
440 font.setFamily(family.c_str());
442 lyxerr << "FAILED to find the default font: '"
443 << foundry << "', '" << family << '\''<< endl;
447 QFontInfo info(font);
448 pair<string, string> tmp = parseFontName(fromqstr(info.family()));
449 string const & default_font_name = tmp.first;
450 lyxerr << "Apparent font is " << default_font_name << endl;
452 for (int i = 0; i < cb->count(); ++i) {
453 lyxerr << "Looking at " << fromqstr(cb->text(i)) << endl;
454 if (compare_no_case(fromqstr(cb->text(i)),
455 default_font_name) == 0) {
456 cb->setCurrentItem(i);
461 lyxerr << "FAILED to find the font: '"
462 << foundry << "', '" << family << '\'' <<endl;
465 } // end namespace anon
470 QString const external_path(string const & input)
472 return toqstr(lyx::support::os::external_path(input));
475 QString const external_path_list(string const & input)
477 return toqstr(lyx::support::os::external_path_list(input));
483 void QPrefs::update_contents()
485 LyXRC const & rc(controller().rc());
487 QPrefLanguageModule * langmod(dialog_->languageModule);
489 // FIXME: remove rtl_support bool
490 langmod->rtlCB->setChecked(rc.rtl_support);
491 langmod->markForeignCB->setChecked(rc.mark_foreign_language);
492 langmod->autoBeginCB->setChecked(rc.language_auto_begin);
493 langmod->autoEndCB->setChecked(rc.language_auto_end);
494 langmod->useBabelCB->setChecked(rc.language_use_babel);
495 langmod->globalCB->setChecked(rc.language_global_options);
496 langmod->languagePackageED->setText(toqstr(rc.language_package));
497 langmod->startCommandED->setText(toqstr(rc.language_command_begin));
498 langmod->endCommandED->setText(toqstr(rc.language_command_end));
500 int const pos = int(findPos(lang_, rc.default_language));
501 langmod->defaultLanguageCO->setCurrentItem(pos);
503 QPrefUIModule * uimod(dialog_->uiModule);
505 uimod->uiFileED->setText(external_path(rc.ui_file));
506 uimod->bindFileED->setText(external_path(rc.bind_file));
507 uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
508 // convert to minutes
509 int mins(rc.autosave / 60);
510 if (rc.autosave && !mins)
512 uimod->autoSaveSB->setValue(mins);
513 uimod->autoSaveCB->setChecked(rc.make_backup);
514 uimod->lastfilesSB->setValue(rc.num_lastfiles);
517 QPrefIdentityModule * idmod(dialog_->identityModule);
518 idmod->nameED->setText(toqstr(rc.user_name));
519 idmod->emailED->setText(toqstr(rc.user_email));
522 QPrefKeyboardModule * keymod(dialog_->keyboardModule);
524 // FIXME: can derive CB from the two EDs
525 keymod->keymapCB->setChecked(rc.use_kbmap);
526 // no idea why we need these. Fscking Qt.
527 keymod->firstKeymapED->setEnabled(rc.use_kbmap);
528 keymod->firstKeymapPB->setEnabled(rc.use_kbmap);
529 keymod->firstKeymapLA->setEnabled(rc.use_kbmap);
530 keymod->secondKeymapED->setEnabled(rc.use_kbmap);
531 keymod->secondKeymapPB->setEnabled(rc.use_kbmap);
532 keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
533 keymod->firstKeymapED->setText(external_path(rc.primary_kbmap));
534 keymod->secondKeymapED->setText(external_path(rc.secondary_kbmap));
537 QPrefAsciiModule * ascmod(dialog_->asciiModule);
539 ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
540 ascmod->asciiRoffED->setText(toqstr(rc.ascii_roff_command));
543 QPrefDateModule * datemod(dialog_->dateModule);
545 datemod->DateED->setText(toqstr(rc.date_insert_format));
547 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
548 QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
549 cygwinmod->pathCB->setChecked(!rc.cygwin_path_fix);
552 QPrefLatexModule * latexmod(dialog_->latexModule);
554 latexmod->latexEncodingED->setText(toqstr(rc.fontenc));
555 latexmod->latexChecktexED->setText(toqstr(rc.chktex_command));
556 latexmod->latexBibtexED->setText(toqstr(rc.bibtex_command));
557 latexmod->latexIndexED->setText(toqstr(rc.index_command));
558 latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
559 latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
560 latexmod->latexPaperSizeCO->setCurrentItem(
561 controller().fromPaperSize(rc.default_papersize));
564 QPrefDisplayModule * displaymod(dialog_->displayModule);
566 switch (rc.preview) {
567 case LyXRC::PREVIEW_OFF:
568 displaymod->instantPreviewCO->setCurrentItem(0);
570 case LyXRC::PREVIEW_NO_MATH :
571 displaymod->instantPreviewCO->setCurrentItem(1);
573 case LyXRC::PREVIEW_ON :
574 displaymod->instantPreviewCO->setCurrentItem(2);
580 switch (rc.display_graphics) {
581 case lyx::graphics::NoDisplay: item = 3; break;
582 case lyx::graphics::ColorDisplay: item = 2; break;
583 case lyx::graphics::GrayscaleDisplay: item = 1; break;
584 case lyx::graphics::MonochromeDisplay: item = 0; break;
587 displaymod->displayGraphicsCO->setCurrentItem(item);
590 QPrefPathsModule * pathsmod(dialog_->pathsModule);
592 pathsmod->workingDirED->setText(external_path(rc.document_path));
593 pathsmod->templateDirED->setText(external_path(rc.template_path));
594 pathsmod->backupDirED->setText(external_path(rc.backupdir_path));
595 pathsmod->tempDirED->setText(external_path(rc.tempdir_path));
596 pathsmod->pathPrefixED->setText(external_path_list(rc.path_prefix));
597 // FIXME: should be a checkbox only
598 pathsmod->lyxserverDirED->setText(external_path(rc.lyxpipes));
600 QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
602 spellmod->spellCommandCO->setCurrentItem(0);
604 if (rc.isp_command == "ispell") {
605 spellmod->spellCommandCO->setCurrentItem(0);
606 } else if (rc.isp_command == "aspell") {
607 spellmod->spellCommandCO->setCurrentItem(1);
608 } else if (rc.isp_command == "hspell") {
609 spellmod->spellCommandCO->setCurrentItem(2);
612 if (rc.use_spell_lib) {
613 #if defined(USE_ASPELL) || defined(USE_PSPELL)
614 spellmod->spellCommandCO->setCurrentItem(3);
618 // FIXME: remove isp_use_alt_lang
619 spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
620 // FIXME: remove isp_use_esc_chars
621 spellmod->escapeCharactersED->setText(toqstr(rc.isp_esc_chars));
622 // FIXME: remove isp_use_pers_dict
623 spellmod->persDictionaryED->setText(external_path(rc.isp_pers_dict));
624 spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
625 spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
628 QPrefPrinterModule * printmod(dialog_->printerModule);
630 printmod->printerAdaptCB->setChecked(rc.print_adapt_output);
631 printmod->printerCommandED->setText(toqstr(rc.print_command));
632 printmod->printerNameED->setText(toqstr(rc.printer));
634 printmod->printerPageRangeED->setText(toqstr(rc.print_pagerange_flag));
635 printmod->printerCopiesED->setText(toqstr(rc.print_copies_flag));
636 printmod->printerReverseED->setText(toqstr(rc.print_reverse_flag));
637 printmod->printerToPrinterED->setText(toqstr(rc.print_to_printer));
638 printmod->printerExtensionED->setText(toqstr(rc.print_file_extension));
639 printmod->printerSpoolCommandED->setText(toqstr(rc.print_spool_command));
640 printmod->printerPaperTypeED->setText(toqstr(rc.print_paper_flag));
641 printmod->printerEvenED->setText(toqstr(rc.print_evenpage_flag));
642 printmod->printerOddED->setText(toqstr(rc.print_oddpage_flag));
643 printmod->printerCollatedED->setText(toqstr(rc.print_collcopies_flag));
644 printmod->printerLandscapeED->setText(toqstr(rc.print_landscape_flag));
645 printmod->printerToFileED->setText(external_path(rc.print_to_file));
646 printmod->printerExtraED->setText(toqstr(rc.print_extra_options));
647 printmod->printerSpoolPrefixED->setText(toqstr(rc.print_spool_printerprefix));
648 printmod->printerPaperSizeED->setText(toqstr(rc.print_paper_dimension_flag));
651 QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
653 setComboxFont(fontmod->screenRomanCO, rc.roman_font_name,
654 rc.roman_font_foundry);
655 setComboxFont(fontmod->screenSansCO, rc.sans_font_name,
656 rc.sans_font_foundry);
657 setComboxFont(fontmod->screenTypewriterCO, rc.typewriter_font_name,
658 rc.typewriter_font_foundry);
660 dialog_->select_roman(fontmod->screenRomanCO->currentText());
661 dialog_->select_sans(fontmod->screenSansCO->currentText());
662 dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
664 fontmod->screenZoomSB->setValue(rc.zoom);
665 fontmod->screenDpiSB->setValue(rc.dpi);
666 fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
667 fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
668 fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
669 fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
670 fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
671 fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
672 fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
673 fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
674 fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
675 fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
677 dialog_->updateFormats();
678 dialog_->updateConverters();
679 dialog_->updateCopiers();
682 } // namespace frontend