comparison libgui/src/settings-dialog.cc @ 28137:4cfe24f56336

add editor prefs for forcing coding standards (bug #57860, bug #57861) * gui-preferences-ed.h: add new editor preferences for removing trailing spaces and forcing a newline at end of the file when saving the file. * file-editor-tab.cc (eol_string): new method for determining the current end of line string; (do_save_file): depending on the user preferences, rmove trailing spaces and/or add a newline at the end before saving the file * file-editor-tab.h: new private method eol_string * settings-dialog.cc (settings_dialog): initialize new check boxes for handling trailing spaces and newline at end of file with prefs from the settings file; (write_changed_settings): write checked states of new check boxes into the settings file * settings-dialog.ui: new check boxes for handling trailing spaces and newline at end of file
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 22 Feb 2020 17:03:01 +0100
parents f1844e33f621
children 8abd3d8a9a2b
comparison
equal deleted inserted replaced
28135:712cd23aaa4f 28137:4cfe24f56336
348 editor_notebook_tab_width_min->setValue (settings->value (ed_notebook_tab_width_min).toInt ()); 348 editor_notebook_tab_width_min->setValue (settings->value (ed_notebook_tab_width_min).toInt ());
349 editor_notebook_tab_width_max->setValue (settings->value (ed_notebook_tab_width_max).toInt ()); 349 editor_notebook_tab_width_max->setValue (settings->value (ed_notebook_tab_width_max).toInt ());
350 editor_restoreSession->setChecked (settings->value (ed_restore_session).toBool ()); 350 editor_restoreSession->setChecked (settings->value (ed_restore_session).toBool ());
351 editor_create_new_file->setChecked (settings->value (ed_create_new_file).toBool ()); 351 editor_create_new_file->setChecked (settings->value (ed_create_new_file).toBool ());
352 editor_reload_changed_files->setChecked (settings->value (ed_always_reload_changed_files).toBool ()); 352 editor_reload_changed_files->setChecked (settings->value (ed_always_reload_changed_files).toBool ());
353 editor_force_newline->setChecked (settings->value (ed_force_newline).toBool ());
354 editor_remove_trailing_spaces->setChecked (settings->value (ed_rm_trailing_spaces).toBool ());
353 editor_hiding_closes_files->setChecked (settings->value (ed_hiding_closes_files).toBool ()); 355 editor_hiding_closes_files->setChecked (settings->value (ed_hiding_closes_files).toBool ());
354 editor_show_dbg_file->setChecked (settings->value (ed_show_dbg_file).toBool ()); 356 editor_show_dbg_file->setChecked (settings->value (ed_show_dbg_file).toBool ());
355 357
356 // terminal 358 // terminal
357 QString default_font = settings->value (global_mono_font).toString (); 359 QString default_font = settings->value (global_mono_font).toString ();
933 settings->setValue (ed_notebook_tab_width_max.key, editor_notebook_tab_width_max->value ()); 935 settings->setValue (ed_notebook_tab_width_max.key, editor_notebook_tab_width_max->value ());
934 settings->setValue (ed_restore_session.key, editor_restoreSession->isChecked ()); 936 settings->setValue (ed_restore_session.key, editor_restoreSession->isChecked ());
935 settings->setValue (ed_create_new_file.key, editor_create_new_file->isChecked ()); 937 settings->setValue (ed_create_new_file.key, editor_create_new_file->isChecked ());
936 settings->setValue (ed_hiding_closes_files.key, editor_hiding_closes_files->isChecked ()); 938 settings->setValue (ed_hiding_closes_files.key, editor_hiding_closes_files->isChecked ());
937 settings->setValue (ed_always_reload_changed_files.key, editor_reload_changed_files->isChecked ()); 939 settings->setValue (ed_always_reload_changed_files.key, editor_reload_changed_files->isChecked ());
940 settings->setValue (ed_force_newline.key, editor_force_newline->isChecked ());
941 settings->setValue (ed_rm_trailing_spaces.key, editor_remove_trailing_spaces->isChecked ());
938 settings->setValue (ed_show_dbg_file.key, editor_show_dbg_file->isChecked ()); 942 settings->setValue (ed_show_dbg_file.key, editor_show_dbg_file->isChecked ());
939 943
940 settings->setValue (cs_font_size.key, terminal_fontSize->value ()); 944 settings->setValue (cs_font_size.key, terminal_fontSize->value ());
941 settings->setValue (cs_font.key, terminal_fontName->currentFont ().family ()); 945 settings->setValue (cs_font.key, terminal_fontName->currentFont ().family ());
942 946