started documentation of preferencesdialog

This commit is contained in:
itsmattkc
2019-03-21 23:38:34 +11:00
parent 9b29758b7f
commit f6a4e2c5d7
3 changed files with 32 additions and 18 deletions
+2 -2
View File
@@ -87,9 +87,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
fastSeekButton->setChecked(olive::CurrentConfig.fast_seeking);
recordingComboBox->setCurrentIndex(olive::CurrentConfig.recording_mode - 1);
imgSeqFormatEdit->setText(olive::CurrentConfig.img_seq_formats);
}
PreferencesDialog::~PreferencesDialog() {}
setup_kbd_shortcuts(olive::MainWindow->menuBar());
}
void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent) {
QList<QAction*> actions = menu->actions();
+30 -15
View File
@@ -36,30 +36,32 @@
#include "timeline/sequence.h"
class KeySequenceEditor : public QKeySequenceEdit {
Q_OBJECT
public:
KeySequenceEditor(QWidget *parent, QAction* a);
void set_action_shortcut();
void reset_to_default();
QString action_name();
QString export_shortcut();
private:
QAction* action;
};
class KeySequenceEditor;
/**
* @brief The PreferencesDialog class
*
* A dialog for the global application settings. Mostly an interface for Config.
*/
class PreferencesDialog : public QDialog
{
Q_OBJECT
public:
/**
* @brief PreferencesDialog Constructor
*
* @param parent
*
* QWidget parent. Usually MainWindow.
*/
explicit PreferencesDialog(QWidget *parent = nullptr);
~PreferencesDialog();
void setup_kbd_shortcuts(QMenuBar* menu);
private slots:
void save();
/**
* @brief Override of accept to save preferences to Config.
*/
virtual void accept() override;
void reset_default_shortcut();
void reset_all_shortcuts();
bool refine_shortcut_list(const QString &, QTreeWidgetItem* parent = nullptr);
@@ -70,6 +72,7 @@ private slots:
private:
void setup_ui();
void setup_kbd_shortcuts(QMenuBar* menu);
void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
// used to delete previews
@@ -113,4 +116,16 @@ private:
QVector<KeySequenceEditor*> key_shortcut_fields;
};
class KeySequenceEditor : public QKeySequenceEdit {
Q_OBJECT
public:
KeySequenceEditor(QWidget *parent, QAction* a);
void set_action_shortcut();
void reset_to_default();
QString action_name();
QString export_shortcut();
private:
QAction* action;
};
#endif // PREFERENCESDIALOG_H
-1
View File
@@ -344,7 +344,6 @@ void OliveGlobal::open_preferences() {
panel_footage_viewer->pause();
PreferencesDialog pd(olive::MainWindow);
pd.setup_kbd_shortcuts(olive::MainWindow->menuBar());
pd.exec();
}