#include "resource-manager.h"
Public Member Functions | |
resource_manager (const resource_manager &)=delete | |
resource_manager (void) | |
~resource_manager () | |
void | combo_encoding (QComboBox *combo, const QString ¤t=QString()) |
void | config_icon_theme (void) |
void | config_translators (QTranslator *qt_tr, QTranslator *qsci_tr, QTranslator *gui_tr) |
QPointer< QTemporaryFile > | create_tmp_file (const QString &extension=QString(), const QString &contents=QString()) |
void | get_codecs (QStringList *codecs) |
QStringList | get_default_font (void) |
QString | get_default_font_family (void) |
gui_settings * | get_default_settings (void) const |
QString | get_gui_translation_dir (void) |
gui_settings * | get_settings (void) const |
QString | get_settings_directory (void) |
QString | get_settings_file (void) |
int | get_valid_lexer_styles (QsciLexer *lexer, int *styles) |
QIcon | icon (const QString &icon_name, bool octave_only=false, const QString &icon_alt_name=QString()) |
bool | is_first_run (void) const |
resource_manager & | operator= (const resource_manager &)=delete |
void | read_lexer_settings (QsciLexer *lexer, gui_settings *settings, int mode=0, int def=0) |
void | reload_settings (void) |
void | remove_tmp_file (QPointer< QTemporaryFile > tmp_file) |
void | set_settings (const QString &file) |
void | update_network_settings (void) |
bool | update_settings_key (const QString &new_key, const QString &old_key) |
Private Member Functions | |
QFont | copy_font_attributes (const QFont &attr, const QFont &base) const |
Private Attributes | |
gui_settings * | m_default_settings |
QStringList | m_icon_fallbacks |
gui_settings * | m_settings |
QString | m_settings_directory |
QString | m_settings_file |
QList< QTemporaryFile * > | m_temporary_files |
Definition at line 42 of file resource-manager.h.
resource_manager::resource_manager | ( | void | ) |
Definition at line 66 of file resource-manager.cc.
References gui_settings::value().
|
delete |
resource_manager::~resource_manager | ( | void | ) |
Definition at line 120 of file resource-manager.cc.
References m_default_settings, m_settings, m_temporary_files, and remove_tmp_file().
void resource_manager::combo_encoding | ( | QComboBox * | combo, |
const QString & | current = QString () |
||
) |
Definition at line 698 of file resource-manager.cc.
References gui_pref::def, ed_default_enc(), get_codecs(), m_settings, octave_locale_charset_wrapper(), and gui_settings::value().
Referenced by settings_dialog::settings_dialog(), and file_editor_tab::handle_decode_warning_answer().
void resource_manager::config_icon_theme | ( | void | ) |
Definition at line 186 of file resource-manager.cc.
References gui_pref::def, global_all_icon_themes, global_icon_paths, global_icon_theme(), global_icon_theme_index(), ICON_THEME_CURSORS, ICON_THEME_OCTAVE, ICON_THEME_SYSTEM, ICON_THEME_TANGO, gui_pref::key, m_icon_fallbacks, m_settings, and gui_settings::value().
Referenced by base_qobject::base_qobject(), and main_window::main_window().
void resource_manager::config_translators | ( | QTranslator * | qt_tr, |
QTranslator * | qsci_tr, | ||
QTranslator * | gui_tr | ||
) |
Definition at line 138 of file resource-manager.cc.
References gui_pref::def, get_gui_translation_dir(), global_language(), gui_pref::key, m_settings, system(), and gui_settings::value().
Referenced by main_window::main_window(), and base_qobject::config_translators().
|
private |
Copys the attributes bold, italic and underline from QFont attr
to the font base
and returns the result without changing base
,
attr | QFont with the desired attributes |
base | QFont with desired family and size |
Definition at line 411 of file resource-manager.cc.
Referenced by read_lexer_settings().
QPointer< QTemporaryFile > resource_manager::create_tmp_file | ( | const QString & | extension = QString () , |
const QString & | contents = QString () |
||
) |
Definition at line 757 of file resource-manager.cc.
References Utils::fromStdString(), get_temp_directory(), and m_temporary_files.
Referenced by octave_qscintilla::contextmenu_run().
void resource_manager::get_codecs | ( | QStringList * | codecs | ) |
Definition at line 677 of file resource-manager.cc.
References octave_locale_charset_wrapper().
Referenced by combo_encoding().
QStringList resource_manager::get_default_font | ( | void | ) |
Definition at line 323 of file resource-manager.cc.
References floor(), Utils::fromStdString(), and get_default_font_family().
Referenced by read_lexer_settings(), and reload_settings().
QString resource_manager::get_default_font_family | ( | void | ) |
Definition at line 278 of file resource-manager.cc.
References gui_pref::def, Utils::fromStdString(), and global_mono_font().
Referenced by get_default_font(), and reload_settings().
gui_settings * resource_manager::get_default_settings | ( | void | ) | const |
Definition at line 250 of file resource-manager.cc.
References m_default_settings.
QString resource_manager::get_gui_translation_dir | ( | void | ) |
Definition at line 129 of file resource-manager.cc.
References Utils::fromStdString(), and oct_locale_dir().
Referenced by settings_dialog::settings_dialog(), and config_translators().
gui_settings * resource_manager::get_settings | ( | void | ) | const |
Definition at line 232 of file resource-manager.cc.
References m_settings.
Referenced by documentation::documentation(), documentation_bookmarks::documentation_bookmarks(), dw_main_window::dw_main_window(), file_editor_tab::file_editor_tab(), FileDialog::FileDialog(), files_dock_widget::files_dock_widget(), find_files_dialog::find_files_dialog(), main_window::main_window(), octave_dock_widget::octave_dock_widget(), release_notes::release_notes(), set_path_dialog::set_path_dialog(), settings_dialog::settings_dialog(), terminal_dock_widget::terminal_dock_widget(), workspace_view::workspace_view(), welcome_wizard::accept(), find_files_dialog::browse_folders(), main_window::browse_for_directory(), settings_dialog::button_clicked(), file_editor::call_custom_editor(), file_editor::closeEvent(), octave_qscintilla::comment_string(), main_window::confirm_shutdown(), community_news::construct(), history_dock_widget::construct(), file_editor::construct(), octave_qscintilla::contextmenu_run(), octave_qscintilla::ctx_menu_run_finished(), file_editor_tab::detect_eol_mode(), files_dock_widget::display_directory(), file_editor_tab::do_comment_selected_text(), main_window::do_reset_windows(), variable_editor_stack::do_save(), file_editor_tab::do_save_file(), variable_editor::edit_variable(), file_editor::empty_script(), external_editor_interface::external_editor(), main_window::focus_console_after_command(), settings_dialog::get_dir(), file_editor::handle_enter_debug_mode(), main_window::handle_load_workspace_request(), main_window::handle_octave_ready(), main_window::handle_save_workspace_request(), file_editor::handle_visibility(), workspace_view::header_contextmenu_requested(), files_dock_widget::headercontextmenu_requested(), shortcut_manager::import_export(), shortcut_manager::init(), shortcut_manager::init_data(), file_editor_tab::load_file(), octave_dock_widget::make_widget(), file_editor::mru_menu_update(), file_editor_tab::new_file(), files_dock_widget::popdownmenu_search_dir(), news_reader::process(), qt_interpreter_events::prompt_new_edit_file(), main_window::read_settings(), main_window::request_new_function(), file_editor::request_open_file(), main_window::request_open_file(), main_window::request_reload_settings(), main_window::restore_create_file_setting(), find_dialog::restore_settings(), file_editor_tab::save_file_as(), file_editor::save_session(), find_dialog::save_settings(), documentation::save_settings(), files_dock_widget::save_settings(), find_files_dialog::save_settings(), history_dock_widget::save_settings(), octave_dock_widget::save_settings(), set_path_dialog::save_settings(), workspace_view::save_settings(), shortcut_manager::set_shortcut(), workspace_view::setModel(), shortcut_manager::shortcut(), settings_dialog::show_tab(), files_dock_widget::toggle_header(), workspace_view::toggle_header(), file_editor::toggle_preference(), settings_dialog::update_editor_lexers(), file_editor_tab::update_lexer_settings(), settings_dialog::update_terminal_colors(), settings_dialog::update_varedit_colors(), settings_dialog::update_workspace_colors(), settings_dialog::write_changed_settings(), and main_window::write_settings().
QString resource_manager::get_settings_directory | ( | void | ) |
Definition at line 268 of file resource-manager.cc.
References m_settings_directory.
Referenced by set_settings().
QString resource_manager::get_settings_file | ( | void | ) |
Definition at line 273 of file resource-manager.cc.
References m_settings_file.
Referenced by initial_page::initial_page(), and set_settings().
int resource_manager::get_valid_lexer_styles | ( | QsciLexer * | lexer, |
int * | styles | ||
) |
Definition at line 397 of file resource-manager.cc.
References ed_max_lexer_styles, and ed_max_style_number.
Referenced by settings_dialog::get_lexer_settings(), read_lexer_settings(), settings_dialog::update_lexer(), and settings_dialog::write_lexer_settings().
QIcon resource_manager::icon | ( | const QString & | icon_name, |
bool | octave_only = false , |
||
const QString & | icon_alt_name = QString () |
||
) |
Definition at line 654 of file resource-manager.cc.
References global_icon_paths, ICON_THEME_OCTAVE, and m_icon_fallbacks.
Referenced by documentation::documentation(), dw_main_window::dw_main_window(), files_dock_widget::files_dock_widget(), find_files_dialog::find_files_dialog(), label_dock_widget::label_dock_widget(), variable_editor_view::add_edit_actions(), variable_dock_widget::change_floating(), variable_dock_widget::change_fullscreen(), file_editor::construct(), main_window::construct_debug_menu_item(), main_window::construct_edit_menu(), main_window::construct_file_menu(), main_window::construct_new_menu(), documentation::construct_tool_bar(), main_window::construct_tool_bar(), variable_editor::construct_tool_bar(), files_dock_widget::contextmenu_requested(), documentation_bookmarks::ctx_menu(), history_dock_widget::ctxMenu(), qt_interpreter_events::get_named_icon_slot(), file_editor::handle_file_name_changed(), octave_dock_widget::make_widget(), octave_dock_widget::make_window(), and octave_dock_widget::set_style().
bool resource_manager::is_first_run | ( | void | ) | const |
Definition at line 541 of file resource-manager.cc.
References m_settings_file.
Referenced by main_window::main_window().
|
delete |
void resource_manager::read_lexer_settings | ( | QsciLexer * | lexer, |
gui_settings * | settings, | ||
int | mode = 0 , |
||
int | def = 0 |
||
) |
Definition at line 424 of file resource-manager.cc.
References copy_font_attributes(), ed_max_lexer_styles, get_default_font(), get_valid_lexer_styles(), m, settings_color_modes_ext(), and settings_reload_default_colors_flag.
Referenced by settings_dialog::update_lexer(), and file_editor_tab::update_lexer_settings().
void resource_manager::reload_settings | ( | void | ) |
Definition at line 353 of file resource-manager.cc.
References cs_font(), cs_font_size(), Utils::fromStdString(), get_default_font(), get_default_font_family(), global_custom_editor(), global_mono_font(), gui_pref::key, m_settings, m_settings_file, and set_settings().
Referenced by base_qobject::base_qobject(), main_window::main_window(), and welcome_wizard::accept().
void resource_manager::remove_tmp_file | ( | QPointer< QTemporaryFile > | tmp_file | ) |
Definition at line 783 of file resource-manager.cc.
References m_temporary_files.
Referenced by ~resource_manager(), and octave_qscintilla::ctx_menu_run_finished().
void resource_manager::set_settings | ( | const QString & | file | ) |
Definition at line 495 of file resource-manager.cc.
References get_settings_directory(), get_settings_file(), and m_settings.
Referenced by reload_settings().
void resource_manager::update_network_settings | ( | void | ) |
Definition at line 546 of file resource-manager.cc.
References gui_pref::def, Utils::fromStdString(), global_proxy_all_types, global_proxy_host(), global_proxy_pass(), global_proxy_port(), global_proxy_type(), global_proxy_user(), global_use_proxy(), gui_pref::key, m_settings, and gui_settings::value().
Referenced by main_window::main_window(), and main_window::notice_settings().
bool resource_manager::update_settings_key | ( | const QString & | new_key, |
const QString & | old_key | ||
) |
Definition at line 527 of file resource-manager.cc.
References m_settings, and gui_settings::value().
Referenced by octave_dock_widget::set_focus_predecessor().
|
private |
Definition at line 124 of file resource-manager.h.
Referenced by ~resource_manager(), and get_default_settings().
|
private |
Definition at line 128 of file resource-manager.h.
Referenced by config_icon_theme(), and icon().
|
private |
Definition at line 122 of file resource-manager.h.
Referenced by ~resource_manager(), combo_encoding(), config_icon_theme(), config_translators(), get_settings(), reload_settings(), set_settings(), update_network_settings(), and update_settings_key().
|
private |
Definition at line 118 of file resource-manager.h.
Referenced by get_settings_directory().
|
private |
Definition at line 120 of file resource-manager.h.
Referenced by get_settings_file(), is_first_run(), and reload_settings().
|
private |
Definition at line 126 of file resource-manager.h.
Referenced by ~resource_manager(), create_tmp_file(), and remove_tmp_file().