FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
: FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy),
dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
- spellchecker_tab_(0), lnf_general_(0), screen_fonts_(0),
- interface_(0), printer_(0), paths_(0), outputs_general_(0)
+ usage_tab_(0), colours_(0), interface_(0), language_(0),
+ lnf_misc_(0), outputs_misc_(0), paths_(0), printer_(0),
+ screen_fonts_(0), spellchecker_(0)
{
// let the dialog be shown
// This is a permanent connection so we won't bother
delete look_n_feel_tab_;
delete inputs_tab_;
delete outputs_tab_;
- delete spellchecker_tab_;
- delete lnf_general_;
- delete screen_fonts_;
+ delete usage_tab_;
+ delete colours_;
delete interface_;
- delete printer_;
+ delete language_;
+ delete lnf_misc_;
+ delete outputs_misc_;
delete paths_;
- delete outputs_general_;
+ delete printer_;
+ delete screen_fonts_;
+ delete spellchecker_;
+}
+
+
+FL_FORM * FormPreferences::form() const
+{
+ if (dialog_) return dialog_->form;
+ return 0;
+}
+
+
+void FormPreferences::ok()
+{
+ FormBase::ok();
+ lv_->getLyXFunc()->Dispatch(LFUN_SAVEPREFERENCES);
+}
+
+
+void FormPreferences::restore()
+{
+ update();
+// if I add an error message line to the dialog it'll have to be controlled
+// within input(). I don't need it yet so I'll leave it commented out.
+// bc_.valid(input(0));
}
// build the tab folders
outputs_tab_ = build_outer_tab();
look_n_feel_tab_ = build_outer_tab();
- inputs_tab_ = build_outer_tab();
- spellchecker_tab_ = build_spellchecker();
+ inputs_tab_ = build_outer_tab();
+ usage_tab_ = build_outer_tab();
// build actual tabfolder contents
// these will become nested tabfolders
- screen_fonts_ = build_screen_fonts();
- interface_ = build_interface();
- lnf_general_ = build_lnf_general();
- printer_ = build_printer();
- paths_ = build_paths();
- outputs_general_ = build_outputs_general();
-
- // setup the input returns
- // Lnf_General tab
- fl_set_counter_return(lnf_general_->counter_autosave, FL_RETURN_CHANGED);
- fl_set_counter_return(lnf_general_->counter_wm_jump, FL_RETURN_CHANGED);
- // Screen fonts
- fl_set_input_return(screen_fonts_->input_roman, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_sans, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_typewriter,
- FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_screen_encoding,
- FL_RETURN_CHANGED);
- fl_set_counter_return(screen_fonts_->counter_zoom, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_tiny, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_script, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_footnote, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_small, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_normal, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_large, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_larger, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_largest, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_huge, FL_RETURN_CHANGED);
- fl_set_input_return(screen_fonts_->input_huger, FL_RETURN_CHANGED);
- // interface
- fl_set_input_return(interface_->input_popup_font,
- FL_RETURN_CHANGED);
- fl_set_input_return(interface_->input_menu_font,
- FL_RETURN_CHANGED);
- fl_set_input_return(interface_->input_popup_encoding,
- FL_RETURN_CHANGED);
- fl_set_input_return(interface_->input_bind_file,
- FL_RETURN_CHANGED);
- fl_set_input_return(interface_->input_ui_file,
- FL_RETURN_CHANGED);
- // printer
- fl_set_input_return(printer_->input_command, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_page_range, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_copies, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_reverse, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_to_printer, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_file_extension, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_spool_command, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_paper_type, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_even_pages, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_odd_pages, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_collated, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_landscape, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_to_file, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_extra_options, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_spool_prefix, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_paper_size, FL_RETURN_CHANGED);
- fl_set_input_return(printer_->input_name, FL_RETURN_CHANGED);
- // paths
- fl_set_input_return(paths_->input_default_path, FL_RETURN_CHANGED);
- fl_set_input_return(paths_->input_template_path, FL_RETURN_CHANGED);
- fl_set_input_return(paths_->input_temp_dir, FL_RETURN_CHANGED);
- fl_set_input_return(paths_->input_lastfiles, FL_RETURN_CHANGED);
- fl_set_input_return(paths_->input_backup_path, FL_RETURN_CHANGED);
- fl_set_counter_return(paths_->counter_lastfiles, FL_RETURN_CHANGED);
- fl_set_input_return(paths_->input_serverpipe, FL_RETURN_CHANGED);
- // outputs general
- fl_set_counter_return(outputs_general_->counter_line_len,
- FL_RETURN_CHANGED);
- fl_set_input_return(outputs_general_->input_tex_encoding,
- FL_RETURN_CHANGED);
- fl_addto_choice(outputs_general_->choice_default_papersize,
- _(" default | US letter | legal | executive | A3 | A4 | A5 | B5 "));
-
- // spell checker
- fl_addto_choice(spellchecker_tab_->choice_spell_command,
- _(" none | ispell | aspell "));
- fl_set_input_return(spellchecker_tab_->input_alt_lang,
- FL_RETURN_CHANGED);
- fl_set_input_return(spellchecker_tab_->input_escape_chars,
- FL_RETURN_CHANGED);
- fl_set_input_return(spellchecker_tab_->input_personal_dict,
- FL_RETURN_CHANGED);
+ buildColours();
+ buildInterface();
+ buildLanguage();
+ buildLnFmisc();
+ buildOutputsMisc();
+ buildPaths();
+ buildPrinter();
+ buildScreenFonts();
+ buildSpellchecker();
// Now add them to the tabfolder
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Outputs"),
outputs_tab_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
- _("Spell checker"),
- spellchecker_tab_->form);
+ _("Usage"),
+ usage_tab_->form);
// now build the nested tabfolders
// Starting with look and feel
_("Interface"),
interface_->form);
fl_addto_tabfolder(look_n_feel_tab_->tabfolder_outer,
- _("General"),
- lnf_general_->form);
+ _("Colours"),
+ colours_->form);
+ fl_addto_tabfolder(look_n_feel_tab_->tabfolder_outer,
+ _("Misc"),
+ lnf_misc_->form);
// then build inputs
// Paths should probably go in a few outer_tab called Files
_("Printer"),
printer_->form);
fl_addto_tabfolder(outputs_tab_->tabfolder_outer,
- _("General"),
- outputs_general_->form);
-
- // deactivate the various browse buttons because they
- // currently aren't implemented
- fl_deactivate_object(interface_->button_bind_file_browse);
- fl_deactivate_object(interface_->button_ui_file_browse);
- fl_deactivate_object(paths_->button_document_browse);
- fl_deactivate_object(paths_->button_template_browse);
- fl_deactivate_object(paths_->button_temp_dir_browse);
- fl_deactivate_object(paths_->button_lastfiles_browse);
- fl_deactivate_object(paths_->button_backup_path_browse);
- fl_deactivate_object(paths_->button_serverpipe_browse);
- fl_deactivate_object(spellchecker_tab_->button_personal_dict);
- fl_set_object_lcol(interface_->button_bind_file_browse, FL_INACTIVE);
- fl_set_object_lcol(interface_->button_ui_file_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_document_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_template_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_temp_dir_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_lastfiles_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_backup_path_browse, FL_INACTIVE);
- fl_set_object_lcol(paths_->button_serverpipe_browse, FL_INACTIVE);
- fl_set_object_lcol(spellchecker_tab_->button_personal_dict, FL_INACTIVE);
-}
+ _("Misc"),
+ outputs_misc_->form);
-
-FL_FORM * FormPreferences::form() const
-{
- if (dialog_) return dialog_->form;
- return 0;
+ // then building usage
+ fl_addto_tabfolder(usage_tab_->tabfolder_outer,
+ _("Spell checker"),
+ spellchecker_->form);
+ fl_addto_tabfolder(usage_tab_->tabfolder_outer,
+ _("Language"),
+ language_->form);
}
// what we copy to make sure that it really is necessary to do things
// like update the screen fonts because that flushes the textcache
// and other stuff which may cost us a lot on slower/high-load machines.
-
- // Look 'n Feel General tab
- lyxrc.show_banner = fl_get_button(lnf_general_->check_banner);
- lyxrc.auto_region_delete = fl_get_button(lnf_general_->
- check_auto_region_delete);
- lyxrc.exit_confirmation = fl_get_button(lnf_general_->check_exit_confirm);
- lyxrc.display_shortcuts =
- fl_get_button(lnf_general_->check_display_shortcuts);
- lyxrc.new_ask_filename = fl_get_button(lnf_general_->check_ask_new_file);
- lyxrc.cursor_follows_scrollbar =
- fl_get_button(lnf_general_->check_cursor_follows_scrollbar);
- lyxrc.autosave = static_cast<unsigned int>
- (fl_get_counter_value(lnf_general_->counter_autosave));
- lyxrc.wheel_jump = static_cast<unsigned int>
- (fl_get_counter_value(lnf_general_->counter_wm_jump));
- // Interface
+
+ applyInterface();
+ applyLnFmisc();
+ applyOutputsMisc();
+ applyPaths();
+ applyPrinter();
+ applyScreenFonts();
+ applySpellChecker();
+}
+
+
+void FormPreferences::update()
+{
+ if (!dialog_) return;
+
+ // read lyxrc entries
+ updateInterface();
+ updateLnFmisc();
+ updateOutputsMisc();
+ updatePaths();
+ updatePrinter();
+ updateScreenFonts();
+ updateSpellChecker();
+}
+
+
+bool FormPreferences::input(FL_OBJECT * ob, long data)
+{
+ bool activate = true;
+
+ // Remove any existing messages
+ fl_set_object_label(dialog_->text_warning, " ");
+
+ // whatever checks you need to ensure the user hasn't entered
+ // some totally ridiculous value somewhere. Change activate to suit.
+ // comments before each test describe what is _valid_
+
+ State cb = static_cast<State>( data );
+ switch( cb ) {
+ case COLOURS:
+ break;
+
+ case INTERFACE:
+ feedbackInterface( ob );
+ break;
+
+ case LANGUAGE:
+ break;
+
+ case LOOKNFEELMISC:
+ feedbackLnFmisc( ob );
+ break;
+
+ case OUTPUTSMISC:
+ feedbackOutputsMisc( ob );
+ break;
+
+ case PATHS:
+ feedbackPaths( ob );
+ if( ! inputPaths( ob ) )
+ activate = false;
+ break;
+
+ case PRINTER:
+ feedbackPrinter( ob );
+ break;
+
+ case SCREENFONTS:
+ feedbackScreenFonts( ob );
+ if( ! inputScreenFonts() )
+ activate = false;
+ break;
+
+ case SPELLCHECKER:
+ feedbackSpellChecker( ob );
+ if( ! inputSpellChecker( ob ) )
+ activate = false;
+ break;
+
+ case TABS:
+ break;
+ }
+
+ return activate;
+}
+
+
+void FormPreferences::buildColours()
+{
+ colours_ = build_colours();
+}
+
+
+void FormPreferences::applyInterface()
+{
lyxrc.popup_font_name =
fl_get_input(interface_->input_popup_font);
lyxrc.menu_font_name = fl_get_input(interface_->input_menu_font);
lyxrc.ui_file = fl_get_input(interface_->input_ui_file);
lyxrc.override_x_deadkeys =
fl_get_button(interface_->check_override_x_dead_keys);
- // Screen fonts
- if (lyxrc.roman_font_name !=
- fl_get_input(screen_fonts_->input_roman) ||
- lyxrc.sans_font_name !=
- fl_get_input(screen_fonts_->input_sans) ||
- lyxrc.typewriter_font_name !=
- fl_get_input(screen_fonts_->input_typewriter) ||
- lyxrc.font_norm !=
- fl_get_input(screen_fonts_->input_screen_encoding) ||
- lyxrc.use_scalable_fonts !=
- fl_get_button(screen_fonts_->check_scalable) ||
- lyxrc.zoom != static_cast<unsigned int>
- (fl_get_counter_value(screen_fonts_->counter_zoom)) ||
- lyxrc.font_sizes[LyXFont::SIZE_TINY] !=
- strToDbl(fl_get_input(screen_fonts_->input_tiny)) ||
- lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] !=
- strToDbl(fl_get_input(screen_fonts_->input_script)) ||
- lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] !=
- strToDbl(fl_get_input(screen_fonts_->input_footnote)) ||
- lyxrc.font_sizes[LyXFont::SIZE_SMALL] !=
- strToDbl(fl_get_input(screen_fonts_->input_small)) ||
- lyxrc.font_sizes[LyXFont::SIZE_NORMAL] !=
- strToDbl(fl_get_input(screen_fonts_->input_normal)) ||
- lyxrc.font_sizes[LyXFont::SIZE_LARGE] !=
- strToDbl(fl_get_input(screen_fonts_->input_large)) ||
- lyxrc.font_sizes[LyXFont::SIZE_LARGER] !=
- strToDbl(fl_get_input(screen_fonts_->input_larger)) ||
- lyxrc.font_sizes[LyXFont::SIZE_LARGEST] !=
- strToDbl(fl_get_input(screen_fonts_->input_largest)) ||
- lyxrc.font_sizes[LyXFont::SIZE_HUGE] !=
- strToDbl(fl_get_input(screen_fonts_->input_huge)) ||
- lyxrc.font_sizes[LyXFont::SIZE_HUGER] !=
- strToDbl(fl_get_input(screen_fonts_->input_huger))) {
- // Something has changed so copy all of them and then force
- // an update of the screen fonts (ie. redraw every buffer)
- lyxrc.roman_font_name = fl_get_input(screen_fonts_->input_roman);
- lyxrc.sans_font_name = fl_get_input(screen_fonts_->input_sans);
- lyxrc.typewriter_font_name = fl_get_input(screen_fonts_->
- input_typewriter);
- lyxrc.font_norm = fl_get_input(screen_fonts_->
- input_screen_encoding);
- lyxrc.use_scalable_fonts =
- fl_get_button(screen_fonts_->check_scalable);
- lyxrc.zoom = static_cast<unsigned int>
- (fl_get_counter_value(screen_fonts_->counter_zoom));
- lyxrc.font_sizes[LyXFont::SIZE_TINY] =
- strToDbl(fl_get_input(screen_fonts_->input_tiny));
- lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] =
- strToDbl(fl_get_input(screen_fonts_->input_script));
- lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] =
- strToDbl(fl_get_input(screen_fonts_->input_footnote));
- lyxrc.font_sizes[LyXFont::SIZE_SMALL] =
- strToDbl(fl_get_input(screen_fonts_->input_small));
- lyxrc.font_sizes[LyXFont::SIZE_NORMAL] =
- strToDbl(fl_get_input(screen_fonts_->input_normal));
- lyxrc.font_sizes[LyXFont::SIZE_LARGE] =
- strToDbl(fl_get_input(screen_fonts_->input_large));
- lyxrc.font_sizes[LyXFont::SIZE_LARGER] =
- strToDbl(fl_get_input(screen_fonts_->input_larger));
- lyxrc.font_sizes[LyXFont::SIZE_LARGEST] =
- strToDbl(fl_get_input(screen_fonts_->input_largest));
- lyxrc.font_sizes[LyXFont::SIZE_HUGE] =
- strToDbl(fl_get_input(screen_fonts_->input_huge));
- lyxrc.font_sizes[LyXFont::SIZE_HUGER] =
- strToDbl(fl_get_input(screen_fonts_->input_huger));
- // Now update the buffers
- // Can anything below here affect the redraw process?
- lv_->getLyXFunc()->Dispatch(LFUN_SCREEN_FONT_UPDATE);
+}
+
+
+void FormPreferences::buildInterface()
+{
+ interface_ = build_interface();
+
+ fl_set_input_return(interface_->input_popup_font, FL_RETURN_CHANGED);
+ fl_set_input_return(interface_->input_menu_font, FL_RETURN_CHANGED);
+ fl_set_input_return(interface_->input_popup_encoding,
+ FL_RETURN_CHANGED);
+ fl_set_input_return(interface_->input_bind_file, FL_RETURN_CHANGED);
+ fl_set_input_return(interface_->input_ui_file, FL_RETURN_CHANGED);
+
+ // deactivate the browse buttons because they aren't implemented
+ fl_deactivate_object(interface_->button_bind_file_browse);
+ fl_deactivate_object(interface_->button_ui_file_browse);
+ fl_set_object_lcol(interface_->button_bind_file_browse, FL_INACTIVE);
+ fl_set_object_lcol(interface_->button_ui_file_browse, FL_INACTIVE);
+}
+
+
+void FormPreferences::feedbackInterface( FL_OBJECT const * const ob )
+{
+ string str;
+
+ if( ob == interface_->input_popup_font ) {
+ str = N_("The font for popups.");
+ } else if ( ob == interface_->input_menu_font ) {
+ str = N_("The font for menus (and groups titles in popups).");
+ } else if ( ob == interface_->input_popup_encoding ) {
+ str = N_("The norm for the menu/popups fonts.");
+ } else if ( ob == interface_->input_bind_file ) {
+ str = N_("Keybindings file. Can either specify an absolute path,\nor LyX will look in its global and local bind/ directories.");
+ } else if ( ob == interface_->input_ui_file ) {
+ str = N_("The UI (user interface) file. Can either specify an absolute path,\nor LyX will look in its global and local ui/ directories.");
+ } else if ( ob == interface_->check_override_x_dead_keys ) {
+ str = N_("Set to true for LyX to take over the handling of the dead keys\n(a.k.a accent keys) that may be defined for your keyboard.");
}
- // printer
- lyxrc.print_adapt_output = fl_get_button(printer_->check_adapt_output);
- lyxrc.print_command = fl_get_input(printer_->input_command);
- lyxrc.print_pagerange_flag = fl_get_input(printer_->input_page_range);
- lyxrc.print_copies_flag = fl_get_input(printer_->input_copies);
- lyxrc.print_reverse_flag = fl_get_input(printer_->input_reverse);
- lyxrc.print_to_printer = fl_get_input(printer_->input_to_printer);
- lyxrc.print_file_extension =
- fl_get_input(printer_->input_file_extension);
- lyxrc.print_spool_command =
- fl_get_input(printer_->input_spool_command);
- lyxrc.print_paper_flag = fl_get_input(printer_->input_paper_type);
- lyxrc.print_evenpage_flag = fl_get_input(printer_->input_even_pages);
- lyxrc.print_oddpage_flag = fl_get_input(printer_->input_odd_pages);
- lyxrc.print_collcopies_flag = fl_get_input(printer_->input_collated);
- lyxrc.print_landscape_flag = fl_get_input(printer_->input_landscape);
- lyxrc.print_to_file = fl_get_input(printer_->input_to_file);
- lyxrc.print_extra_options =
- fl_get_input(printer_->input_extra_options);
- lyxrc.print_spool_printerprefix =
- fl_get_input(printer_->input_spool_prefix);
- lyxrc.print_paper_dimension_flag =
- fl_get_input(printer_->input_paper_size);
- lyxrc.printer = fl_get_input(printer_->input_name);
- // paths
- lyxrc.document_path = fl_get_input(paths_->input_default_path);
- lyxrc.template_path = fl_get_input(paths_->input_template_path);
- lyxrc.tempdir_path = fl_get_input(paths_->input_temp_dir);
- lyxrc.lastfiles = fl_get_input(paths_->input_lastfiles);
- lyxrc.backupdir_path = fl_get_input(paths_->input_backup_path);
- lyxrc.use_tempdir = fl_get_button(paths_->check_use_temp_dir);
- lyxrc.check_lastfiles = fl_get_button(paths_->check_last_files);
- lyxrc.make_backup = fl_get_button(paths_->check_make_backups);
- lyxrc.num_lastfiles = static_cast<unsigned int>
- (fl_get_counter_value(paths_->counter_lastfiles));
- lyxrc.lyxpipes = fl_get_input(paths_->input_serverpipe);
- // outputs general
- lyxrc.ascii_linelen = static_cast<unsigned int>
- (fl_get_counter_value(outputs_general_->counter_line_len));
- lyxrc.fontenc = fl_get_input(outputs_general_->input_tex_encoding);
- int choice =
- fl_get_choice(outputs_general_->choice_default_papersize) - 1;
- lyxrc.default_papersize = static_cast<BufferParams::PAPER_SIZE>(choice);
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
- applySpellChecker();
+
+void FormPreferences::updateInterface()
+{
+ fl_set_input(interface_->input_popup_font,
+ lyxrc.popup_font_name.c_str());
+ fl_set_input(interface_->input_menu_font,
+ lyxrc.menu_font_name.c_str());
+ fl_set_input(interface_->input_popup_encoding,
+ lyxrc.font_norm_menu.c_str());
+ fl_set_input(interface_->input_bind_file,
+ lyxrc.bind_file.c_str());
+ fl_set_input(interface_->input_ui_file,
+ lyxrc.ui_file.c_str());
+ fl_set_button(interface_->check_override_x_dead_keys,
+ lyxrc.override_x_deadkeys);
+}
+
+
+void FormPreferences::buildLanguage()
+{
+ language_ = build_language();
+}
+
+
+void FormPreferences::applyLnFmisc()
+{
+ lyxrc.show_banner = fl_get_button(lnf_misc_->check_banner);
+ lyxrc.auto_region_delete = fl_get_button(lnf_misc_->
+ check_auto_region_delete);
+ lyxrc.exit_confirmation = fl_get_button(lnf_misc_->check_exit_confirm);
+ lyxrc.display_shortcuts =
+ fl_get_button(lnf_misc_->check_display_shortcuts);
+ lyxrc.new_ask_filename = fl_get_button(lnf_misc_->check_ask_new_file);
+ lyxrc.cursor_follows_scrollbar =
+ fl_get_button(lnf_misc_->check_cursor_follows_scrollbar);
+ lyxrc.autosave = static_cast<unsigned int>
+ (fl_get_counter_value(lnf_misc_->counter_autosave));
+ lyxrc.wheel_jump = static_cast<unsigned int>
+ (fl_get_counter_value(lnf_misc_->counter_wm_jump));
+}
+
+
+void FormPreferences::buildLnFmisc()
+{
+ lnf_misc_ = build_lnf_misc();
+
+ fl_set_counter_return(lnf_misc_->counter_autosave,
+ FL_RETURN_CHANGED);
+ fl_set_counter_return(lnf_misc_->counter_wm_jump,
+ FL_RETURN_CHANGED);
+}
+
+
+void FormPreferences::feedbackLnFmisc( FL_OBJECT const * const ob )
+{
+ string str;
+
+ if( ob == lnf_misc_->check_banner ) {
+ str = N_("Set to false if you don't want the startup banner.");
+ } else if( ob == lnf_misc_->check_auto_region_delete ) {
+ str = N_("Set to false if you don't want the current selection to be replaced\nautomatically by what you type.");
+ } else if( ob == lnf_misc_->check_exit_confirm ) {
+ str = N_("Sets whether LyX asks for a second confirmation to exit when you have\nchanged documents.\n(LyX will still ask to save changed documents.)");
+ } else if( ob == lnf_misc_->check_display_shortcuts ) {
+ str = N_("LyX continously displays names of last command executed,\nalong with a list of defined short-cuts for it in the minibuffer.\nSet to false if LyX seems slow.");
+ } else if( ob == lnf_misc_->check_ask_new_file ) {
+ str = N_("This sets the behaviour if you want to be asked for a filename when\ncreating a new document or wait until you save it and be asked then.");
+ } else if( ob == lnf_misc_->check_cursor_follows_scrollbar ) {
+ str = N_("LyX normally doesn't update the cursor position if you move the scrollbar.\nSet to true if you'd prefer to always have the cursor on screen.");
+ } else if( ob == lnf_misc_->counter_autosave ) {
+ str = N_("The time interval between auto-saves (in seconds).\n0 means no auto-save");
+ } else if( ob == lnf_misc_->counter_wm_jump ) {
+ str = N_("The wheel movement factor (for mice with wheels or five button mice)");
+ }
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+void FormPreferences::updateLnFmisc()
+{
+ fl_set_button(lnf_misc_->check_banner,
+ lyxrc.show_banner);
+ fl_set_button(lnf_misc_->check_auto_region_delete,
+ lyxrc.auto_region_delete);
+ fl_set_button(lnf_misc_->check_exit_confirm,
+ lyxrc.exit_confirmation);
+ fl_set_button(lnf_misc_->check_display_shortcuts,
+ lyxrc.display_shortcuts);
+ fl_set_button(lnf_misc_->check_ask_new_file,
+ lyxrc.new_ask_filename);
+ fl_set_button(lnf_misc_->check_cursor_follows_scrollbar,
+ lyxrc.cursor_follows_scrollbar);
+ fl_set_counter_value(lnf_misc_->counter_autosave,
+ lyxrc.autosave);
+ fl_set_counter_value(lnf_misc_->counter_wm_jump,
+ lyxrc.wheel_jump);
+}
+
+
+void FormPreferences::applyOutputsMisc()
+{
+ lyxrc.ascii_linelen = static_cast<unsigned int>
+ (fl_get_counter_value(outputs_misc_->counter_line_len));
+ lyxrc.fontenc = fl_get_input(outputs_misc_->input_tex_encoding);
+
+ int choice =
+ fl_get_choice(outputs_misc_->choice_default_papersize) - 1;
+ lyxrc.default_papersize = static_cast<BufferParams::PAPER_SIZE>(choice);
+}
+
+
+void FormPreferences::buildOutputsMisc()
+{
+ outputs_misc_ = build_outputs_misc();
+
+ fl_set_counter_return(outputs_misc_->counter_line_len,
+ FL_RETURN_CHANGED);
+ fl_set_input_return(outputs_misc_->input_tex_encoding,
+ FL_RETURN_CHANGED);
+ fl_addto_choice(outputs_misc_->choice_default_papersize,
+ _(" default | US letter | legal | executive | A3 | A4 | A5 | B5 "));
+}
+
+
+void FormPreferences::feedbackOutputsMisc(FL_OBJECT const * const ob )
+{
+ string str;
+
+ if( ob == outputs_misc_->counter_line_len ) {
+ str = N_("This is the maximum line length of an exported ASCII file\n(LaTeX, SGML or plain text).");
+ } else if( ob == outputs_misc_->input_tex_encoding ) {
+ str = N_("The font encoding used for the LaTeX2e fontenc package.\nT1 is highly recommended for non-English languages.");
+ } else if( ob == outputs_misc_->choice_default_papersize ) {
+ str = N_("Specify the default paper size.");
+ }
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+
+void FormPreferences::updateOutputsMisc()
+{
+ fl_set_counter_value(outputs_misc_->counter_line_len,
+ lyxrc.ascii_linelen);
+ fl_set_input(outputs_misc_->input_tex_encoding,
+ lyxrc.fontenc.c_str());
+ fl_set_choice(outputs_misc_->choice_default_papersize,
+ lyxrc.default_papersize+1);
+}
+
+
+void FormPreferences::applyPaths()
+{
+ lyxrc.document_path = fl_get_input(paths_->input_default_path);
+ lyxrc.template_path = fl_get_input(paths_->input_template_path);
+
+ int button = fl_get_button(paths_->check_use_temp_dir);
+ string str = fl_get_input(paths_->input_temp_dir);
+ if( !button ) str.erase();
+
+ lyxrc.use_tempdir = button;
+ lyxrc.tempdir_path = str;
+
+ button = fl_get_button(paths_->check_last_files);
+ str = fl_get_input(paths_->input_lastfiles);
+ if( !button ) str.erase();
+
+ lyxrc.check_lastfiles = button;
+ lyxrc.lastfiles = str;
+ lyxrc.num_lastfiles = static_cast<unsigned int>
+ (fl_get_counter_value(paths_->counter_lastfiles));
+
+ button = fl_get_button(paths_->check_make_backups);
+ str = fl_get_input(paths_->input_backup_path);
+ if( !button ) str.erase();
+
+ lyxrc.make_backup = button;
+ lyxrc.backupdir_path = str;
+
+ lyxrc.lyxpipes = fl_get_input(paths_->input_serverpipe);
+
+ // update view
+ updatePaths();
+}
+
+
+void FormPreferences::buildPaths()
+{
+ paths_ = build_paths();
+
+ fl_set_input_return(paths_->input_default_path, FL_RETURN_CHANGED);
+ fl_set_input_return(paths_->input_template_path, FL_RETURN_CHANGED);
+ fl_set_input_return(paths_->input_temp_dir, FL_RETURN_CHANGED);
+ fl_set_input_return(paths_->input_lastfiles, FL_RETURN_CHANGED);
+ fl_set_input_return(paths_->input_backup_path, FL_RETURN_CHANGED);
+ fl_set_counter_return(paths_->counter_lastfiles, FL_RETURN_CHANGED);
+ fl_set_input_return(paths_->input_serverpipe, FL_RETURN_CHANGED);
+
+ // deactivate the browse buttons because they aren't implemented
+ fl_deactivate_object(paths_->button_document_browse);
+ fl_deactivate_object(paths_->button_template_browse);
+ fl_deactivate_object(paths_->button_temp_dir_browse);
+ fl_deactivate_object(paths_->button_lastfiles_browse);
+ fl_deactivate_object(paths_->button_backup_path_browse);
+ fl_deactivate_object(paths_->button_serverpipe_browse);
+ fl_set_object_lcol(paths_->button_document_browse, FL_INACTIVE);
+ fl_set_object_lcol(paths_->button_template_browse, FL_INACTIVE);
+ fl_set_object_lcol(paths_->button_temp_dir_browse, FL_INACTIVE);
+ fl_set_object_lcol(paths_->button_lastfiles_browse, FL_INACTIVE);
+ fl_set_object_lcol(paths_->button_backup_path_browse, FL_INACTIVE);
+ fl_set_object_lcol(paths_->button_serverpipe_browse, FL_INACTIVE);
+}
+
+
+void FormPreferences::feedbackPaths( FL_OBJECT const * const ob )
+{
+ string str;
+ if( ob == paths_->input_default_path ) {
+ str = N_("The default path for your documents.");
+ } else if ( ob == paths_->input_template_path ) {
+ str = N_("The path that LyX will set when offering to choose a template.");
+ } else if ( ob == paths_->check_use_temp_dir ) {
+ str = N_("Specify to use a temporary directory to store temporary TeX output.\nThis directory is deleted when you quit LyX.");
+ } else if ( ob == paths_->input_temp_dir ) {
+ str = N_("The path that LyX will use to store temporary TeX output.");
+ } else if ( ob == paths_->check_last_files ) {
+ str = N_("Specify to check whether the lastfiles still exist.");
+ } else if ( ob == paths_->input_lastfiles ) {
+ str = N_("The file where the last-files information should be stored.");
+ } else if ( ob == paths_->counter_lastfiles ) {
+ str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
+ } else if ( ob == paths_->check_make_backups ) {
+ str = N_("Set to false if you don't want LyX to create backup files.");
+ } else if ( ob == paths_->input_backup_path ) {
+ str = N_("The path for storing backup files. If it is an empty string,\nLyX will store the backup file in the same directory as the original file.");
+ } else if ( ob == paths_->input_serverpipe ) {
+ str = N_("This starts the lyxserver. The pipes get an additional extension\n\".in\" and \".out\". Only for advanced users.");
+ }
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+
+bool FormPreferences::inputPaths( FL_OBJECT const * const ob )
+{
+ bool activate = true;
+
+ if( !ob || ob == paths_->check_use_temp_dir ) {
+ if( fl_get_button(paths_->check_use_temp_dir) ) {
+ fl_activate_object(paths_->input_temp_dir);
+ fl_set_object_lcol(paths_->input_temp_dir,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(paths_->input_temp_dir);
+ fl_set_object_lcol(paths_->input_temp_dir,
+ FL_INACTIVE);
+ }
+ }
+
+ if( !ob || ob == paths_->check_last_files ) {
+ if( fl_get_button(paths_->check_last_files) ) {
+ fl_activate_object(paths_->input_lastfiles);
+ fl_set_object_lcol(paths_->input_lastfiles,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(paths_->input_lastfiles);
+ fl_set_object_lcol(paths_->input_lastfiles,
+ FL_INACTIVE);
+ }
+ }
+
+ if( !ob || ob == paths_->check_make_backups ) {
+ if( fl_get_button(paths_->check_make_backups) ) {
+ fl_activate_object(paths_->input_backup_path);
+ fl_set_object_lcol(paths_->input_backup_path,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(paths_->input_backup_path);
+ fl_set_object_lcol(paths_->input_backup_path,
+ FL_INACTIVE);
+ }
+ }
+
+ if( !ob || ob == paths_->input_default_path ) {
+ string name = fl_get_input(paths_->input_default_path);
+ if( !WriteableDir(name) )
+ return false;
+ }
+
+ if( !ob || ob == paths_->input_template_path ) {
+ string name = fl_get_input(paths_->input_template_path);
+ if( !ReadableDir(name) )
+ return false;
+ }
+
+ if( !ob || ob == paths_->input_temp_dir ) {
+ string name = fl_get_input(paths_->input_temp_dir);
+ if( fl_get_button(paths_->check_make_backups)
+ && !name.empty()
+ && !WriteableDir(name) )
+ return false;
+ }
+
+ if( !ob || ob == paths_->input_backup_path ) {
+ string name = fl_get_input(paths_->input_backup_path);
+ if( fl_get_button(paths_->check_make_backups)
+ && !name.empty()
+ && !WriteableDir(name) )
+ return false;
+ }
+
+ if( !ob || ob == paths_->input_lastfiles ) {
+ string name = fl_get_input(paths_->input_lastfiles);
+ if( fl_get_button(paths_->check_last_files)
+ && !name.empty()
+ && !WriteableFile(name) )
+ return false;
+ }
+
+ if( !ob || ob == paths_->input_serverpipe ) {
+ string name = fl_get_input(paths_->input_serverpipe);
+ if( !name.empty() ) {
+ if( !WriteableFile(name, ".in") )
+ return false;
+ if( !WriteableFile(name, ".out") )
+ return false;
+ }
+ }
+
+ return activate;
+}
+
+
+void FormPreferences::updatePaths()
+{
+ fl_set_input(paths_->input_default_path,
+ lyxrc.document_path.c_str());
+ fl_set_input(paths_->input_template_path,
+ lyxrc.template_path.c_str());
+
+ string str = string();
+ if( lyxrc.make_backup ) str = lyxrc.backupdir_path;
+
+ fl_set_button(paths_->check_make_backups,
+ lyxrc.make_backup);
+ fl_set_input(paths_->input_backup_path, str.c_str());
+
+ str.erase();
+ if( lyxrc.use_tempdir ) str = lyxrc.tempdir_path;
+
+ fl_set_button(paths_->check_use_temp_dir,
+ lyxrc.use_tempdir);
+ fl_set_input(paths_->input_temp_dir, str.c_str());
+
+ str.erase();
+ if( lyxrc.check_lastfiles ) str = lyxrc.lastfiles;
+
+ fl_set_button(paths_->check_last_files,
+ lyxrc.check_lastfiles);
+ fl_set_input(paths_->input_lastfiles, str.c_str());
+ fl_set_counter_value(paths_->counter_lastfiles,
+ lyxrc.num_lastfiles);
+
+ fl_set_input(paths_->input_serverpipe, lyxrc.lyxpipes.c_str());
+
+ // Activate/Deactivate the input fields dependent on the state of the
+ // buttons.
+ inputPaths( 0 );
+}
+
+
+void FormPreferences::applyPrinter()
+{
+ lyxrc.print_adapt_output = fl_get_button(printer_->check_adapt_output);
+ lyxrc.print_command = fl_get_input(printer_->input_command);
+ lyxrc.print_pagerange_flag = fl_get_input(printer_->input_page_range);
+ lyxrc.print_copies_flag = fl_get_input(printer_->input_copies);
+ lyxrc.print_reverse_flag = fl_get_input(printer_->input_reverse);
+ lyxrc.print_to_printer = fl_get_input(printer_->input_to_printer);
+ lyxrc.print_file_extension =
+ fl_get_input(printer_->input_file_extension);
+ lyxrc.print_spool_command =
+ fl_get_input(printer_->input_spool_command);
+ lyxrc.print_paper_flag = fl_get_input(printer_->input_paper_type);
+ lyxrc.print_evenpage_flag = fl_get_input(printer_->input_even_pages);
+ lyxrc.print_oddpage_flag = fl_get_input(printer_->input_odd_pages);
+ lyxrc.print_collcopies_flag = fl_get_input(printer_->input_collated);
+ lyxrc.print_landscape_flag = fl_get_input(printer_->input_landscape);
+ lyxrc.print_to_file = fl_get_input(printer_->input_to_file);
+ lyxrc.print_extra_options =
+ fl_get_input(printer_->input_extra_options);
+ lyxrc.print_spool_printerprefix =
+ fl_get_input(printer_->input_spool_prefix);
+ lyxrc.print_paper_dimension_flag =
+ fl_get_input(printer_->input_paper_size);
+ lyxrc.printer = fl_get_input(printer_->input_name);
+}
+
+
+void FormPreferences::feedbackPrinter( FL_OBJECT const * const ob )
+{
+ string str;
+
+ if( ob == printer_->input_command ) {
+ str = N_("Your favorite print program, eg \"dvips\", \"dvilj4\"");
+ } else if( ob == printer_->check_adapt_output ) {
+ str = N_("Set to true for LyX to pass the name of the destination printer to your\nprint command.");
+ } else if( ob == printer_->input_to_printer ) {
+ str = N_("Option to pass to the print program to print on a specific printer.");
+ } else if( ob == printer_->input_to_file ) {
+ str = N_("Option to pass to the print program to print to a file.");
+ } else if( ob == printer_->input_file_extension ) {
+ str = N_("Extension of printer program output file. Usually .ps");
+ } else if( ob == printer_->input_extra_options ) {
+ str = N_("Extra options to pass to printing program after everything else,\nbut before the filename of the DVI file to be printed.");
+ } else if( ob == printer_->input_spool_command ) {
+ str = N_("When set, this printer option automatically prints to a file and then calls\na separate print spooling program on that file with the given name\nand arguments.");
+ } else if( ob == printer_->input_spool_prefix ) {
+ str = N_("If you specify a printer name in the print dialog, the following argument\nis prepended along with the printer name after the spool command.");
+ } else if( ob == printer_->input_name ) {
+ str = N_("The default printer to print on. If none is specified, LyX will\nuse the environment variable PRINTER.");
+ } else if( ob == printer_->input_even_pages
+ || ob == printer_->input_odd_pages
+ || ob == printer_->input_page_range
+ || ob == printer_->input_reverse
+ || ob == printer_->input_landscape
+ || ob == printer_->input_copies
+ || ob == printer_->input_collated
+ || ob == printer_->input_paper_type
+ || ob == printer_->input_paper_size ) {
+ str = N_("Look at the man page for your favorite print program to learn\nwhich options to use.");
+ }
+
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+
+void FormPreferences::buildPrinter()
+{
+ printer_ = build_printer();
+
+ fl_set_input_return(printer_->input_command, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_page_range, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_copies, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_reverse, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_to_printer, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_file_extension, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_spool_command, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_paper_type, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_even_pages, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_odd_pages, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_collated, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_landscape, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_to_file, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_extra_options, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_spool_prefix, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_paper_size, FL_RETURN_CHANGED);
+ fl_set_input_return(printer_->input_name, FL_RETURN_CHANGED);
+}
+
+
+void FormPreferences::updatePrinter()
+{
+ fl_set_button(printer_->check_adapt_output,
+ lyxrc.print_adapt_output);
+ fl_set_input(printer_->input_command,
+ lyxrc.print_command.c_str());
+ fl_set_input(printer_->input_page_range,
+ lyxrc.print_pagerange_flag.c_str());
+ fl_set_input(printer_->input_copies,
+ lyxrc.print_copies_flag.c_str());
+ fl_set_input(printer_->input_reverse,
+ lyxrc.print_reverse_flag.c_str());
+ fl_set_input(printer_->input_to_printer,
+ lyxrc.print_to_printer.c_str());
+ fl_set_input(printer_->input_file_extension,
+ lyxrc.print_file_extension.c_str());
+ fl_set_input(printer_->input_spool_command,
+ lyxrc.print_spool_command.c_str());
+ fl_set_input(printer_->input_paper_type,
+ lyxrc.print_paper_flag.c_str());
+ fl_set_input(printer_->input_even_pages,
+ lyxrc.print_evenpage_flag.c_str());
+ fl_set_input(printer_->input_odd_pages,
+ lyxrc.print_oddpage_flag.c_str());
+ fl_set_input(printer_->input_collated,
+ lyxrc.print_collcopies_flag.c_str());
+ fl_set_input(printer_->input_landscape,
+ lyxrc.print_landscape_flag.c_str());
+ fl_set_input(printer_->input_to_file,
+ lyxrc.print_to_file.c_str());
+ fl_set_input(printer_->input_extra_options,
+ lyxrc.print_extra_options.c_str());
+ fl_set_input(printer_->input_spool_prefix,
+ lyxrc.print_spool_printerprefix.c_str());
+ fl_set_input(printer_->input_paper_size,
+ lyxrc.print_paper_dimension_flag.c_str());
+ fl_set_input(printer_->input_name,
+ lyxrc.printer.c_str());
+}
+
+
+void FormPreferences::applyScreenFonts()
+{
+ bool changed = false;
+
+ string str = fl_get_input(screen_fonts_->input_roman);
+ if( lyxrc.roman_font_name != str ) {
+ changed = true;
+ lyxrc.roman_font_name = str;
+ }
+
+ str = fl_get_input(screen_fonts_->input_sans);
+ if( lyxrc.sans_font_name != str ) {
+ changed = true;
+ lyxrc.sans_font_name = str;
+ }
+
+ str = fl_get_input(screen_fonts_->input_typewriter);
+ if( lyxrc.typewriter_font_name != str ) {
+ changed = true;
+ lyxrc.typewriter_font_name = str;
+ }
+
+ str = fl_get_input(screen_fonts_->input_screen_encoding);
+ if( lyxrc.font_norm != str ) {
+ changed = true;
+ lyxrc.font_norm = str;
+ }
+
+ bool button = fl_get_button(screen_fonts_->check_scalable);
+ if( lyxrc.use_scalable_fonts != button ) {
+ changed = true;
+ lyxrc.use_scalable_fonts = button;
+ }
+
+ int ivalue = fl_get_counter_value(screen_fonts_->counter_zoom);
+ if( lyxrc.zoom != static_cast<unsigned int>( ivalue ) ) {
+ changed = true;
+ lyxrc.zoom = static_cast<unsigned int>( ivalue );
+ }
+
+ double dvalue = strToDbl(fl_get_input(screen_fonts_->input_tiny));
+ if( lyxrc.font_sizes[LyXFont::SIZE_TINY] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_TINY] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_script));
+ if( lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_footnote));
+ if( lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_small));
+ if( lyxrc.font_sizes[LyXFont::SIZE_SMALL] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_SMALL] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_normal));
+ if( lyxrc.font_sizes[LyXFont::SIZE_NORMAL] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_NORMAL] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_large));
+ if( lyxrc.font_sizes[LyXFont::SIZE_LARGE] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_LARGE] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_larger));
+ if( lyxrc.font_sizes[LyXFont::SIZE_LARGER] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_LARGER] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_largest));
+ if( lyxrc.font_sizes[LyXFont::SIZE_LARGEST] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_LARGEST] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_huge));
+ if( lyxrc.font_sizes[LyXFont::SIZE_HUGE] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_HUGE] = dvalue;
+ }
+
+ dvalue = strToDbl(fl_get_input(screen_fonts_->input_huger));
+ if( lyxrc.font_sizes[LyXFont::SIZE_HUGER] != dvalue ) {
+ changed = true;
+ lyxrc.font_sizes[LyXFont::SIZE_HUGER] = dvalue;
+ }
+
+ if( changed ) {
+ // Now update the buffers
+ // Can anything below here affect the redraw process?
+ lv_->getLyXFunc()->Dispatch(LFUN_SCREEN_FONT_UPDATE);
+ }
+}
+
+
+void FormPreferences::buildScreenFonts()
+{
+ screen_fonts_ = build_screen_fonts();
+
+ fl_set_input_return(screen_fonts_->input_roman, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_sans, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_typewriter,
+ FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_screen_encoding,
+ FL_RETURN_CHANGED);
+ fl_set_counter_return(screen_fonts_->counter_zoom, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_tiny, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_script, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_footnote, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_small, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_normal, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_large, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_larger, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_largest, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_huge, FL_RETURN_CHANGED);
+ fl_set_input_return(screen_fonts_->input_huger, FL_RETURN_CHANGED);
+}
+
+
+void FormPreferences::feedbackScreenFonts(FL_OBJECT const * const ob )
+{
+ string str;
+
+ if( ob == screen_fonts_->input_roman
+ || ob == screen_fonts_->input_sans
+ || ob == screen_fonts_->input_typewriter ) {
+ str = N_("The screen fonts used to display the text while editing.");
+ } else if( ob == screen_fonts_->check_scalable ) {
+ str = N_("Allow the use of scalable screen fonts? If false, LyX will use the\nclosest existing size for a match. Use this if the scalable fonts\nlook bad and you have many fixed size fonts.");
+ } else if( ob == screen_fonts_->input_screen_encoding ) {
+ str = N_("The norm for the screen fonts.");
+ } else if( ob == screen_fonts_->counter_zoom ) {
+ str = N_("The zoom percentage for screen fonts.\nA setting of 100% will make the fonts roughly the same size as on paper.");
+ } else if( ob == screen_fonts_->input_tiny
+ || ob == screen_fonts_->input_script
+ || ob == screen_fonts_->input_footnote
+ || ob == screen_fonts_->input_small
+ || ob == screen_fonts_->input_large
+ || ob == screen_fonts_->input_larger
+ || ob == screen_fonts_->input_larger
+ || ob == screen_fonts_->input_largest
+ || ob == screen_fonts_->input_normal
+ || ob == screen_fonts_->input_huge
+ || ob == screen_fonts_->input_huger ) {
+ str = N_("The font sizes used for calculating the scaling of the screen fonts.");
+ }
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+
+bool FormPreferences::inputScreenFonts()
+{
+ bool activate = true;
+ string str;
+
+ // Make sure that all fonts all have positive entries
+ // Also note that an empty entry is returned as 0.0 by strToDbl
+ if (0.0 >= strToDbl(fl_get_input(screen_fonts_->input_tiny))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_script))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_footnote))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_small))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_normal))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_large))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_larger))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_largest))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_huge))
+ || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_huger))) {
+ activate = false;
+ str = N_("WARNING! Fonts must be positive!");
+
+ // Fontsizes -- tiny < script < footnote etc.
+ } else if (strToDbl(fl_get_input(screen_fonts_->input_tiny)) >
+ strToDbl(fl_get_input(screen_fonts_->input_script)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_script)) >
+ strToDbl(fl_get_input(screen_fonts_->input_footnote)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_footnote)) >
+ strToDbl(fl_get_input(screen_fonts_->input_small)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_small)) >
+ strToDbl(fl_get_input(screen_fonts_->input_normal)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_normal)) >
+ strToDbl(fl_get_input(screen_fonts_->input_large)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_large)) >
+ strToDbl(fl_get_input(screen_fonts_->input_larger)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_larger)) >
+ strToDbl(fl_get_input(screen_fonts_->input_largest)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_largest)) >
+ strToDbl(fl_get_input(screen_fonts_->input_huge)) ||
+ strToDbl(fl_get_input(screen_fonts_->input_huge)) >
+ strToDbl(fl_get_input(screen_fonts_->input_huger))) {
+ activate = false;
+
+ str = N_("WARNING! Fonts must be input in the order tiny > script>\nfootnote > small > normal > large > larger > largest > huge > huger.");
+ }
+
+ if( !activate ) {
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+ }
+
+ return activate;
+}
+
+
+void FormPreferences::updateScreenFonts()
+{
+ fl_set_input(screen_fonts_->input_roman,
+ lyxrc.roman_font_name.c_str());
+ fl_set_input(screen_fonts_->input_sans,
+ lyxrc.sans_font_name.c_str());
+ fl_set_input(screen_fonts_->input_typewriter,
+ lyxrc.typewriter_font_name.c_str());
+ fl_set_input(screen_fonts_->input_screen_encoding,
+ lyxrc.font_norm.c_str());
+ fl_set_button(screen_fonts_->check_scalable,
+ lyxrc.use_scalable_fonts);
+ fl_set_counter_value(screen_fonts_->counter_zoom,
+ lyxrc.zoom);
+ fl_set_input(screen_fonts_->input_tiny,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_TINY]).c_str());
+ fl_set_input(screen_fonts_->input_script,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_SCRIPT]).c_str());
+ fl_set_input(screen_fonts_->input_footnote,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE]).c_str());
+ fl_set_input(screen_fonts_->input_small,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_SMALL]).c_str());
+ fl_set_input(screen_fonts_->input_normal,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_NORMAL]).c_str());
+ fl_set_input(screen_fonts_->input_large,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGE]).c_str());
+ fl_set_input(screen_fonts_->input_larger,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGER]).c_str());
+ fl_set_input(screen_fonts_->input_largest,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGEST]).c_str());
+ fl_set_input(screen_fonts_->input_huge,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_HUGE]).c_str());
+ fl_set_input(screen_fonts_->input_huger,
+ tostr(lyxrc.font_sizes[LyXFont::SIZE_HUGER]).c_str());
}
{
string choice = "none";
- switch(fl_get_choice(spellchecker_tab_->choice_spell_command)) {
+ switch(fl_get_choice(spellchecker_->choice_spell_command)) {
case 1:
choice = "none";
break;
lyxrc.isp_command = choice;
// If spell checker == "none", all other input set to off.
- if( fl_get_choice(spellchecker_tab_->choice_spell_command) == 1 ) {
+ if( fl_get_choice(spellchecker_->choice_spell_command) == 1 ) {
lyxrc.isp_use_alt_lang = false;
lyxrc.isp_alt_lang.erase();
lyxrc.isp_accept_compound = false;
lyxrc.isp_use_input_encoding = false;
} else {
- int button = fl_get_button(spellchecker_tab_->check_alt_lang);
- choice = fl_get_input(spellchecker_tab_->input_alt_lang);
+ int button = fl_get_button(spellchecker_->check_alt_lang);
+ choice = fl_get_input(spellchecker_->input_alt_lang);
if( button && choice.empty() ) button = 0;
if( !button ) choice.erase();
lyxrc.isp_use_alt_lang = static_cast<bool>(button);
lyxrc.isp_alt_lang = choice;
- button = fl_get_button(spellchecker_tab_->check_escape_chars);
- choice = fl_get_input(spellchecker_tab_->input_escape_chars);
+ button = fl_get_button(spellchecker_->check_escape_chars);
+ choice = fl_get_input(spellchecker_->input_escape_chars);
if( button && choice.empty() ) button = 0;
if( !button ) choice.erase();
lyxrc.isp_use_esc_chars = static_cast<bool>(button);
lyxrc.isp_esc_chars = choice;
- button = fl_get_button(spellchecker_tab_->check_personal_dict);
- choice = fl_get_input(spellchecker_tab_->input_personal_dict);
+ button = fl_get_button(spellchecker_->check_personal_dict);
+ choice = fl_get_input(spellchecker_->input_personal_dict);
if( button && choice.empty() ) button = 0;
if( !button ) choice.erase();
lyxrc.isp_use_pers_dict = static_cast<bool>(button);
lyxrc.isp_pers_dict = choice;
- button = fl_get_button(spellchecker_tab_->check_compound_words);
+ button = fl_get_button(spellchecker_->check_compound_words);
lyxrc.isp_accept_compound = static_cast<bool>(button);
- button = fl_get_button(spellchecker_tab_->check_input_enc);
+ button = fl_get_button(spellchecker_->check_input_enc);
lyxrc.isp_use_input_encoding = static_cast<bool>(button);
}
-
+
+ // Reset view
updateSpellChecker();
}
-void FormPreferences::update()
+void FormPreferences::buildSpellchecker()
{
- if (!dialog_) return;
-
- // read lyxrc entries
- // Lnf_General tab
- fl_set_button(lnf_general_->check_banner,
- lyxrc.show_banner);
- fl_set_button(lnf_general_->check_auto_region_delete,
- lyxrc.auto_region_delete);
- fl_set_button(lnf_general_->check_exit_confirm,
- lyxrc.exit_confirmation);
- fl_set_button(lnf_general_->check_display_shortcuts,
- lyxrc.display_shortcuts);
- fl_set_button(lnf_general_->check_ask_new_file,
- lyxrc.new_ask_filename);
- fl_set_button(lnf_general_->check_cursor_follows_scrollbar,
- lyxrc.cursor_follows_scrollbar);
- fl_set_counter_value(lnf_general_->counter_autosave,
- lyxrc.autosave);
- fl_set_counter_value(lnf_general_->counter_wm_jump,
- lyxrc.wheel_jump);
- // Screen fonts
- fl_set_input(screen_fonts_->input_roman,
- lyxrc.roman_font_name.c_str());
- fl_set_input(screen_fonts_->input_sans,
- lyxrc.sans_font_name.c_str());
- fl_set_input(screen_fonts_->input_typewriter,
- lyxrc.typewriter_font_name.c_str());
- fl_set_input(screen_fonts_->input_screen_encoding,
- lyxrc.font_norm.c_str());
- fl_set_button(screen_fonts_->check_scalable,
- lyxrc.use_scalable_fonts);
- fl_set_counter_value(screen_fonts_->counter_zoom,
- lyxrc.zoom);
- fl_set_input(screen_fonts_->input_tiny,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_TINY]).c_str());
- fl_set_input(screen_fonts_->input_script,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_SCRIPT]).c_str());
- fl_set_input(screen_fonts_->input_footnote,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE]).c_str());
- fl_set_input(screen_fonts_->input_small,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_SMALL]).c_str());
- fl_set_input(screen_fonts_->input_normal,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_NORMAL]).c_str());
- fl_set_input(screen_fonts_->input_large,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGE]).c_str());
- fl_set_input(screen_fonts_->input_larger,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGER]).c_str());
- fl_set_input(screen_fonts_->input_largest,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_LARGEST]).c_str());
- fl_set_input(screen_fonts_->input_huge,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_HUGE]).c_str());
- fl_set_input(screen_fonts_->input_huger,
- tostr(lyxrc.font_sizes[LyXFont::SIZE_HUGER]).c_str());
- // interface
- fl_set_input(interface_->input_popup_font,
- lyxrc.popup_font_name.c_str());
- fl_set_input(interface_->input_menu_font,
- lyxrc.menu_font_name.c_str());
- fl_set_input(interface_->input_popup_encoding,
- lyxrc.font_norm_menu.c_str());
- fl_set_input(interface_->input_bind_file,
- lyxrc.bind_file.c_str());
- fl_set_input(interface_->input_ui_file,
- lyxrc.ui_file.c_str());
- fl_set_button(interface_->check_override_x_dead_keys,
- lyxrc.override_x_deadkeys);
- // printer
- fl_set_button(printer_->check_adapt_output,
- lyxrc.print_adapt_output);
- fl_set_input(printer_->input_command,
- lyxrc.print_command.c_str());
- fl_set_input(printer_->input_page_range,
- lyxrc.print_pagerange_flag.c_str());
- fl_set_input(printer_->input_copies,
- lyxrc.print_copies_flag.c_str());
- fl_set_input(printer_->input_reverse,
- lyxrc.print_reverse_flag.c_str());
- fl_set_input(printer_->input_to_printer,
- lyxrc.print_to_printer.c_str());
- fl_set_input(printer_->input_file_extension,
- lyxrc.print_file_extension.c_str());
- fl_set_input(printer_->input_spool_command,
- lyxrc.print_spool_command.c_str());
- fl_set_input(printer_->input_paper_type,
- lyxrc.print_paper_flag.c_str());
- fl_set_input(printer_->input_even_pages,
- lyxrc.print_evenpage_flag.c_str());
- fl_set_input(printer_->input_odd_pages,
- lyxrc.print_oddpage_flag.c_str());
- fl_set_input(printer_->input_collated,
- lyxrc.print_collcopies_flag.c_str());
- fl_set_input(printer_->input_landscape,
- lyxrc.print_landscape_flag.c_str());
- fl_set_input(printer_->input_to_file,
- lyxrc.print_to_file.c_str());
- fl_set_input(printer_->input_extra_options,
- lyxrc.print_extra_options.c_str());
- fl_set_input(printer_->input_spool_prefix,
- lyxrc.print_spool_printerprefix.c_str());
- fl_set_input(printer_->input_paper_size,
- lyxrc.print_paper_dimension_flag.c_str());
- fl_set_input(printer_->input_name,
- lyxrc.printer.c_str());
- // paths
- fl_set_input(paths_->input_default_path,
- lyxrc.document_path.c_str());
- fl_set_input(paths_->input_template_path,
- lyxrc.template_path.c_str());
- fl_set_input(paths_->input_temp_dir,
- lyxrc.tempdir_path.c_str());
- fl_set_input(paths_->input_lastfiles,
- lyxrc.lastfiles.c_str());
- fl_set_input(paths_->input_backup_path,
- lyxrc.backupdir_path.c_str());
- fl_set_button(paths_->check_use_temp_dir,
- lyxrc.use_tempdir);
- fl_set_button(paths_->check_last_files,
- lyxrc.check_lastfiles);
- fl_set_button(paths_->check_make_backups,
- lyxrc.make_backup);
- fl_set_counter_value(paths_->counter_lastfiles,
- lyxrc.num_lastfiles);
- fl_set_input(paths_->input_serverpipe, lyxrc.lyxpipes.c_str());
- // outputs general
- fl_set_counter_value(outputs_general_->counter_line_len,
- lyxrc.ascii_linelen);
- fl_set_input(outputs_general_->input_tex_encoding,
- lyxrc.fontenc.c_str());
- fl_set_choice(outputs_general_->choice_default_papersize,
- lyxrc.default_papersize+1);
+ spellchecker_ = build_spellchecker();
- updateSpellChecker();
+ fl_addto_choice(spellchecker_->choice_spell_command,
+ _(" none | ispell | aspell "));
+ fl_set_input_return(spellchecker_->input_alt_lang,
+ FL_RETURN_CHANGED);
+ fl_set_input_return(spellchecker_->input_escape_chars,
+ FL_RETURN_CHANGED);
+ fl_set_input_return(spellchecker_->input_personal_dict,
+ FL_RETURN_CHANGED);
+
+ // deactivate the browse button because it isn't implemented
+ fl_deactivate_object(spellchecker_->button_personal_dict);
+ fl_set_object_lcol(spellchecker_->button_personal_dict,
+ FL_INACTIVE);
+}
+
+
+void FormPreferences::feedbackSpellChecker( FL_OBJECT const * const ob )
+{
+ string str;
+ if( ob == spellchecker_->choice_spell_command ) {
+ str = N_("What command runs the spell checker?");
+ } else if( ob == spellchecker_->check_alt_lang ) {
+ str = N_("Specify an alternate language.\nThe default is to use the language of the document.");
+ } else if( ob == spellchecker_->check_escape_chars ) {
+ str = N_("Specify additional chars that can be part of a word.");
+ } else if( ob == spellchecker_->check_personal_dict ) {
+ str = N_("Specify an alternate personal dictionary file.\nE.g. \".ispell_english\".");
+ } else if( ob == spellchecker_->check_compound_words ) {
+ str = N_("Consider run-together words, such as \"notthe\" for \"not the\",\nas legal words?");
+ } else if( ob == spellchecker_->check_input_enc ) {
+ str = N_("Specify whether to pass the -T input encoding option to ispell.\nEnable this if you can't spellcheck words with international letters\nin them.\nThis may not work with all dictionaries.");
+ }
+
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+}
+
+
+bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
+{
+ // Allow/dissallow input
+
+ // If spell checker == "none", disable all input.
+ if( !ob || ob == spellchecker_->choice_spell_command ) {
+ if( fl_get_choice(spellchecker_->choice_spell_command) == 1 ) {
+ fl_deactivate_object( spellchecker_->check_alt_lang );
+ fl_deactivate_object( spellchecker_->input_alt_lang );
+ fl_deactivate_object( spellchecker_->check_escape_chars );
+ fl_deactivate_object( spellchecker_->input_escape_chars );
+ fl_deactivate_object( spellchecker_->check_personal_dict );
+ fl_deactivate_object( spellchecker_->input_personal_dict );
+ fl_deactivate_object( spellchecker_->check_compound_words );
+ fl_deactivate_object( spellchecker_->check_input_enc );
+ return true;
+ } else {
+ fl_activate_object( spellchecker_->check_alt_lang );
+ fl_activate_object( spellchecker_->check_escape_chars );
+ fl_activate_object( spellchecker_->check_personal_dict );
+ fl_activate_object( spellchecker_->check_compound_words );
+ fl_activate_object( spellchecker_->check_input_enc );
+ }
+ }
+
+ if( !ob || ob == spellchecker_->check_alt_lang ) {
+ if( fl_get_button(spellchecker_->check_alt_lang) ) {
+ fl_activate_object(spellchecker_->input_alt_lang);
+ fl_set_object_lcol(spellchecker_->input_alt_lang,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(spellchecker_->input_alt_lang);
+ fl_set_object_lcol(spellchecker_->input_alt_lang,
+ FL_INACTIVE);
+ }
+ }
+
+ if( !ob || ob == spellchecker_->check_escape_chars ) {
+ if( fl_get_button(spellchecker_->check_escape_chars) ) {
+ fl_activate_object(spellchecker_->input_escape_chars);
+ fl_set_object_lcol(spellchecker_->input_escape_chars,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(spellchecker_->input_escape_chars);
+ fl_set_object_lcol(spellchecker_->input_escape_chars,
+ FL_INACTIVE);
+ }
+ }
+
+ if( !ob || ob == spellchecker_->check_personal_dict ) {
+ if( fl_get_button(spellchecker_->check_personal_dict) ) {
+ fl_activate_object(spellchecker_->input_personal_dict);
+ fl_set_object_lcol(spellchecker_->input_personal_dict,
+ FL_BLACK);
+ } else {
+ fl_deactivate_object(spellchecker_->input_personal_dict);
+ fl_set_object_lcol(spellchecker_->input_personal_dict,
+ FL_INACTIVE);
+ }
+ }
+
+ return true; // all input is valid!
}
choice = 2;
else if( lyxrc.isp_command == "aspell" )
choice = 3;
- fl_set_choice(spellchecker_tab_->choice_spell_command, choice);
+ fl_set_choice(spellchecker_->choice_spell_command, choice);
string str = string();
if( lyxrc.isp_use_alt_lang ) str = lyxrc.isp_alt_lang;
- fl_set_button(spellchecker_tab_->check_alt_lang,
+ fl_set_button(spellchecker_->check_alt_lang,
lyxrc.isp_use_alt_lang);
- fl_set_input(spellchecker_tab_->input_alt_lang, str.c_str());
+ fl_set_input(spellchecker_->input_alt_lang, str.c_str());
- str = string();
+ str.erase();
if( lyxrc.isp_use_esc_chars ) str = lyxrc.isp_esc_chars;
- fl_set_button(spellchecker_tab_->check_escape_chars,
+ fl_set_button(spellchecker_->check_escape_chars,
lyxrc.isp_use_esc_chars);
- fl_set_input(spellchecker_tab_->input_escape_chars, str.c_str());
+ fl_set_input(spellchecker_->input_escape_chars, str.c_str());
- str = string();
+ str.erase();
if( lyxrc.isp_use_pers_dict ) str = lyxrc.isp_pers_dict;
- fl_set_button(spellchecker_tab_->check_personal_dict,
+ fl_set_button(spellchecker_->check_personal_dict,
lyxrc.isp_use_pers_dict);
- fl_set_input(spellchecker_tab_->input_personal_dict, str.c_str());
+ fl_set_input(spellchecker_->input_personal_dict, str.c_str());
- fl_set_button(spellchecker_tab_->check_compound_words,
+ fl_set_button(spellchecker_->check_compound_words,
lyxrc.isp_accept_compound);
- fl_set_button(spellchecker_tab_->check_input_enc,
+ fl_set_button(spellchecker_->check_input_enc,
lyxrc.isp_use_input_encoding);
// Activate/Deactivate the input fields dependent on the state of the
// buttons.
- inputSpellChecker();
+ inputSpellChecker( 0 );
}
-bool FormPreferences::input(FL_OBJECT *, long)
+bool FormPreferences::WriteableDir( string const & name ) const
{
- bool activate = true;
- //
- // whatever checks you need to ensure the user hasn't entered
- // some totally ridiculous value somewhere. Change activate to suit.
- // comments before each test describe what is _valid_
+ bool success = true;
+ string str;
- // input path -- dir should exist, be writable & absolute
- if (!AbsolutePath(fl_get_input(paths_->input_default_path))
- || 1 != IsDirWriteable(fl_get_input(paths_->input_default_path))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: input path is wrong\n";
+ if( !AbsolutePath(name) ) {
+ success = false;
+ str = N_("WARNING! The absolute path is required.");
}
- {
- // template_path should be a readable directory
- string temp(fl_get_input(paths_->input_template_path));
- FileInfo tp(temp);
- if (!AbsolutePath(temp)
- || !tp.isDir()
- || !tp.readable()) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: template path is wrong\n";
- }
+ FileInfo tp(name);
+ if( success && !tp.isDir() ) {
+ success = false;
+ str = N_("WARNING! Directory does not exist.");
}
- // tmpdir: not used
- // || writable directory
- if (fl_get_button(paths_->check_use_temp_dir)
- && (1 != IsDirWriteable(fl_get_input(paths_->input_temp_dir))
- || !AbsolutePath(fl_get_input(paths_->input_temp_dir)))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: tmpdir is wrong\n";
- }
-
- // backupdir: not used
- // || empty
- // || writable dir
- if (fl_get_button(paths_->check_make_backups)
- && (!string(fl_get_input(paths_->input_backup_path)).empty()
- && (1 != IsDirWriteable(fl_get_input(paths_->
- input_backup_path))
- || !AbsolutePath(fl_get_input(paths_->
- input_backup_path))))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: backupdir is wrong\n";
+ if( success && !tp.writable() ) {
+ success = false;
+ str = N_("WARNING! Cannot write to this directory.");
}
- // lastfiles: exists && writeable
- // || non-existent && isn't a dir
-#ifdef WITH_WARNINGS
-#warning incorrectly allows files in /, other tests might also do this
-#endif
- {
- string lastfiles(fl_get_input(paths_->input_lastfiles));
- FileInfo lf(lastfiles);
- if (!AbsolutePath(lastfiles)
- || 1 != IsDirWriteable(OnlyPath(lastfiles))
- || (lf.exist()
- && (lf.isDir()
- || !lf.writable()))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: lastfiles is wrong\n";
- }
+ if( !success ) {
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
}
+
+ return success;
+}
- // serverpipe: empty
- // || non-existent && isn't a dir
- // || exists && writeable
- // remember we append .in and .out later
- if (!string(fl_get_input(paths_->input_serverpipe)).empty()) {
- string pipe(fl_get_input(paths_->input_serverpipe));
- FileInfo sp_in(pipe + ".in");
- FileInfo sp_out(pipe + ".out");
- if (!AbsolutePath(pipe)
- || 1 != IsDirWriteable(OnlyPath(pipe))
- || (sp_in.exist()
- && (!sp_in.writable()
- || sp_in.isDir()))
- || (sp_out.exist()
- && (!sp_out.writable()
- || sp_out.isDir()))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: Serverpipe is wrong\n";
- }
+
+bool FormPreferences::ReadableDir( string const & name ) const
+{
+ bool success = true;
+ string str;
+
+ if( !AbsolutePath(name) ) {
+ success = false;
+ str = N_("WARNING! The absolute path is required.");
}
- // fontsizes -- tiny < script < footnote etc.
- if (0.0 >= strToDbl(fl_get_input(screen_fonts_->input_tiny))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_script))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_footnote))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_small))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_normal))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_large))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_larger))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_largest))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_huge))
- || 0.0 >= strToDbl(fl_get_input(screen_fonts_->input_huger))) {
- // make sure they all have positive entries
- // Also note that an empty entry is returned as 0.0 by strToDbl
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: Sizes are wrong\n";
- } else if (strToDbl(fl_get_input(screen_fonts_->input_tiny)) >
- strToDbl(fl_get_input(screen_fonts_->input_script)) ||
- strToDbl(fl_get_input(screen_fonts_->input_script)) >
- strToDbl(fl_get_input(screen_fonts_->input_footnote)) ||
- strToDbl(fl_get_input(screen_fonts_->input_footnote)) >
- strToDbl(fl_get_input(screen_fonts_->input_small)) ||
- strToDbl(fl_get_input(screen_fonts_->input_small)) >
- strToDbl(fl_get_input(screen_fonts_->input_normal)) ||
- strToDbl(fl_get_input(screen_fonts_->input_normal)) >
- strToDbl(fl_get_input(screen_fonts_->input_large)) ||
- strToDbl(fl_get_input(screen_fonts_->input_large)) >
- strToDbl(fl_get_input(screen_fonts_->input_larger)) ||
- strToDbl(fl_get_input(screen_fonts_->input_larger)) >
- strToDbl(fl_get_input(screen_fonts_->input_largest)) ||
- strToDbl(fl_get_input(screen_fonts_->input_largest)) >
- strToDbl(fl_get_input(screen_fonts_->input_huge)) ||
- strToDbl(fl_get_input(screen_fonts_->input_huge)) >
- strToDbl(fl_get_input(screen_fonts_->input_huger))) {
- activate = false;
- lyxerr[Debug::GUI] << "Preferences: Sizes are wrong\n";
+ FileInfo tp(name);
+ if( success && !tp.isDir() ) {
+ success = false;
+ str = N_("WARNING! Directory does not exist.");
}
- if( ! inputSpellChecker() )
- activate = false;
+ if( success && !tp.readable() ) {
+ success = false;
+ str = N_("WARNING! Cannot read this directory.");
+ }
- return activate;
+ if( !success ) {
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+ }
+
+ return success;
}
-bool FormPreferences::inputSpellChecker()
+bool FormPreferences::WriteableFile( string const & name, string const & suffix ) const
{
- // Allow/dissallow input
+ // A writeable file is either:
+ // * An existing file to which we have write access, or
+ // * A file that doesn't yet exist but that would exist in a writeable
+ // directory.
- // If spell checker == "none", disable all input.
- if( fl_get_choice(spellchecker_tab_->choice_spell_command) == 1 ) {
- fl_deactivate_object( spellchecker_tab_->check_alt_lang );
- fl_deactivate_object( spellchecker_tab_->input_alt_lang );
- fl_deactivate_object( spellchecker_tab_->check_escape_chars );
- fl_deactivate_object( spellchecker_tab_->input_escape_chars );
- fl_deactivate_object( spellchecker_tab_->check_personal_dict );
- fl_deactivate_object( spellchecker_tab_->input_personal_dict );
- fl_deactivate_object( spellchecker_tab_->check_compound_words );
- fl_deactivate_object( spellchecker_tab_->check_input_enc );
- return true;
- } else {
- fl_activate_object( spellchecker_tab_->check_alt_lang );
- fl_activate_object( spellchecker_tab_->check_escape_chars );
- fl_activate_object( spellchecker_tab_->check_personal_dict );
- fl_activate_object( spellchecker_tab_->check_compound_words );
- fl_activate_object( spellchecker_tab_->check_input_enc );
- }
-
- if( fl_get_button(spellchecker_tab_->check_alt_lang) ) {
- fl_activate_object(spellchecker_tab_->input_alt_lang);
- fl_set_object_lcol(spellchecker_tab_->input_alt_lang,
- FL_BLACK);
- } else {
- fl_deactivate_object(spellchecker_tab_->input_alt_lang);
- fl_set_object_lcol(spellchecker_tab_->input_alt_lang,
- FL_INACTIVE);
- }
+ bool success = true;
+ string str;
- if( fl_get_button(spellchecker_tab_->check_escape_chars) ) {
- fl_activate_object(spellchecker_tab_->input_escape_chars);
- fl_set_object_lcol(spellchecker_tab_->input_escape_chars,
- FL_BLACK);
- } else {
- fl_deactivate_object(spellchecker_tab_->input_escape_chars);
- fl_set_object_lcol(spellchecker_tab_->input_escape_chars,
- FL_INACTIVE);
+ if( name.empty() ) {
+ success = false;
+ str = N_("WARNING! No file input.");
}
- if( fl_get_button(spellchecker_tab_->check_personal_dict) ) {
- fl_activate_object(spellchecker_tab_->input_personal_dict);
- fl_set_object_lcol(spellchecker_tab_->input_personal_dict,
- FL_BLACK);
- } else {
- fl_deactivate_object(spellchecker_tab_->input_personal_dict);
- fl_set_object_lcol(spellchecker_tab_->input_personal_dict,
- FL_INACTIVE);
+ string dir = OnlyPath(name);
+ if( success && !AbsolutePath(dir) ) {
+ success = false;
+ str = N_("WARNING! The absolute path is required.");
}
- return true; // all input is valid!
-}
-
+ FileInfo d;
+ {
+ FileInfo d1(dir);
+ FileInfo d2(name);
+ if( d2.isDir() )
+ d = d2;
+ else
+ d = d1;
+ }
+
+ if( success && !d.isDir()) {
+ success = false;
+ str = N_("WARNING! Directory does not exist.");
+ }
+
+ if( success && !d.writable() ) {
+ success = false;
+ str = N_("WARNING! Cannot write to this directory.");
+ }
-void FormPreferences::ok()
-{
- FormBase::ok();
- lv_->getLyXFunc()->Dispatch(LFUN_SAVEPREFERENCES);
-}
+ FileInfo f(name+suffix);
+ if( success && (dir == name || f.isDir()) ) {
+ success = false;
+ str = N_("WARNING! A file is required, not a directory.");
+ }
+ if( success && (f.exist() && !f.writable()) ) {
+ success = false;
+ str = N_("WARNING! Cannot write to this file.");
+ }
+
+ if( !success ) {
+ fl_set_object_label(dialog_->text_warning, str.c_str());
+ fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+ }
-void FormPreferences::restore()
-{
- update();
-// if I add an error message line to the dialog it'll have to be controlled
-// within input(). I don't need it yet so I'll leave it commented out.
-// bc_.valid(input(0));
+ return success;
}
obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 500, "");
fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 10, 455, 375, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
+ fl_set_object_callback(obj, C_FormBaseInputCB, TABS);
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 390, 90, 30, idex(_("Apply|#A")));
fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 455, 375, "");
fdui->tabfolder_outer = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 0, 0, 455, 375, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
+ fl_set_object_callback(obj, C_FormBaseInputCB, TABS);
fl_end_form();
fdui->form->fdui = fdui;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 455, 375, "");
fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 210, 5, 200, 30, _("Roman"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT, 210, 35, 200, 30, _("Sans Serif"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 210, 65, 200, 30, _("Typewriter"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->counter_zoom = obj = fl_add_counter(FL_SIMPLE_COUNTER, 210, 125, 200, 30, _("%"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 999);
fl_set_counter_value(obj, 150);
fdui->check_scalable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 168, 125, 33, 31, _("Allow scaling"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_set_button(obj, 1);
fdui->input_screen_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 140, 165, 70, 30, _("tiny"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_script = obj = fl_add_input(FL_FLOAT_INPUT, 340, 165, 70, 30, _("script"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_footnote = obj = fl_add_input(FL_FLOAT_INPUT, 140, 195, 70, 30, _("footnote"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_small = obj = fl_add_input(FL_FLOAT_INPUT, 340, 195, 70, 30, _("small"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_large = obj = fl_add_input(FL_FLOAT_INPUT, 340, 225, 70, 30, _("large"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_larger = obj = fl_add_input(FL_FLOAT_INPUT, 140, 255, 70, 30, _("larger"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_largest = obj = fl_add_input(FL_FLOAT_INPUT, 340, 255, 70, 30, _("largest"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_normal = obj = fl_add_input(FL_FLOAT_INPUT, 140, 225, 70, 30, _("normal"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_huge = obj = fl_add_input(FL_FLOAT_INPUT, 140, 285, 70, 30, _("huge"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_huger = obj = fl_add_input(FL_FLOAT_INPUT, 340, 285, 70, 30, _("huger"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_end_form();
fdui->form->fdui = fdui;
}
/*---------------------------------------*/
-FD_form_outputs_general::~FD_form_outputs_general()
+FD_form_outputs_misc::~FD_form_outputs_misc()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
-FD_form_outputs_general * FormPreferences::build_outputs_general()
+FD_form_outputs_misc * FormPreferences::build_outputs_misc()
{
FL_OBJECT *obj;
- FD_form_outputs_general *fdui = new FD_form_outputs_general;
+ FD_form_outputs_misc *fdui = new FD_form_outputs_misc;
fdui->form = fl_bgn_form(FL_NO_BOX, 455, 375);
fdui->form->u_vdata = this;
fl_set_button_shortcut(obj, scex(_("Ascii line length|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, OUTPUTSMISC);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 120);
fl_set_counter_value(obj, 75);
fl_set_counter_step(obj, 1, 1);
fdui->input_tex_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 216, 95, 200, 30, _("TeX encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, OUTPUTSMISC);
fdui->choice_default_papersize = obj = fl_add_choice(FL_NORMAL_CHOICE, 217, 142, 199, 29, _("Default paper size"));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_callback(obj, C_FormBaseInputCB, OUTPUTSMISC);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *obj;
FD_form_spellchecker *fdui = new FD_form_spellchecker;
- fdui->form = fl_bgn_form(FL_NO_BOX, 450, 375);
+ fdui->form = fl_bgn_form(FL_NO_BOX, 450, 360);
fdui->form->u_vdata = this;
- obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 375, "");
- fdui->choice_spell_command = obj = fl_add_choice(FL_NORMAL_CHOICE, 141, 47, 171, 34, _("Spell command"));
+ obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 360, "");
+ fdui->choice_spell_command = obj = fl_add_choice(FL_NORMAL_CHOICE, 141, 47, 171, 34, idex(_("Spell command|#S")));
+ fl_set_button_shortcut(obj, scex(_("Spell command|#S")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_alt_lang = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 100, 30, 30, _("Use alternative language"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->check_alt_lang = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 100, 30, 30, idex(_("Use alternative language|#a")));
+ fl_set_button_shortcut(obj, scex(_("Use alternative language|#a")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
fdui->input_alt_lang = obj = fl_add_input(FL_NORMAL_INPUT, 239, 100, 170, 30, "");
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_escape_chars = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 130, 30, 30, _("Use escape characters"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->check_escape_chars = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 130, 30, 30, idex(_("Use escape characters|#e")));
+ fl_set_button_shortcut(obj, scex(_("Use escape characters|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
fdui->input_escape_chars = obj = fl_add_input(FL_NORMAL_INPUT, 239, 130, 170, 30, "");
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_personal_dict = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 160, 30, 30, _("Use personal dictionary"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->check_personal_dict = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 160, 30, 30, idex(_("Use personal dictionary|#d")));
+ fl_set_button_shortcut(obj, scex(_("Use personal dictionary|#d")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
fdui->input_personal_dict = obj = fl_add_input(FL_NORMAL_INPUT, 239, 160, 170, 30, "");
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->button_personal_dict = obj = fl_add_button(FL_NORMAL_BUTTON, 239, 190, 89, 30, _("Browse..."));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->button_personal_dict = obj = fl_add_button(FL_NORMAL_BUTTON, 239, 190, 89, 30, idex(_("Browse...|#B")));
+ fl_set_button_shortcut(obj, scex(_("Browse...|#B")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_compound_words = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 230, 30, 30, _("Accept compound words"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->check_compound_words = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 230, 30, 30, idex(_("Accept compound words|#w")));
+ fl_set_button_shortcut(obj, scex(_("Accept compound words|#w")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_input_enc = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 260, 30, 30, _("Use input encoding"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
+ fdui->check_input_enc = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 260, 30, 30, idex(_("Use input encoding|#i")));
+ fl_set_button_shortcut(obj, scex(_("Use input encoding|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, SPELLCHECKER);
fl_end_form();
fdui->form->fdui = fdui;
}
/*---------------------------------------*/
-FD_form_lnf_general::~FD_form_lnf_general()
+FD_form_language::~FD_form_language()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
-FD_form_lnf_general * FormPreferences::build_lnf_general()
+FD_form_language * FormPreferences::build_language()
{
FL_OBJECT *obj;
- FD_form_lnf_general *fdui = new FD_form_lnf_general;
+ FD_form_language *fdui = new FD_form_language;
+
+ fdui->form = fl_bgn_form(FL_NO_BOX, 450, 360);
+ fdui->form->u_vdata = this;
+ obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 360, "");
+ fl_end_form();
+
+ fdui->form->fdui = fdui;
+
+ return fdui;
+}
+/*---------------------------------------*/
+
+FD_form_colours::~FD_form_colours()
+{
+ if( form->visible ) fl_hide_form( form );
+ fl_free_form( form );
+}
+
+
+FD_form_colours * FormPreferences::build_colours()
+{
+ FL_OBJECT *obj;
+ FD_form_colours *fdui = new FD_form_colours;
+
+ fdui->form = fl_bgn_form(FL_NO_BOX, 450, 360);
+ fdui->form->u_vdata = this;
+ obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 360, "");
+ fl_end_form();
+
+ fdui->form->fdui = fdui;
+
+ return fdui;
+}
+/*---------------------------------------*/
+
+FD_form_lnf_misc::~FD_form_lnf_misc()
+{
+ if( form->visible ) fl_hide_form( form );
+ fl_free_form( form );
+}
+
+
+FD_form_lnf_misc * FormPreferences::build_lnf_misc()
+{
+ FL_OBJECT *obj;
+ FD_form_lnf_misc *fdui = new FD_form_lnf_misc;
fdui->form = fl_bgn_form(FL_NO_BOX, 450, 350);
fdui->form->u_vdata = this;
fdui->check_banner = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 15, 310, 30, idex(_("Show banner|#S")));
fl_set_button_shortcut(obj, scex(_("Show banner|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->check_auto_region_delete = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 45, 310, 30, idex(_("Auto region delete|#A")));
fl_set_button_shortcut(obj, scex(_("Auto region delete|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->check_exit_confirm = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 75, 310, 30, idex(_("Exit confirmation|#E")));
fl_set_button_shortcut(obj, scex(_("Exit confirmation|#E")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->check_display_shortcuts = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 105, 310, 30, _("Display keyboard shortcuts"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->counter_autosave = obj = fl_add_counter(FL_SIMPLE_COUNTER, 320, 255, 115, 30, _("Autosave interval"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 1200);
fl_set_counter_value(obj, 300);
fdui->check_ask_new_file = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 135, 310, 30, idex(_("File->New asks for name|#N")));
fl_set_button_shortcut(obj, scex(_("File->New asks for name|#N")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->check_cursor_follows_scrollbar = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 165, 310, 30, idex(_("Cursor follows scrollbar|#C")));
fl_set_button_shortcut(obj, scex(_("Cursor follows scrollbar|#C")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_button(obj, 1);
fdui->counter_wm_jump = obj = fl_add_counter(FL_SIMPLE_COUNTER, 320, 225, 115, 30, _("Wheel mouse jump"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, LOOKNFEELMISC);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 250);
fl_set_counter_value(obj, 100);
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 350, "");
fdui->input_popup_font = obj = fl_add_input(FL_NORMAL_INPUT, 230, 30, 200, 30, _("Popup Font"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fdui->input_menu_font = obj = fl_add_input(FL_NORMAL_INPUT, 230, 60, 200, 30, _("Menu Font"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fdui->input_popup_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 230, 90, 200, 30, _("Popup Encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fdui->input_bind_file = obj = fl_add_input(FL_NORMAL_INPUT, 160, 178, 190, 30, idex(_("Bind file|#B")));
fl_set_button_shortcut(obj, scex(_("Bind file|#B")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fdui->button_bind_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 178, 80, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_ui_file = obj = fl_add_input(FL_NORMAL_INPUT, 160, 148, 190, 30, idex(_("User Interface file|#U")));
fl_set_button_shortcut(obj, scex(_("User Interface file|#U")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fdui->button_ui_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 148, 80, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->check_override_x_dead_keys = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 24, 230, 310, 30, idex(_("Override X-Windows dead-keys|#O")));
fl_set_button_shortcut(obj, scex(_("Override X-Windows dead-keys|#O")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, INTERFACE);
fl_set_button(obj, 1);
fl_end_form();
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 350, "");
fdui->input_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 75, 80, 30, _("command"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_page_range = obj = fl_add_input(FL_NORMAL_INPUT, 130, 105, 80, 30, _("page range"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_copies = obj = fl_add_input(FL_NORMAL_INPUT, 130, 135, 80, 30, _("copies"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_reverse = obj = fl_add_input(FL_NORMAL_INPUT, 130, 165, 80, 30, _("reverse"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_to_printer = obj = fl_add_input(FL_NORMAL_INPUT, 130, 195, 80, 30, _("to printer"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_file_extension = obj = fl_add_input(FL_NORMAL_INPUT, 130, 225, 80, 30, _("file extension"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_spool_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 255, 80, 30, _("spool command"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_paper_type = obj = fl_add_input(FL_NORMAL_INPUT, 130, 285, 80, 30, _("paper type"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_even_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 75, 80, 30, _("even pages"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_odd_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 105, 80, 30, _("odd pages"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_collated = obj = fl_add_input(FL_NORMAL_INPUT, 360, 135, 80, 30, _("collated"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_landscape = obj = fl_add_input(FL_NORMAL_INPUT, 360, 165, 80, 30, _("landscape"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_to_file = obj = fl_add_input(FL_NORMAL_INPUT, 360, 195, 80, 30, _("to file"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_extra_options = obj = fl_add_input(FL_NORMAL_INPUT, 360, 225, 80, 30, _("extra options"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_spool_prefix = obj = fl_add_input(FL_NORMAL_INPUT, 360, 255, 80, 30, _("spool printer prefix"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_paper_size = obj = fl_add_input(FL_NORMAL_INPUT, 360, 285, 80, 30, _("paper size"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->input_name = obj = fl_add_input(FL_NORMAL_INPUT, 130, 10, 80, 30, _("name"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
fdui->check_adapt_output = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 240, 10, 120, 30, _("adapt output"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PRINTER);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 0, 60, 452, 260, _("Printer Command and Flags"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form();
fdui->form = fl_bgn_form(FL_NO_BOX, 450, 350);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 350, "");
- fdui->input_default_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 10, 170, 30, _("Default path"));
+ fdui->input_default_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 10, 170, 30, idex(_("Default path|#p")));
+ fl_set_button_shortcut(obj, scex(_("Default path|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fdui->button_document_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 10, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fdui->counter_lastfiles = obj = fl_add_counter(FL_SIMPLE_COUNTER, 170, 130, 90, 30, _("Last file count"));
+ fdui->counter_lastfiles = obj = fl_add_counter(FL_SIMPLE_COUNTER, 170, 130, 90, 30, idex(_("Last file count|#L")));
+ fl_set_button_shortcut(obj, scex(_("Last file count|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 9);
fl_set_counter_value(obj, 4);
fl_set_counter_step(obj, 1, 1);
- fdui->input_template_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 40, 170, 30, _("Template path"));
+ fdui->input_template_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 40, 170, 30, idex(_("Template path|#T")));
+ fl_set_button_shortcut(obj, scex(_("Template path|#T")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fdui->button_template_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 40, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fdui->check_last_files = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 100, 30, 30, _("Check last files"));
+ fdui->check_last_files = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 100, 30, 30, idex(_("Check last files|#C")));
+ fl_set_button_shortcut(obj, scex(_("Check last files|#C")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fl_set_button(obj, 1);
fdui->button_temp_dir_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 70, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_lastfiles = obj = fl_add_input(FL_NORMAL_INPUT, 170, 100, 170, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fdui->button_lastfiles_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 100, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fdui->check_make_backups = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 170, 30, 30, _("Backup path"));
+ fdui->check_make_backups = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 170, 30, 30, idex(_("Backup path|#B")));
+ fl_set_button_shortcut(obj, scex(_("Backup path|#B")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fl_set_button(obj, 1);
fdui->input_backup_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 170, 170, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fdui->button_backup_path_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 170, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fdui->input_serverpipe = obj = fl_add_input(FL_NORMAL_INPUT, 169, 217, 170, 30, _("LyXServer pipe"));
+ fdui->input_serverpipe = obj = fl_add_input(FL_NORMAL_INPUT, 169, 217, 170, 30, idex(_("LyXServer pipe|#S")));
+ fl_set_button_shortcut(obj, scex(_("LyXServer pipe|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fdui->button_serverpipe_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 339, 217, 90, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_temp_dir = obj = fl_add_input(FL_NORMAL_INPUT, 170, 70, 170, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->check_use_temp_dir = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 70, 30, 30, _("Temp dir"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
+ fdui->check_use_temp_dir = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 70, 30, 30, idex(_("Temp dir|#d")));
+ fl_set_button_shortcut(obj, scex(_("Temp dir|#d")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, PATHS);
fl_set_button(obj, 1);
fl_end_form();