The PreferencesDialog class.
More...
#include <preferencesdialog.h>
The PreferencesDialog class.
A dialog for the global application settings. Mostly an interface for Config. Can be loaded from any part of the application.
PreferencesDialog::PreferencesDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
void PreferencesDialog::accept |
( |
| ) |
|
|
overrideprivatevirtualslot |
Override of accept to save preferences to Config.
void PreferencesDialog::AddBoolPair |
( |
QCheckBox * |
ui, |
|
|
bool * |
value, |
|
|
bool |
restart_required = false |
|
) |
| |
|
private |
Add an automated QCheckBox+boolean value pair.
Many preferences are simple true/false (or on/off) options. Rather than adding a QCheckBox for each one and manually setting its checked value to the configuration setting (and vice versa when saving), this convenience function will add it to an automated set of checkboxes, automatically setting the checked state to the current setting, and then saving the new checked state back to the setting when the user accepts the changes (clicks OK).
- Parameters
-
ui | A valid QCheckBox item. This function does not take ownership of the QWidget or place it in a layout anywhere. |
value | A pointer to the Boolean value this QCheckBox should be shared with. The QCheckBox widget's checked state will be set to the value of this pointer. |
restart_required | Defaults to FALSE, set this to TRUE if changing this setting should prompt the user for a restart of Olive before the setting change takes effect. |
void PreferencesDialog::browse_css_file |
( |
| ) |
|
|
privateslot |
Show a file dialog to browse for an external CSS file to load for styling the application.
void PreferencesDialog::delete_all_previews |
( |
| ) |
|
|
privateslot |
Delete all previews (waveform and thumbnail cache)
void PreferencesDialog::delete_previews |
( |
char |
type | ) |
|
|
private |
Delete disk cached preview files (thumbnails, waveforms, etc.)
- Parameters
-
type | The types of previews to |
void PreferencesDialog::edit_default_sequence_settings |
( |
| ) |
|
|
privateslot |
void PreferencesDialog::load_shortcut_file |
( |
| ) |
|
|
privateslot |
Show a file dialog to load an external shortcut preset from file.
bool PreferencesDialog::refine_shortcut_list |
( |
const QString & |
s, |
|
|
QTreeWidgetItem * |
parent = nullptr |
|
) |
| |
|
privateslot |
Shows/hides shortcut entries according to a shortcut query.
This function can be directly connected to QLineEdit::textChanged() for simplicity.
- Parameters
-
s | The search query to compare shortcut names to. |
parent | This is used as the function calls itself recursively to traverse the menu item hierarchy. This should be left as nullptr when called externally. |
- Returns
Value used as function calls itself recursively to determine if a menu parent has any children that are not hidden. If so, TRUE is returned so the parent is shown too (even if it doesn't match the search query). If not, FALSE is returned so the parent is hidden.
void PreferencesDialog::reset_all_shortcuts |
( |
| ) |
|
|
privateslot |
Reset all shortcuts indiscriminately to their defaults.
This is safe to call directly as it'll ask the user if they wish to do so before it resets.
void PreferencesDialog::reset_default_shortcut |
( |
| ) |
|
|
privateslot |
Reset all selected shortcuts in keyboard_tree to their defaults.
void PreferencesDialog::save_shortcut_file |
( |
| ) |
|
|
privateslot |
Show a file dialog to save an external shortcut preset from file.
void PreferencesDialog::setup_kbd_shortcut_worker |
( |
QMenu * |
menu, |
|
|
QTreeWidgetItem * |
parent |
|
) |
| |
|
private |
Internal function called by setup_kbd_shortcuts() to traverse down the menu bar's hierarchy and populate the shortcut panel.
This function will call itself recursively as it finds submenus belong to the menu provided. It will also create QTreeWidgetItems as children of the parent item provided, either using them as parents themselves for submenus or attaching a KeySequenceEditor to them for shortcut editing.
- Parameters
-
menu | The current menu to traverse down. |
parent | The parent item to add QTreeWidgetItems to. |
void PreferencesDialog::setup_kbd_shortcuts |
( |
QMenuBar * |
menu | ) |
|
|
private |
Populate keyboard shortcut panel with keyboard shortcuts from the menu bar.
- Parameters
-
menu | A reference to the main application's menu bar. Usually MainWindow::menuBar(). |
void PreferencesDialog::setup_ui |
( |
| ) |
|
|
private |
Create and arrange all UI widgets.
QComboBox* PreferencesDialog::audio_input_devices |
|
private |
UI widget for selecting the input audio device.
QComboBox* PreferencesDialog::audio_output_devices |
|
private |
UI widget for selecting the output audio device.
QComboBox* PreferencesDialog::audio_sample_rate |
|
private |
UI widget for selecting the audio sampling rates.
QVector<bool> PreferencesDialog::bool_restart_required |
|
private |
Internal array managed by AddBoolPair(). Do not access this directly.
QVector<QCheckBox*> PreferencesDialog::bool_ui |
|
private |
Internal array managed by AddBoolPair(). Do not access this directly.
QVector<bool*> PreferencesDialog::bool_value |
|
private |
Internal array managed by AddBoolPair(). Do not access this directly.
QLineEdit* PreferencesDialog::custom_css_fn |
|
private |
UI widget for editing the CSS filename.
Sequence PreferencesDialog::default_sequence |
|
private |
QSpinBox* PreferencesDialog::effect_textbox_lines_field |
|
private |
UI widget for editing the size of textboxes in the EffectControls panel.
QLineEdit* PreferencesDialog::imgSeqFormatEdit |
|
private |
UI widget for editing the list of extensions to detect image sequences from.
QVector<QAction*> PreferencesDialog::key_shortcut_actions |
|
private |
List of keyboard shortcut actions that can be triggered (links with key_shortcut_items and key_shortcut_fields)
List of keyboard shortcut editing fields in keyboard_tree corresponding to existing actions (links with key_shortcut_actions and key_shortcut_fields)
QVector<QTreeWidgetItem*> PreferencesDialog::key_shortcut_items |
|
private |
List of keyboard shortcut items in keyboard_tree corresponding to existing actions (links with key_shortcut_actions and key_shortcut_fields)
QTreeWidget* PreferencesDialog::keyboard_tree |
|
private |
UI widget for editing keyboard shortcuts.
QComboBox* PreferencesDialog::language_combobox |
|
private |
UI widget for selecting the UI language.
QDoubleSpinBox* PreferencesDialog::previous_queue_spinbox |
|
private |
UI widget for editing the previous queue size.
QComboBox* PreferencesDialog::previous_queue_type |
|
private |
UI widget for editing the previous queue type.
QComboBox* PreferencesDialog::recordingComboBox |
|
private |
UI widget for editing the recording channels.
QSpinBox* PreferencesDialog::thumbnail_res_spinbox |
|
private |
UI widget for selecting the resolution of the thumbnails to generate.
QComboBox* PreferencesDialog::ui_style |
|
private |
UI widget for selecting the current UI style.
QDoubleSpinBox* PreferencesDialog::upcoming_queue_spinbox |
|
private |
UI widget for editing the upcoming queue size.
QComboBox* PreferencesDialog::upcoming_queue_type |
|
private |
UI widget for editing the upcoming queue type.
QSpinBox* PreferencesDialog::waveform_res_spinbox |
|
private |
UI widget for selecting the resolution of the waveforms to generate.
The documentation for this class was generated from the following files: