Olive
preferencesdialog.h
1 #ifndef PREFERENCESDIALOG_H
2 #define PREFERENCESDIALOG_H
3 
4 #include <QDialog>
5 #include <QKeySequenceEdit>
6 class QMenuBar;
7 class QLineEdit;
8 class QComboBox;
9 class QRadioButton;
10 class QTreeWidget;
11 class QTreeWidgetItem;
12 class QMenu;
13 class QCheckBox;
14 class QDoubleSpinBox;
15 class QSpinBox;
16 
17 class KeySequenceEditor : public QKeySequenceEdit {
18  Q_OBJECT
19 public:
20  KeySequenceEditor(QWidget *parent, QAction* a);
21  void set_action_shortcut();
22  void reset_to_default();
23  QString action_name();
24  QString export_shortcut();
25 private:
26  QAction* action;
27 };
28 
29 class PreferencesDialog : public QDialog
30 {
31  Q_OBJECT
32 
33 public:
34  explicit PreferencesDialog(QWidget *parent = nullptr);
36 
37  void setup_kbd_shortcuts(QMenuBar* menu);
38 
39 private slots:
40  void save();
41  void reset_default_shortcut();
42  void reset_all_shortcuts();
43  bool refine_shortcut_list(const QString &, QTreeWidgetItem* parent = nullptr);
44  void load_shortcut_file();
45  void save_shortcut_file();
46  void browse_css_file();
47  void delete_all_previews();
48 
49 private:
50  void setup_ui();
51  void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
52 
53  // used to delete previews
54  // type can be: 't' for thumbnails, 'w' for waveforms, or 1 for all
55  void delete_previews(char type);
56 
57  QLineEdit* custom_css_fn;
58  QLineEdit* imgSeqFormatEdit;
59  QComboBox* recordingComboBox;
60  QRadioButton* accurateSeekButton;
61  QRadioButton* fastSeekButton;
62  QTreeWidget* keyboard_tree;
63  QDoubleSpinBox* upcoming_queue_spinbox;
64  QComboBox* upcoming_queue_type;
65  QDoubleSpinBox* previous_queue_spinbox;
66  QComboBox* previous_queue_type;
67  QSpinBox* effect_textbox_lines_field;
68  QCheckBox* use_software_fallbacks_checkbox;
69  QComboBox* audio_output_devices;
70  QComboBox* audio_input_devices;
71  QComboBox* audio_sample_rate;
72  QComboBox* language_combobox;
73  QSpinBox* thumbnail_res_spinbox;
74  QSpinBox* waveform_res_spinbox;
75 
76  QVector<QAction*> key_shortcut_actions;
77  QVector<QTreeWidgetItem*> key_shortcut_items;
78  QVector<KeySequenceEditor*> key_shortcut_fields;
79 };
80 
81 #endif // PREFERENCESDIALOG_H
Definition: preferencesdialog.h:17
Definition: preferencesdialog.h:29