Olive
preferencesdialog.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef PREFERENCESDIALOG_H
22 #define PREFERENCESDIALOG_H
23 
24 #include <QDialog>
25 #include <QKeySequenceEdit>
26 class QMenuBar;
27 class QLineEdit;
28 class QComboBox;
29 class QRadioButton;
30 class QTreeWidget;
31 class QTreeWidgetItem;
32 class QMenu;
33 class QCheckBox;
34 class QDoubleSpinBox;
35 class QSpinBox;
36 
37 class KeySequenceEditor : public QKeySequenceEdit {
38  Q_OBJECT
39 public:
40  KeySequenceEditor(QWidget *parent, QAction* a);
41  void set_action_shortcut();
42  void reset_to_default();
43  QString action_name();
44  QString export_shortcut();
45 private:
46  QAction* action;
47 };
48 
49 class PreferencesDialog : public QDialog
50 {
51  Q_OBJECT
52 
53 public:
54  explicit PreferencesDialog(QWidget *parent = nullptr);
56 
57  void setup_kbd_shortcuts(QMenuBar* menu);
58 
59 private slots:
60  void save();
61  void reset_default_shortcut();
62  void reset_all_shortcuts();
63  bool refine_shortcut_list(const QString &, QTreeWidgetItem* parent = nullptr);
64  void load_shortcut_file();
65  void save_shortcut_file();
66  void browse_css_file();
67  void delete_all_previews();
68 
69 private:
70  void setup_ui();
71  void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
72 
73  // used to delete previews
74  // type can be: 't' for thumbnails, 'w' for waveforms, or 1 for all
75  void delete_previews(char type);
76 
77  QLineEdit* custom_css_fn;
78  QLineEdit* imgSeqFormatEdit;
79  QComboBox* recordingComboBox;
80  QRadioButton* accurateSeekButton;
81  QRadioButton* fastSeekButton;
82  QTreeWidget* keyboard_tree;
83  QDoubleSpinBox* upcoming_queue_spinbox;
84  QComboBox* upcoming_queue_type;
85  QDoubleSpinBox* previous_queue_spinbox;
86  QComboBox* previous_queue_type;
87  QSpinBox* effect_textbox_lines_field;
88  QCheckBox* use_software_fallbacks_checkbox;
89  QComboBox* audio_output_devices;
90  QComboBox* audio_input_devices;
91  QComboBox* audio_sample_rate;
92  QComboBox* language_combobox;
93  QSpinBox* thumbnail_res_spinbox;
94  QSpinBox* waveform_res_spinbox;
95  QCheckBox* add_default_effects_to_clips;
96 
97  QVector<QAction*> key_shortcut_actions;
98  QVector<QTreeWidgetItem*> key_shortcut_items;
99  QVector<KeySequenceEditor*> key_shortcut_fields;
100 };
101 
102 #endif // PREFERENCESDIALOG_H
Definition: preferencesdialog.h:37
Definition: preferencesdialog.h:49