started documentation of preferencesdialog
This commit is contained in:
@@ -87,9 +87,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
|||||||
fastSeekButton->setChecked(olive::CurrentConfig.fast_seeking);
|
fastSeekButton->setChecked(olive::CurrentConfig.fast_seeking);
|
||||||
recordingComboBox->setCurrentIndex(olive::CurrentConfig.recording_mode - 1);
|
recordingComboBox->setCurrentIndex(olive::CurrentConfig.recording_mode - 1);
|
||||||
imgSeqFormatEdit->setText(olive::CurrentConfig.img_seq_formats);
|
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) {
|
void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent) {
|
||||||
QList<QAction*> actions = menu->actions();
|
QList<QAction*> actions = menu->actions();
|
||||||
|
|||||||
+30
-15
@@ -36,30 +36,32 @@
|
|||||||
|
|
||||||
#include "timeline/sequence.h"
|
#include "timeline/sequence.h"
|
||||||
|
|
||||||
class KeySequenceEditor : public QKeySequenceEdit {
|
class KeySequenceEditor;
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The PreferencesDialog class
|
||||||
|
*
|
||||||
|
* A dialog for the global application settings. Mostly an interface for Config.
|
||||||
|
*/
|
||||||
class PreferencesDialog : public QDialog
|
class PreferencesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief PreferencesDialog Constructor
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
*
|
||||||
|
* QWidget parent. Usually MainWindow.
|
||||||
|
*/
|
||||||
explicit PreferencesDialog(QWidget *parent = nullptr);
|
explicit PreferencesDialog(QWidget *parent = nullptr);
|
||||||
~PreferencesDialog();
|
|
||||||
|
|
||||||
void setup_kbd_shortcuts(QMenuBar* menu);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void save();
|
/**
|
||||||
|
* @brief Override of accept to save preferences to Config.
|
||||||
|
*/
|
||||||
|
virtual void accept() override;
|
||||||
void reset_default_shortcut();
|
void reset_default_shortcut();
|
||||||
void reset_all_shortcuts();
|
void reset_all_shortcuts();
|
||||||
bool refine_shortcut_list(const QString &, QTreeWidgetItem* parent = nullptr);
|
bool refine_shortcut_list(const QString &, QTreeWidgetItem* parent = nullptr);
|
||||||
@@ -70,6 +72,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void setup_ui();
|
void setup_ui();
|
||||||
|
void setup_kbd_shortcuts(QMenuBar* menu);
|
||||||
void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
|
void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
|
||||||
|
|
||||||
// used to delete previews
|
// used to delete previews
|
||||||
@@ -113,4 +116,16 @@ private:
|
|||||||
QVector<KeySequenceEditor*> key_shortcut_fields;
|
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
|
#endif // PREFERENCESDIALOG_H
|
||||||
|
|||||||
@@ -344,7 +344,6 @@ void OliveGlobal::open_preferences() {
|
|||||||
panel_footage_viewer->pause();
|
panel_footage_viewer->pause();
|
||||||
|
|
||||||
PreferencesDialog pd(olive::MainWindow);
|
PreferencesDialog pd(olive::MainWindow);
|
||||||
pd.setup_kbd_shortcuts(olive::MainWindow->menuBar());
|
|
||||||
pd.exec();
|
pd.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user