]> git.lyx.org Git - features.git/blob - src/frontends/qt2/QPrefs.C
some prefs update work
[features.git] / src / frontends / qt2 / QPrefs.C
1 /**
2  * \file QPrefs.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "support/lstrings.h"
18  
19 #include "ControlPrefs.h"
20 #include "QPrefsDialog.h"
21 #include "ui/QPrefAsciiModule.h"
22 #include "ui/QPrefDateModule.h"
23 #include "ui/QPrefKeyboardModule.h"
24 #include "ui/QPrefLatexModule.h"
25 #include "ui/QPrefScreenFontsModule.h"
26 #include "ui/QPrefColorsModule.h"
27 #include "ui/QPrefDisplayModule.h"
28 #include "ui/QPrefPathsModule.h"
29 #include "ui/QPrefSpellcheckerModule.h"
30 #include "ui/QPrefConvertersModule.h"
31 #include "ui/QPrefFileformatsModule.h"
32 #include "ui/QPrefLanguageModule.h"
33 #include "ui/QPrefPrinterModule.h"
34 #include "ui/QPrefUIModule.h"
35 #include "QPrefs.h"
36 #include "Qt2BC.h"
37 #include "lyxrc.h"
38
39 #include <qpushbutton.h>
40 #include <qcheckbox.h>
41 #include <qlineedit.h>
42 #include <qspinbox.h>
43  
44 typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class;
45
46
47 QPrefs::QPrefs()
48         : base_class(_("LyX: Preferences"))
49 {
50 }
51
52
53 void QPrefs::build_dialog()
54 {
55         dialog_.reset(new QPrefsDialog(this));
56
57         bc().setOK(dialog_->savePB);
58         bc().setApply(dialog_->applyPB);
59         bc().setCancel(dialog_->closePB);
60         bc().setRestore(dialog_->restorePB);
61 }
62
63
64 void QPrefs::apply()
65 {
66         LyXRC & rc(controller().rc());
67
68         // do something ... 
69
70 #if 0
71         bool modifiedText = false;
72         bool modifiedBackground = false;
73
74         // Now do the same for the LyX LColors...
75         for (vector<NamedColor>::const_iterator cit = lyxColorDB.begin();
76              cit != lyxColorDB.end(); ++cit) {
77                 LColor::color lc = lcolor.getFromGUIName(cit->getname());
78                 if (lc == LColor::inherit) continue;
79
80                 // Create a valid X11 name of the form "#rrggbb"
81                 string const hexname = X11hexname(cit->color());
82
83                 if (lcolor.getX11Name(lc) != hexname) {
84                         lyxerr[Debug::GUI]
85                                 << "FormPreferences::Colors::apply: "
86                                 << "resetting LColor " << lcolor.getGUIName(lc)
87                                 << " from \"" << lcolor.getX11Name(lc)
88                                 << "\" to \"" << hexname << "\"."
89                                 << endl;
90
91                         parent_.controller().setColor(lc, hexname);
92                 }
93         }
94 }
95  
96         parent_.controller().setConverters(local_converters);
97
98         parent_.controller().setFormats(local_formats);
99  
100         rc.date_insert_format =
101                 fl_get_input(dialog_->input_date_format);
102  
103         rc.popup_normal_font =
104                 fl_get_input(dialog_->input_popup_normal_font);
105         rc.popup_bold_font = fl_get_input(dialog_->input_popup_bold_font);
106         rc.popup_font_encoding =
107                 fl_get_input(dialog_->input_popup_font_encoding);
108         rc.bind_file = fl_get_input(dialog_->input_bind_file);
109         rc.ui_file = fl_get_input(dialog_->input_ui_file);
110         rc.override_x_deadkeys =
111                 fl_get_button(dialog_->check_override_x_dead_keys);
112 }
113         int const pos = combo_default_lang->get();
114         rc.default_language = lang_[pos-1];
115
116         int button = fl_get_button(dialog_->check_use_kbmap);
117         string const name_1 = fl_get_input(dialog_->input_kbmap1);
118         string const name_2 = fl_get_input(dialog_->input_kbmap2);
119         if (button)
120                 button = !(name_1.empty() && name_2.empty());
121         rc.use_kbmap = static_cast<bool>(button);
122
123         if (rc.use_kbmap) {
124                 rc.primary_kbmap = name_1;
125                 rc.secondary_kbmap = name_2;
126         }
127
128         button = fl_get_button(dialog_->check_rtl_support);
129         rc.rtl_support = static_cast<bool>(button);
130
131         button = fl_get_button(dialog_->check_mark_foreign);
132         rc.mark_foreign_language = static_cast<bool>(button);
133
134         button = fl_get_button(dialog_->check_auto_begin);
135         rc.language_auto_begin = static_cast<bool>(button);
136
137         button = fl_get_button(dialog_->check_auto_end);
138         rc.language_auto_end = static_cast<bool>(button);
139
140         button = fl_get_button(dialog_->check_use_babel);
141         rc.language_use_babel = static_cast<bool>(button);
142
143         button = fl_get_button(dialog_->check_global_options);
144         rc.language_global_options = static_cast<bool>(button);
145
146         rc.language_package = fl_get_input(dialog_->input_package);
147         rc.language_command_begin = fl_get_input(dialog_->input_command_begin);
148         rc.language_command_end = fl_get_input(dialog_->input_command_end);
149
150         // Ensure that all is self-consistent.
151         update(rc);
152
153  
154         rc.auto_region_delete =
155                 fl_get_button(dialog_->check_auto_region_delete);
156         rc.cursor_follows_scrollbar =
157                 fl_get_button(dialog_->check_cursor_follows_scrollbar);
158         rc.dialogs_iconify_with_main =
159                 fl_get_button(dialog_->check_dialogs_iconify_with_main);
160         rc.preview = fl_get_button(dialog_->check_preview_latex);
161         rc.autosave = static_cast<unsigned int>
162                 (fl_get_counter_value(dialog_->counter_autosave));
163         rc.wheel_jump = static_cast<unsigned int>
164                 (fl_get_counter_value(dialog_->counter_wm_jump));
165
166         // See FIXME below
167         // grfx::DisplayType old_value = rc.display_graphics;
168         switch (fl_get_choice(dialog_->choice_display)) {
169                 case 4: rc.display_graphics = grfx::NoDisplay; break;
170                 case 3: rc.display_graphics = grfx::ColorDisplay; break;
171                 case 2: rc.display_graphics = grfx::GrayscaleDisplay; break;
172                 case 1: rc.display_graphics = grfx::MonochromeDisplay; break;
173                 default: rc.display_graphics = grfx::ColorDisplay; break;
174         }
175
176 #ifdef WITH_WARNINGS
177 #warning FIXME!! The graphics cache no longer has a changeDisplay method.
178 #endif
179 #if 0
180         if (old_value != rc.display_graphics) {
181                 grfx::GCache & gc = grfx::GCache::get();
182                 gc.changeDisplay();
183         }
184 #endif
185  
186
187  
188         rc.ascii_linelen = static_cast<unsigned int>
189                 (fl_get_counter_value(dialog_->counter_line_len));
190         rc.fontenc = fl_get_input(dialog_->input_tex_encoding);
191
192         int const choice =
193                 fl_get_choice(dialog_->choice_default_papersize) - 1;
194         rc.default_papersize = static_cast<BufferParams::PAPER_SIZE>(choice);
195
196         rc.ascii_roff_command = fl_get_input(dialog_->input_ascii_roff);
197         rc.chktex_command = fl_get_input(dialog_->input_checktex);
198         rc.view_dvi_paper_option = fl_get_input(dialog_->input_paperoption);
199         rc.auto_reset_options = fl_get_button(dialog_->check_autoreset_classopt);
200
201
202  
203         rc.document_path = fl_get_input(dialog_->input_default_path);
204         rc.template_path = fl_get_input(dialog_->input_template_path);
205
206         int button = fl_get_button(dialog_->check_use_temp_dir);
207         string str  = fl_get_input(dialog_->input_temp_dir);
208         if (!button)
209                 str.erase();
210
211         rc.use_tempdir = button;
212         rc.tempdir_path = str;
213
214         button = fl_get_button(dialog_->check_last_files);
215         str = fl_get_input(dialog_->input_lastfiles);
216         if (!button) str.erase();
217
218         rc.check_lastfiles = button;
219         rc.lastfiles = str;
220         rc.num_lastfiles = static_cast<unsigned int>
221                 (fl_get_counter_value(dialog_->counter_lastfiles));
222
223         button = fl_get_button(dialog_->check_make_backups);
224         str = fl_get_input(dialog_->input_backup_path);
225         if (!button)
226                 str.erase();
227
228         rc.make_backup = button;
229         rc.backupdir_path = str;
230
231         rc.lyxpipes = fl_get_input(dialog_->input_serverpipe);
232
233         // update view
234         update(rc);
235
236  
237         rc.print_adapt_output = fl_get_button(dialog_->check_adapt_output);
238         rc.print_command = fl_get_input(dialog_->input_command);
239         rc.print_pagerange_flag = fl_get_input(dialog_->input_page_range);
240         rc.print_copies_flag = fl_get_input(dialog_->input_copies);
241         rc.print_reverse_flag = fl_get_input(dialog_->input_reverse);
242         rc.print_to_printer = fl_get_input(dialog_->input_to_printer);
243         rc.print_file_extension =
244                 fl_get_input(dialog_->input_file_extension);
245         rc.print_spool_command =
246                 fl_get_input(dialog_->input_spool_command);
247         rc.print_paper_flag = fl_get_input(dialog_->input_paper_type);
248         rc.print_evenpage_flag = fl_get_input(dialog_->input_even_pages);
249         rc.print_oddpage_flag = fl_get_input(dialog_->input_odd_pages);
250         rc.print_collcopies_flag = fl_get_input(dialog_->input_collated);
251         rc.print_landscape_flag = fl_get_input(dialog_->input_landscape);
252         rc.print_to_file = fl_get_input(dialog_->input_to_file);
253         rc.print_extra_options =
254                 fl_get_input(dialog_->input_extra_options);
255         rc.print_spool_printerprefix =
256                 fl_get_input(dialog_->input_spool_prefix);
257         rc.print_paper_dimension_flag =
258                 fl_get_input(dialog_->input_paper_size);
259         rc.printer = fl_get_input(dialog_->input_name);
260
261
262  
263         bool changed = false;
264
265         string str = fl_get_input(dialog_->input_roman);
266         if (rc.roman_font_name != str) {
267                 changed = true;
268                 rc.roman_font_name = str;
269         }
270
271         str = fl_get_input(dialog_->input_sans);
272         if (rc.sans_font_name != str) {
273                 changed = true;
274                 rc.sans_font_name = str;
275         }
276
277         str = fl_get_input(dialog_->input_typewriter);
278         if (rc.typewriter_font_name != str) {
279                 changed = true;
280                 rc.typewriter_font_name = str;
281         }
282
283         str = fl_get_input(dialog_->input_screen_encoding);
284         if (rc.font_norm != str) {
285                 changed = true;
286                 rc.font_norm = str;
287         }
288
289         bool button = fl_get_button(dialog_->check_scalable);
290         if (rc.use_scalable_fonts != button) {
291                 changed = true;
292                 rc.use_scalable_fonts = button;
293         }
294
295         unsigned int ivalue = static_cast<unsigned int>
296                 (fl_get_counter_value(dialog_->counter_zoom));
297         if (rc.zoom != ivalue) {
298                 changed = true;
299                 rc.zoom = ivalue;
300         }
301
302         ivalue = static_cast<unsigned int>
303                 (fl_get_counter_value(dialog_->counter_dpi));
304         if (rc.dpi != ivalue) {
305                 changed = true;
306                 rc.dpi = ivalue;
307         }
308
309         double dvalue = strToDbl(fl_get_input(dialog_->input_tiny));
310         if (rc.font_sizes[LyXFont::SIZE_TINY] != dvalue) {
311                 changed = true;
312                 rc.font_sizes[LyXFont::SIZE_TINY] = dvalue;
313         }
314
315         dvalue = strToDbl(fl_get_input(dialog_->input_script));
316         if (rc.font_sizes[LyXFont::SIZE_SCRIPT] != dvalue) {
317                 changed = true;
318                 rc.font_sizes[LyXFont::SIZE_SCRIPT] = dvalue;
319         }
320
321         dvalue = strToDbl(fl_get_input(dialog_->input_footnote));
322         if (rc.font_sizes[LyXFont::SIZE_FOOTNOTE] != dvalue) {
323                 changed = true;
324                 rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = dvalue;
325         }
326
327         dvalue = strToDbl(fl_get_input(dialog_->input_small));
328         if (rc.font_sizes[LyXFont::SIZE_SMALL] != dvalue) {
329                 changed = true;
330                 rc.font_sizes[LyXFont::SIZE_SMALL] = dvalue;
331         }
332
333         dvalue = strToDbl(fl_get_input(dialog_->input_normal));
334         if (rc.font_sizes[LyXFont::SIZE_NORMAL] != dvalue) {
335                 changed = true;
336                 rc.font_sizes[LyXFont::SIZE_NORMAL] = dvalue;
337         }
338
339         dvalue = strToDbl(fl_get_input(dialog_->input_large));
340         if (rc.font_sizes[LyXFont::SIZE_LARGE] != dvalue) {
341                 changed = true;
342                 rc.font_sizes[LyXFont::SIZE_LARGE] = dvalue;
343         }
344
345         dvalue = strToDbl(fl_get_input(dialog_->input_larger));
346         if (rc.font_sizes[LyXFont::SIZE_LARGER] != dvalue) {
347                 changed = true;
348                 rc.font_sizes[LyXFont::SIZE_LARGER] = dvalue;
349         }
350
351         dvalue = strToDbl(fl_get_input(dialog_->input_largest));
352         if (rc.font_sizes[LyXFont::SIZE_LARGEST] != dvalue) {
353                 changed = true;
354                 rc.font_sizes[LyXFont::SIZE_LARGEST] = dvalue;
355         }
356
357         dvalue = strToDbl(fl_get_input(dialog_->input_huge));
358         if (rc.font_sizes[LyXFont::SIZE_HUGE] != dvalue) {
359                 changed = true;
360                 rc.font_sizes[LyXFont::SIZE_HUGE] = dvalue;
361         }
362
363         dvalue = strToDbl(fl_get_input(dialog_->input_huger));
364         if (rc.font_sizes[LyXFont::SIZE_HUGER] != dvalue) {
365                 changed = true;
366                 rc.font_sizes[LyXFont::SIZE_HUGER] = dvalue;
367         }
368
369         if (changed) {
370                 // Now update the buffers
371                 // Can anything below here affect the redraw process?
372                 parent_.controller().updateScreenFonts();
373
374
375  
376         string choice = fl_get_choice_text(dialog_->choice_spell_command);
377         choice = trim(choice);
378
379         rc.isp_command = choice;
380
381 #if 0
382         // If spell checker == "none", all other input set to off.
383         if (fl_get_choice(dialog_->choice_spell_command) == 1) {
384                 rc.isp_use_alt_lang = false;
385                 rc.isp_alt_lang.erase();
386
387                 rc.isp_use_esc_chars = false;
388                 rc.isp_esc_chars.erase();
389
390                 rc.isp_use_pers_dict = false;
391                 rc.isp_pers_dict.erase();
392
393                 rc.isp_accept_compound = false;
394                 rc.isp_use_input_encoding = false;
395         } else {
396 #else
397                 int button = fl_get_button(dialog_->check_alt_lang);
398                 choice = fl_get_input(dialog_->input_alt_lang);
399                 if (button && choice.empty()) button = 0;
400                 if (!button) choice.erase();
401
402                 rc.isp_use_alt_lang = static_cast<bool>(button);
403                 rc.isp_alt_lang = choice;
404
405                 button = fl_get_button(dialog_->check_escape_chars);
406                 choice = fl_get_input(dialog_->input_escape_chars);
407                 if (button && choice.empty()) button = 0;
408                 if (!button) choice.erase();
409
410                 rc.isp_use_esc_chars = static_cast<bool>(button);
411                 rc.isp_esc_chars = choice;
412
413                 button = fl_get_button(dialog_->check_personal_dict);
414                 choice = fl_get_input(dialog_->input_personal_dict);
415                 if (button && choice.empty()) button = 0;
416                 if (!button) choice.erase();
417
418                 rc.isp_use_pers_dict = static_cast<bool>(button);
419                 rc.isp_pers_dict = choice;
420
421                 button = fl_get_button(dialog_->check_compound_words);
422                 rc.isp_accept_compound = static_cast<bool>(button);
423
424                 button = fl_get_button(dialog_->check_input_enc);
425                 rc.isp_use_input_encoding = static_cast<bool>(button);
426 #endif
427 #if 0
428         }
429 #endif
430
431         // Reset view
432         update(rc);
433 #endif
434  
435 }
436
437
438 void QPrefs::update_contents()
439 {
440         LyXRC const & rc(controller().rc());
441
442         QPrefLanguageModule * langmod(dialog_->languageModule);
443  
444         // FIXME: remove rtl_support bool
445         langmod->rtlCB->setChecked(rc.rtl_support);
446         langmod->markForeignCB->setChecked(rc.mark_foreign_language); 
447         langmod->autoBeginCB->setChecked(rc.language_auto_begin); 
448         langmod->autoEndCB->setChecked(rc.language_auto_end); 
449         langmod->useBabelCB->setChecked(rc.language_use_babel);
450         langmod->globalCB->setChecked(rc.language_global_options);
451         langmod->languagePackageED->setText(rc.language_package.c_str());
452         langmod->startCommandED->setText(rc.language_command_begin.c_str());
453         langmod->endCommandED->setText(rc.language_command_end.c_str());
454
455
456         QPrefUIModule * uimod(dialog_->uiModule); 
457
458         uimod->uiFileED->setText(rc.bind_file.c_str());
459         uimod->bindFileED->setText(rc.ui_file.c_str());
460         uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar); 
461         uimod->wheelMouseSB->setValue(rc.wheel_jump);
462         // convert to minutes
463         int mins(rc.wheel_jump / 60);
464         if (rc.wheel_jump && !mins)
465                 mins = 1;
466         uimod->autoSaveSB->setValue(mins);
467  
468  
469         QPrefKeyboardModule * keymod(dialog_->keyboardModule);
470
471         // FIXME: can derive CB from the two EDs 
472         keymod->keymapCB->setChecked(rc.use_kbmap);
473         keymod->firstKeymapED->setText(rc.primary_kbmap.c_str());
474         keymod->secondKeymapED->setText(rc.secondary_kbmap.c_str());
475  
476
477         QPrefAsciiModule * ascmod(dialog_->asciiModule);
478
479         ascmod->asciiLinelengthSB->setValue(rc.ascii_linelen);
480         ascmod->asciiRoffED->setText(rc.ascii_roff_command.c_str());
481
482
483         QPrefDateModule * datemod(dialog_->dateModule);
484
485         datemod->DateED->setText(rc.date_insert_format.c_str());
486
487
488         QPrefLatexModule * latexmod(dialog_->latexModule);
489
490         latexmod->latexEncodingED->setText(rc.fontenc.c_str());
491         latexmod->latexChecktexED->setText(rc.chktex_command.c_str()); 
492         latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
493         latexmod->latexDviPaperED->setText(rc.view_dvi_paper_option.c_str());
494
495 #if 0 
496         local_converters = converters;
497         local_converters.update(local_formats);
498         UpdateBrowser();
499
500         local_formats = formats;
501         UpdateBrowser();
502
503         int const pos = int(findPos(lang_, rc.default_language));
504         combo_default_lang->select(pos + 1);
505
506         fl_set_button(dialog_->check_preview_latex,
507                       rc.preview);
508
509         switch (rc.display_graphics) {
510                 case grfx::NoDisplay:           fl_set_choice(dialog_->choice_display, 4); break;
511                 case grfx::ColorDisplay:        fl_set_choice(dialog_->choice_display, 3); break;
512                 case grfx::GrayscaleDisplay:    fl_set_choice(dialog_->choice_display, 2); break;
513                 case grfx::MonochromeDisplay:   fl_set_choice(dialog_->choice_display, 1); break;
514                 default:                        fl_set_choice(dialog_->choice_display, 3); break;
515         }
516
517         fl_set_choice(dialog_->choice_default_papersize,
518                       rc.default_papersize + 1);
519
520         fl_set_input(dialog_->input_default_path,
521                      rc.document_path.c_str());
522         fl_set_input(dialog_->input_template_path,
523                      rc.template_path.c_str());
524
525         string str;
526         if (rc.make_backup)
527                 str = rc.backupdir_path;
528
529         fl_set_button(dialog_->check_make_backups,
530                       rc.make_backup);
531         fl_set_input(dialog_->input_backup_path, str.c_str());
532
533         str.erase();
534         if (rc.use_tempdir)
535                 str = rc.tempdir_path;
536
537         fl_set_button(dialog_->check_use_temp_dir,
538                       rc.use_tempdir);
539         fl_set_input(dialog_->input_temp_dir, str.c_str());
540
541         str.erase();
542         if (rc.check_lastfiles)
543                 str = rc.lastfiles;
544
545         fl_set_button(dialog_->check_last_files,
546                       rc.check_lastfiles);
547         fl_set_input(dialog_->input_lastfiles, str.c_str());
548         fl_set_counter_value(dialog_->counter_lastfiles,
549                              rc.num_lastfiles);
550
551         fl_set_input(dialog_->input_serverpipe, rc.lyxpipes.c_str());
552
553         // Activate/Deactivate the input fields dependent on the state of the
554         // buttons.
555         input(0);
556
557
558         fl_set_button(dialog_->check_adapt_output,
559                       rc.print_adapt_output);
560         fl_set_input(dialog_->input_command,
561                      rc.print_command.c_str());
562         fl_set_input(dialog_->input_page_range,
563                      rc.print_pagerange_flag.c_str());
564         fl_set_input(dialog_->input_copies,
565                      rc.print_copies_flag.c_str());
566         fl_set_input(dialog_->input_reverse,
567                      rc.print_reverse_flag.c_str());
568         fl_set_input(dialog_->input_to_printer,
569                      rc.print_to_printer.c_str());
570         fl_set_input(dialog_->input_file_extension,
571                      rc.print_file_extension.c_str());
572         fl_set_input(dialog_->input_spool_command,
573                      rc.print_spool_command.c_str());
574         fl_set_input(dialog_->input_paper_type,
575                      rc.print_paper_flag.c_str());
576         fl_set_input(dialog_->input_even_pages,
577                      rc.print_evenpage_flag.c_str());
578         fl_set_input(dialog_->input_odd_pages,
579                      rc.print_oddpage_flag.c_str());
580         fl_set_input(dialog_->input_collated,
581                      rc.print_collcopies_flag.c_str());
582         fl_set_input(dialog_->input_landscape,
583                      rc.print_landscape_flag.c_str());
584         fl_set_input(dialog_->input_to_file,
585                      rc.print_to_file.c_str());
586         fl_set_input(dialog_->input_extra_options,
587                      rc.print_extra_options.c_str());
588         fl_set_input(dialog_->input_spool_prefix,
589                      rc.print_spool_printerprefix.c_str());
590         fl_set_input(dialog_->input_paper_size,
591                      rc.print_paper_dimension_flag.c_str());
592         fl_set_input(dialog_->input_name,
593                      rc.printer.c_str());
594
595
596
597         fl_set_input(dialog_->input_roman,
598                      rc.roman_font_name.c_str());
599         fl_set_input(dialog_->input_sans,
600                      rc.sans_font_name.c_str());
601         fl_set_input(dialog_->input_typewriter,
602                      rc.typewriter_font_name.c_str());
603         fl_set_input(dialog_->input_screen_encoding,
604                      rc.font_norm.c_str());
605         fl_set_button(dialog_->check_scalable,
606                       rc.use_scalable_fonts);
607         fl_set_counter_value(dialog_->counter_zoom, rc.zoom);
608         fl_set_counter_value(dialog_->counter_dpi,  rc.dpi);
609         fl_set_input(dialog_->input_tiny,
610                      tostr(rc.font_sizes[LyXFont::SIZE_TINY]).c_str());
611         fl_set_input(dialog_->input_script,
612                      tostr(rc.font_sizes[LyXFont::SIZE_SCRIPT]).c_str());
613         fl_set_input(dialog_->input_footnote,
614                      tostr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]).c_str());
615         fl_set_input(dialog_->input_small,
616                      tostr(rc.font_sizes[LyXFont::SIZE_SMALL]).c_str());
617         fl_set_input(dialog_->input_normal,
618                      tostr(rc.font_sizes[LyXFont::SIZE_NORMAL]).c_str());
619         fl_set_input(dialog_->input_large,
620                      tostr(rc.font_sizes[LyXFont::SIZE_LARGE]).c_str());
621         fl_set_input(dialog_->input_larger,
622                      tostr(rc.font_sizes[LyXFont::SIZE_LARGER]).c_str());
623         fl_set_input(dialog_->input_largest,
624                      tostr(rc.font_sizes[LyXFont::SIZE_LARGEST]).c_str());
625         fl_set_input(dialog_->input_huge,
626                      tostr(rc.font_sizes[LyXFont::SIZE_HUGE]).c_str());
627         fl_set_input(dialog_->input_huger,
628                      tostr(rc.font_sizes[LyXFont::SIZE_HUGER]).c_str());
629
630  
631         int choice = 1;
632 #if 0
633         if (rc.isp_command == "none")
634                 choice = 1;
635         else if (rc.isp_command == "ispell")
636                 choice = 2;
637         else if (rc.isp_command == "aspell")
638                 choice = 3;
639 #else
640         if (rc.isp_command == "ispell")
641                 choice = 1;
642         else if (rc.isp_command == "aspell")
643                 choice = 2;
644 #endif
645         fl_set_choice(dialog_->choice_spell_command, choice);
646
647         string str;
648         if (rc.isp_use_alt_lang)
649                 str = rc.isp_alt_lang;
650
651         fl_set_button(dialog_->check_alt_lang,
652                       rc.isp_use_alt_lang);
653         fl_set_input(dialog_->input_alt_lang, str.c_str());
654
655         str.erase();
656         if (rc.isp_use_esc_chars)
657                 str = rc.isp_esc_chars;
658
659         fl_set_button(dialog_->check_escape_chars,
660                       rc.isp_use_esc_chars);
661         fl_set_input(dialog_->input_escape_chars, str.c_str());
662
663         str.erase();
664         if (rc.isp_use_pers_dict)
665                 str = rc.isp_pers_dict;
666
667         fl_set_button(dialog_->check_personal_dict,
668                       rc.isp_use_pers_dict);
669         fl_set_input(dialog_->input_personal_dict, str.c_str());
670
671         fl_set_button(dialog_->check_compound_words,
672                       rc.isp_accept_compound);
673         fl_set_button(dialog_->check_input_enc,
674                       rc.isp_use_input_encoding);
675
676         // Activate/Deactivate the input fields dependent on the state of the
677         // buttons.
678         input(0);
679 #endif 
680 }