style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -31,31 +31,31 @@ namespace olive
|
||||
|
||||
KeySequenceEditor::KeySequenceEditor(QWidget *parent, QAction *a)
|
||||
: super(parent)
|
||||
, action(a)
|
||||
, action_(a)
|
||||
{
|
||||
setKeySequence(action->shortcut());
|
||||
setKeySequence(action_->shortcut());
|
||||
}
|
||||
|
||||
void KeySequenceEditor::set_action_shortcut()
|
||||
{
|
||||
action->setShortcut(keySequence());
|
||||
action_->setShortcut(keySequence());
|
||||
}
|
||||
|
||||
void KeySequenceEditor::reset_to_default()
|
||||
{
|
||||
setKeySequence(action->property("keydefault").toString());
|
||||
setKeySequence(action_->property("keydefault").toString());
|
||||
}
|
||||
|
||||
QString KeySequenceEditor::action_name()
|
||||
{
|
||||
return action->property("id").toString();
|
||||
return action_->property("id").toString();
|
||||
}
|
||||
|
||||
QString KeySequenceEditor::export_shortcut()
|
||||
{
|
||||
QKeySequence ks = keySequence();
|
||||
if (ks != action->property("keydefault").value<QKeySequence>()) {
|
||||
return action->property("id").toString() + "\t" + ks.toString();
|
||||
if (ks != action_->property("keydefault").value<QKeySequence>()) {
|
||||
return action_->property("id").toString() + "\t" + ks.toString();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef KEYSEQUENCEEDITOR_H
|
||||
#define KEYSEQUENCEEDITOR_H
|
||||
#ifndef OAK_KEYSEQUENCEEDITOR_H
|
||||
#define OAK_KEYSEQUENCEEDITOR_H
|
||||
|
||||
#include <QKeySequenceEdit>
|
||||
|
||||
@@ -106,9 +106,9 @@ private:
|
||||
/**
|
||||
* @brief Internal reference to the linked QAction
|
||||
*/
|
||||
QAction *action;
|
||||
QAction *action_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // KEYSEQUENCEEDITOR_H
|
||||
#endif // OAK_KEYSEQUENCEEDITOR_H
|
||||
|
||||
@@ -44,32 +44,32 @@ PreferencesDialog::PreferencesDialog(MainWindow *main_window, int start_tab)
|
||||
{
|
||||
setWindowTitle(tr("Preferences"));
|
||||
|
||||
AddTab(new PreferencesGeneralTab(), tr("General"));
|
||||
AddTab(new PreferencesAppearanceTab(), tr("Appearance"));
|
||||
AddTab(new PreferencesAudioTab(), tr("Audio"));
|
||||
AddTab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryTimeline),
|
||||
add_tab(new PreferencesGeneralTab(), tr("General"));
|
||||
add_tab(new PreferencesAppearanceTab(), tr("Appearance"));
|
||||
add_tab(new PreferencesAudioTab(), tr("Audio"));
|
||||
add_tab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::k_category_timeline),
|
||||
tr("Timeline"));
|
||||
AddTab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryPlayback),
|
||||
add_tab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::k_category_playback),
|
||||
tr("Playback"));
|
||||
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryProject),
|
||||
add_tab(new PreferencesBehaviorTab(PreferencesBehaviorTab::k_category_project),
|
||||
tr("Project"));
|
||||
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryNodes),
|
||||
add_tab(new PreferencesBehaviorTab(PreferencesBehaviorTab::k_category_nodes),
|
||||
tr("Nodes"));
|
||||
AddTab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryRendering),
|
||||
add_tab(
|
||||
new PreferencesBehaviorTab(PreferencesBehaviorTab::k_category_rendering),
|
||||
tr("Rendering"));
|
||||
AddTab(new PreferencesDiskTab(), tr("Disk"));
|
||||
AddTab(new PreferencesLutTab(), tr("LUT"));
|
||||
AddTab(new PreferencesKeyboardTab(main_window), tr("Keyboard"));
|
||||
add_tab(new PreferencesDiskTab(), tr("Disk"));
|
||||
add_tab(new PreferencesLutTab(), tr("LUT"));
|
||||
add_tab(new PreferencesKeyboardTab(main_window), tr("Keyboard"));
|
||||
|
||||
SetCurrentTab(start_tab);
|
||||
set_current_tab(start_tab);
|
||||
}
|
||||
|
||||
void PreferencesDialog::AcceptEvent()
|
||||
{
|
||||
Config::Save();
|
||||
Config::save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESDIALOG_H
|
||||
#define PREFERENCESDIALOG_H
|
||||
#ifndef OAK_PREFERENCESDIALOG_H
|
||||
#define OAK_PREFERENCESDIALOG_H
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialog>
|
||||
@@ -53,4 +53,4 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESDIALOG_H
|
||||
#endif // OAK_PREFERENCESDIALOG_H
|
||||
|
||||
@@ -52,7 +52,7 @@ PreferencesAppearanceTab::PreferencesAppearanceTab()
|
||||
for (i = themes.cbegin(); i != themes.cend(); i++) {
|
||||
style_combobox_->addItem(i.value(), i.key());
|
||||
|
||||
if (StyleManager::GetStyle() == i.key()) {
|
||||
if (StyleManager::get_style() == i.key()) {
|
||||
style_combobox_->setCurrentIndex(style_combobox_->count() - 1);
|
||||
}
|
||||
}
|
||||
@@ -68,14 +68,14 @@ PreferencesAppearanceTab::PreferencesAppearanceTab()
|
||||
|
||||
QGridLayout *color_layout = new QGridLayout(color_group);
|
||||
|
||||
for (int i = 0; i < Node::kCategoryCount; i++) {
|
||||
for (int i = 0; i < Node::k_category_count; i++) {
|
||||
QString cat_name =
|
||||
Node::GetCategoryName(static_cast<Node::CategoryID>(i));
|
||||
Node::get_category_name(static_cast<Node::CategoryID>(i));
|
||||
color_layout->addWidget(new QLabel(cat_name), i, 0);
|
||||
|
||||
ColorCodingComboBox *ccc = new ColorCodingComboBox();
|
||||
ccc->SetColor(
|
||||
OLIVE_CONFIG_STR(QStringLiteral("CatColor%1").arg(i)).toInt());
|
||||
ccc->set_color(
|
||||
OAK_CONFIG_STR(QStringLiteral("CatColor%1").arg(i)).toInt());
|
||||
color_layout->addWidget(ccc, i, 1);
|
||||
color_btns_.append(ccc);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ PreferencesAppearanceTab::PreferencesAppearanceTab()
|
||||
marker_layout->addWidget(new QLabel("Default Marker Color"), 0, 0);
|
||||
|
||||
marker_btn_ = new ColorCodingComboBox();
|
||||
marker_btn_->SetColor(OLIVE_CONFIG("MarkerColor").toInt());
|
||||
marker_btn_->set_color(OAK_CONFIG("MarkerColor").toInt());
|
||||
marker_layout->addWidget(marker_btn_, 0, 1);
|
||||
|
||||
appearance_layout->addWidget(marker_group, row, 0, 1, 2);
|
||||
@@ -102,23 +102,23 @@ PreferencesAppearanceTab::PreferencesAppearanceTab()
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void PreferencesAppearanceTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesAppearanceTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
QString style_path = style_combobox_->currentData().toString();
|
||||
|
||||
if (style_path != StyleManager::GetStyle()) {
|
||||
StyleManager::SetStyle(style_path);
|
||||
OLIVE_CONFIG("Style") = style_path;
|
||||
if (style_path != StyleManager::get_style()) {
|
||||
StyleManager::set_style(style_path);
|
||||
OAK_CONFIG("Style") = style_path;
|
||||
}
|
||||
|
||||
for (int i = 0; i < color_btns_.size(); i++) {
|
||||
OLIVE_CONFIG_STR(QStringLiteral("CatColor%1").arg(i)) =
|
||||
color_btns_.at(i)->GetSelectedColor();
|
||||
OAK_CONFIG_STR(QStringLiteral("CatColor%1").arg(i)) =
|
||||
color_btns_.at(i)->get_selected_color();
|
||||
}
|
||||
|
||||
OLIVE_CONFIG("MarkerColor") = marker_btn_->GetSelectedColor();
|
||||
OAK_CONFIG("MarkerColor") = marker_btn_->get_selected_color();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESAPPEARANCETAB_H
|
||||
#define PREFERENCESAPPEARANCETAB_H
|
||||
#ifndef OAK_PREFERENCESAPPEARANCETAB_H
|
||||
#define OAK_PREFERENCESAPPEARANCETAB_H
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
@@ -38,7 +38,7 @@ class PreferencesAppearanceTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesAppearanceTab();
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -53,4 +53,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESAPPEARANCETAB_H
|
||||
#endif // OAK_PREFERENCESAPPEARANCETAB_H
|
||||
|
||||
@@ -48,15 +48,15 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
connect(audio_backend_combobox_,
|
||||
static_cast<void (QComboBox::*)(int)>(
|
||||
&QComboBox::currentIndexChanged),
|
||||
this, &PreferencesAudioTab::RefreshDevices);
|
||||
this, &PreferencesAudioTab::refresh_devices);
|
||||
main_layout->addWidget(audio_backend_combobox_, row, 1);
|
||||
|
||||
audio_tab_layout->addLayout(main_layout);
|
||||
}
|
||||
|
||||
audio_scrubbing_ = new QCheckBox(
|
||||
PreferencesBehaviorTab::BehaviorPrefTr("Enable audio scrubbing"));
|
||||
audio_scrubbing_->setChecked(OLIVE_CONFIG("AudioScrubbing").toBool());
|
||||
PreferencesBehaviorTab::behavior_pref_tr("Enable audio scrubbing"));
|
||||
audio_scrubbing_->setChecked(OAK_CONFIG("AudioScrubbing").toBool());
|
||||
audio_tab_layout->addWidget(audio_scrubbing_);
|
||||
|
||||
{
|
||||
@@ -95,8 +95,8 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
output_row, 0);
|
||||
|
||||
output_rate_combo_ = new SampleRateComboBox();
|
||||
output_rate_combo_->SetSampleRate(
|
||||
OLIVE_CONFIG("AudioOutputSampleRate").toInt());
|
||||
output_rate_combo_->set_sample_rate(
|
||||
OAK_CONFIG("AudioOutputSampleRate").toInt());
|
||||
output_param_layout->addWidget(output_rate_combo_, output_row,
|
||||
1);
|
||||
|
||||
@@ -106,8 +106,8 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
new QLabel(tr("Channel Layout:")), output_row, 0);
|
||||
|
||||
output_ch_layout_combo_ = new ChannelLayoutComboBox();
|
||||
output_ch_layout_combo_->SetChannelLayout(
|
||||
OLIVE_CONFIG("AudioOutputChannelLayout").toULongLong());
|
||||
output_ch_layout_combo_->set_channel_layout(
|
||||
OAK_CONFIG("AudioOutputChannelLayout").toULongLong());
|
||||
output_param_layout->addWidget(output_ch_layout_combo_,
|
||||
output_row, 1);
|
||||
|
||||
@@ -117,9 +117,9 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
output_row, 0);
|
||||
|
||||
output_fmt_combo_ = new SampleFormatComboBox();
|
||||
output_fmt_combo_->SetPackedFormats();
|
||||
output_fmt_combo_->SetSampleFormat(SampleFormat::from_string(
|
||||
OLIVE_CONFIG("AudioOutputSampleFormat")
|
||||
output_fmt_combo_->set_packed_formats();
|
||||
output_fmt_combo_->set_sample_format(SampleFormat::from_string(
|
||||
OAK_CONFIG("AudioOutputSampleFormat")
|
||||
.toString()
|
||||
.toStdString()));
|
||||
output_param_layout->addWidget(output_fmt_combo_, output_row,
|
||||
@@ -154,32 +154,32 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
fmt_layout->addWidget(new QLabel(tr("Format:")));
|
||||
|
||||
record_format_combo_ =
|
||||
new ExportFormatComboBox(ExportFormatComboBox::kShowAudioOnly);
|
||||
new ExportFormatComboBox(ExportFormatComboBox::k_show_audio_only);
|
||||
record_format_combo_->setSizePolicy(QSizePolicy::Expanding,
|
||||
QSizePolicy::Expanding);
|
||||
record_format_combo_->SetFormat(static_cast<ExportFormat::Format>(
|
||||
OLIVE_CONFIG("AudioRecordingFormat").toInt()));
|
||||
record_format_combo_->set_format(static_cast<ExportFormat::Format>(
|
||||
OAK_CONFIG("AudioRecordingFormat").toInt()));
|
||||
fmt_layout->addWidget(record_format_combo_);
|
||||
|
||||
record_options_ = new ExportAudioTab();
|
||||
record_options_->SetFormat(record_format_combo_->GetFormat());
|
||||
record_options_->SetCodec(static_cast<ExportCodec::Codec>(
|
||||
OLIVE_CONFIG("AudioRecordingCodec").toInt()));
|
||||
record_options_->sample_rate_combobox()->SetSampleRate(
|
||||
OLIVE_CONFIG("AudioRecordingSampleRate").toInt());
|
||||
record_options_->channel_layout_combobox()->SetChannelLayout(
|
||||
OLIVE_CONFIG("AudioRecordingChannelLayout").toULongLong());
|
||||
record_options_->bit_rate_slider()->SetValue(
|
||||
OLIVE_CONFIG("AudioRecordingBitRate").toInt());
|
||||
record_options_->sample_format_combobox()->SetSampleFormat(
|
||||
record_options_->set_format(record_format_combo_->get_format());
|
||||
record_options_->set_codec(static_cast<ExportCodec::Codec>(
|
||||
OAK_CONFIG("AudioRecordingCodec").toInt()));
|
||||
record_options_->sample_rate_combobox()->set_sample_rate(
|
||||
OAK_CONFIG("AudioRecordingSampleRate").toInt());
|
||||
record_options_->channel_layout_combobox()->set_channel_layout(
|
||||
OAK_CONFIG("AudioRecordingChannelLayout").toULongLong());
|
||||
record_options_->bit_rate_slider()->set_value(
|
||||
OAK_CONFIG("AudioRecordingBitRate").toInt());
|
||||
record_options_->sample_format_combobox()->set_sample_format(
|
||||
SampleFormat::from_string(
|
||||
OLIVE_CONFIG("AudioRecordingSampleFormat")
|
||||
OAK_CONFIG("AudioRecordingSampleFormat")
|
||||
.toString()
|
||||
.toStdString()));
|
||||
recording_layout->addWidget(record_options_);
|
||||
|
||||
connect(record_format_combo_, &ExportFormatComboBox::FormatChanged,
|
||||
record_options_, &ExportAudioTab::SetFormat);
|
||||
connect(record_format_combo_, &ExportFormatComboBox::format_changed,
|
||||
record_options_, &ExportAudioTab::set_format);
|
||||
}
|
||||
|
||||
QHBoxLayout *refresh_layout = new QHBoxLayout();
|
||||
@@ -190,16 +190,16 @@ PreferencesAudioTab::PreferencesAudioTab()
|
||||
refresh_layout->addWidget(refresh_devices_btn_);
|
||||
|
||||
connect(refresh_devices_btn_, &QPushButton::clicked, this,
|
||||
&PreferencesAudioTab::HardRefreshBackends);
|
||||
&PreferencesAudioTab::hard_refresh_backends);
|
||||
}
|
||||
|
||||
audio_tab_layout->addStretch();
|
||||
|
||||
// Populate lists
|
||||
RefreshBackends();
|
||||
refresh_backends();
|
||||
}
|
||||
|
||||
void PreferencesAudioTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesAudioTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
@@ -210,38 +210,38 @@ void PreferencesAudioTab::Accept(MultiUndoCommand *command)
|
||||
audio_input_devices_->currentData().value<PaDeviceIndex>();
|
||||
|
||||
// Get device names, which seem to be the closest thing we have to a "unique identifier" for them
|
||||
OLIVE_CONFIG("AudioOutput") = audio_output_devices_->currentText();
|
||||
OLIVE_CONFIG("AudioInput") = audio_input_devices_->currentText();
|
||||
OAK_CONFIG("AudioOutput") = audio_output_devices_->currentText();
|
||||
OAK_CONFIG("AudioInput") = audio_input_devices_->currentText();
|
||||
|
||||
// Set devices to be used from now on
|
||||
AudioManager::instance()->SetOutputDevice(output_device);
|
||||
AudioManager::instance()->SetInputDevice(input_device);
|
||||
AudioManager::instance()->set_output_device(output_device);
|
||||
AudioManager::instance()->set_input_device(input_device);
|
||||
|
||||
OLIVE_CONFIG("AudioOutputSampleRate") = output_rate_combo_->GetSampleRate();
|
||||
OLIVE_CONFIG("AudioOutputChannelLayout") =
|
||||
QVariant::fromValue(output_ch_layout_combo_->GetChannelLayout());
|
||||
OLIVE_CONFIG("AudioOutputSampleFormat") = QString::fromStdString(
|
||||
output_fmt_combo_->GetSampleFormat().to_string());
|
||||
OAK_CONFIG("AudioOutputSampleRate") = output_rate_combo_->get_sample_rate();
|
||||
OAK_CONFIG("AudioOutputChannelLayout") =
|
||||
QVariant::fromValue(output_ch_layout_combo_->get_channel_layout());
|
||||
OAK_CONFIG("AudioOutputSampleFormat") = QString::fromStdString(
|
||||
output_fmt_combo_->get_sample_format().to_string());
|
||||
|
||||
OLIVE_CONFIG("AudioRecordingFormat") = record_format_combo_->GetFormat();
|
||||
OLIVE_CONFIG("AudioRecordingCodec") = record_options_->GetCodec();
|
||||
OLIVE_CONFIG("AudioRecordingSampleRate") =
|
||||
record_options_->sample_rate_combobox()->GetSampleRate();
|
||||
OLIVE_CONFIG("AudioRecordingChannelLayout") = QVariant::fromValue(
|
||||
record_options_->channel_layout_combobox()->GetChannelLayout());
|
||||
OLIVE_CONFIG("AudioRecordingBitRate") =
|
||||
QVariant::fromValue(record_options_->bit_rate_slider()->GetValue());
|
||||
OLIVE_CONFIG("AudioRecordingSampleFormat") =
|
||||
OAK_CONFIG("AudioRecordingFormat") = record_format_combo_->get_format();
|
||||
OAK_CONFIG("AudioRecordingCodec") = record_options_->get_codec();
|
||||
OAK_CONFIG("AudioRecordingSampleRate") =
|
||||
record_options_->sample_rate_combobox()->get_sample_rate();
|
||||
OAK_CONFIG("AudioRecordingChannelLayout") = QVariant::fromValue(
|
||||
record_options_->channel_layout_combobox()->get_channel_layout());
|
||||
OAK_CONFIG("AudioRecordingBitRate") =
|
||||
QVariant::fromValue(record_options_->bit_rate_slider()->get_value());
|
||||
OAK_CONFIG("AudioRecordingSampleFormat") =
|
||||
QString::fromStdString(record_options_->sample_format_combobox()
|
||||
->GetSampleFormat()
|
||||
->get_sample_format()
|
||||
.to_string());
|
||||
|
||||
emit AudioManager::instance() -> OutputParamsChanged();
|
||||
emit AudioManager::instance() -> output_params_changed();
|
||||
|
||||
OLIVE_CONFIG("AudioScrubbing") = audio_scrubbing_->isChecked();
|
||||
OAK_CONFIG("AudioScrubbing") = audio_scrubbing_->isChecked();
|
||||
}
|
||||
|
||||
void PreferencesAudioTab::RefreshBackends()
|
||||
void PreferencesAudioTab::refresh_backends()
|
||||
{
|
||||
audio_backend_combobox_->clear();
|
||||
for (PaHostApiIndex i = 0, end = Pa_GetHostApiCount(); i < end; i++) {
|
||||
@@ -250,12 +250,12 @@ void PreferencesAudioTab::RefreshBackends()
|
||||
audio_backend_combobox_->addItem(info->name);
|
||||
}
|
||||
|
||||
RefreshDevices();
|
||||
refresh_devices();
|
||||
|
||||
AttemptToSetDevicesFromConfig();
|
||||
attempt_to_set_devices_from_config();
|
||||
}
|
||||
|
||||
void PreferencesAudioTab::RefreshDevices()
|
||||
void PreferencesAudioTab::refresh_devices()
|
||||
{
|
||||
if (audio_backend_combobox_->count() == 0) {
|
||||
return;
|
||||
@@ -282,19 +282,19 @@ void PreferencesAudioTab::RefreshDevices()
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesAudioTab::HardRefreshBackends()
|
||||
void PreferencesAudioTab::hard_refresh_backends()
|
||||
{
|
||||
AudioManager::instance()->HardReset();
|
||||
RefreshBackends();
|
||||
AudioManager::instance()->hard_reset();
|
||||
refresh_backends();
|
||||
}
|
||||
|
||||
void PreferencesAudioTab::AttemptToSetDevicesFromConfig()
|
||||
void PreferencesAudioTab::attempt_to_set_devices_from_config()
|
||||
{
|
||||
// Load with currently active devices
|
||||
PaDeviceIndex current_output_index =
|
||||
AudioManager::instance()->GetOutputDevice();
|
||||
AudioManager::instance()->get_output_device();
|
||||
PaDeviceIndex current_input_index =
|
||||
AudioManager::instance()->GetInputDevice();
|
||||
AudioManager::instance()->get_input_device();
|
||||
|
||||
const PaDeviceInfo *current_output = nullptr, *current_input = nullptr;
|
||||
if (current_output_index != paNoDevice) {
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESAUDIOTAB_H
|
||||
#define PREFERENCESAUDIOTAB_H
|
||||
#ifndef OAK_PREFERENCESAUDIOTAB_H
|
||||
#define OAK_PREFERENCESAUDIOTAB_H
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
@@ -39,7 +39,7 @@ class PreferencesAudioTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesAudioTab();
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private:
|
||||
QComboBox *audio_backend_combobox_;
|
||||
@@ -75,15 +75,15 @@ private:
|
||||
QCheckBox *audio_scrubbing_;
|
||||
|
||||
private slots:
|
||||
void RefreshBackends();
|
||||
void refresh_backends();
|
||||
|
||||
void RefreshDevices();
|
||||
void refresh_devices();
|
||||
|
||||
void HardRefreshBackends();
|
||||
void hard_refresh_backends();
|
||||
|
||||
void AttemptToSetDevicesFromConfig();
|
||||
void attempt_to_set_devices_from_config();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESAUDIOTAB_H
|
||||
#endif // OAK_PREFERENCESAUDIOTAB_H
|
||||
|
||||
@@ -36,8 +36,8 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
|
||||
switch (category_) {
|
||||
case kCategoryTimeline:
|
||||
AddItems({
|
||||
case k_category_timeline:
|
||||
add_items({
|
||||
{ tr("Auto-Seek to Imported Clips"),
|
||||
QStringLiteral("EnableSeekToImport") },
|
||||
{ tr("Edit Tool Also Seeks"), QStringLiteral("EditToolAlsoSeeks") },
|
||||
@@ -54,8 +54,8 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
});
|
||||
break;
|
||||
|
||||
case kCategoryPlayback:
|
||||
AddItems({
|
||||
case k_category_playback:
|
||||
add_items({
|
||||
{ tr("Ask For Name When Setting Marker"),
|
||||
QStringLiteral("SetNameWithMarker") },
|
||||
{ tr("Automatically rewind at the end of a sequence"),
|
||||
@@ -63,13 +63,13 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
});
|
||||
break;
|
||||
|
||||
case kCategoryProject:
|
||||
AddItem(tr("Drop Files on Media to Replace"),
|
||||
case k_category_project:
|
||||
add_item(tr("Drop Files on Media to Replace"),
|
||||
QStringLiteral("DropFileOnMediaToReplace"));
|
||||
break;
|
||||
|
||||
case kCategoryNodes:
|
||||
AddItems({
|
||||
case k_category_nodes:
|
||||
add_items({
|
||||
{ tr("Add Default Effects to New Clips"),
|
||||
QStringLiteral("AddDefaultEffectsToClips") },
|
||||
{ tr("Auto-Scale By Default"),
|
||||
@@ -82,7 +82,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
});
|
||||
break;
|
||||
|
||||
case kCategoryRendering: {
|
||||
case k_category_rendering: {
|
||||
QLabel *backend_label = new QLabel(tr("Graphics Backend"));
|
||||
backend_label->setToolTip(
|
||||
tr("Selects the graphics API Oak should request on next launch. "
|
||||
@@ -96,7 +96,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
graphics_backend_combobox_->addItem(tr("Vulkan (experimental)"),
|
||||
QStringLiteral("vulkan"));
|
||||
const QString current_backend =
|
||||
OLIVE_CONFIG("GraphicsBackend").toString().toLower();
|
||||
OAK_CONFIG("GraphicsBackend").toString().toLower();
|
||||
const int backend_index = graphics_backend_combobox_->findData(
|
||||
current_backend.isEmpty() ? QStringLiteral("opengl") :
|
||||
current_backend);
|
||||
@@ -108,40 +108,40 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
|
||||
backend_layout->addWidget(graphics_backend_combobox_, 1);
|
||||
layout->addLayout(backend_layout);
|
||||
|
||||
AddItem(tr("Use glFinish"), QStringLiteral("UseGLFinish"));
|
||||
add_item(tr("Use glFinish"), QStringLiteral("UseGLFinish"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesBehaviorTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesBehaviorTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
for (auto it = config_map_.cbegin(); it != config_map_.cend(); ++it) {
|
||||
OLIVE_CONFIG_STR(it.value()) = it.key()->isChecked();
|
||||
OAK_CONFIG_STR(it.value()) = it.key()->isChecked();
|
||||
}
|
||||
|
||||
if (graphics_backend_combobox_) {
|
||||
OLIVE_CONFIG("GraphicsBackend") =
|
||||
OAK_CONFIG("GraphicsBackend") =
|
||||
graphics_backend_combobox_->currentData().toString();
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesBehaviorTab::AddItems(const QVector<Item> &items)
|
||||
void PreferencesBehaviorTab::add_items(const QVector<Item> &items)
|
||||
{
|
||||
for (const Item &i : items) {
|
||||
AddItem(i.text, i.config_key, i.tooltip);
|
||||
add_item(i.text, i.config_key, i.tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
QCheckBox *PreferencesBehaviorTab::AddItem(const QString &text,
|
||||
QCheckBox *PreferencesBehaviorTab::add_item(const QString &text,
|
||||
const QString &config_key,
|
||||
const QString &tooltip)
|
||||
{
|
||||
QCheckBox *checkbox = new QCheckBox(text);
|
||||
checkbox->setToolTip(tooltip);
|
||||
checkbox->setChecked(OLIVE_CONFIG_STR(config_key).toBool());
|
||||
checkbox->setChecked(OAK_CONFIG_STR(config_key).toBool());
|
||||
|
||||
config_map_.insert(checkbox, config_key);
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESBEHAVIORTAB_H
|
||||
#define PREFERENCESBEHAVIORTAB_H
|
||||
#ifndef OAK_PREFERENCESBEHAVIORTAB_H
|
||||
#define OAK_PREFERENCESBEHAVIORTAB_H
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -36,18 +36,18 @@ class PreferencesBehaviorTab : public ConfigDialogBaseTab {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Category {
|
||||
kCategoryTimeline,
|
||||
kCategoryPlayback,
|
||||
kCategoryProject,
|
||||
kCategoryNodes,
|
||||
kCategoryRendering
|
||||
k_category_timeline,
|
||||
k_category_playback,
|
||||
k_category_project,
|
||||
k_category_nodes,
|
||||
k_category_rendering
|
||||
};
|
||||
|
||||
PreferencesBehaviorTab(Category category);
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
static QString BehaviorPrefTr(const char *text)
|
||||
static QString behavior_pref_tr(const char *text)
|
||||
{
|
||||
return QCoreApplication::translate("olive::PreferencesBehaviorTab",
|
||||
text);
|
||||
@@ -60,8 +60,8 @@ private:
|
||||
QString tooltip = QString();
|
||||
};
|
||||
|
||||
void AddItems(const QVector<Item> &items);
|
||||
QCheckBox *AddItem(const QString &text, const QString &config_key,
|
||||
void add_items(const QVector<Item> &items);
|
||||
QCheckBox *add_item(const QString &text, const QString &config_key,
|
||||
const QString &tooltip = QString());
|
||||
|
||||
QMap<QCheckBox *, QString> config_map_;
|
||||
@@ -73,4 +73,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESBEHAVIORTAB_H
|
||||
#endif // OAK_PREFERENCESBEHAVIORTAB_H
|
||||
|
||||
@@ -38,7 +38,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
{
|
||||
// Get default disk cache folder
|
||||
default_disk_cache_folder_ =
|
||||
DiskManager::instance()->GetDefaultCacheFolder();
|
||||
DiskManager::instance()->get_default_cache_folder();
|
||||
|
||||
QVBoxLayout *outer_layout = new QVBoxLayout(this);
|
||||
|
||||
@@ -54,7 +54,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
row, 0);
|
||||
|
||||
disk_cache_location_ =
|
||||
new PathWidget(default_disk_cache_folder_->GetPath());
|
||||
new PathWidget(default_disk_cache_folder_->get_path());
|
||||
disk_management_layout->addWidget(disk_cache_location_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -62,7 +62,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
QPushButton *disk_cache_settings_btn =
|
||||
new QPushButton(tr("Disk Cache Settings"));
|
||||
connect(disk_cache_settings_btn, &QPushButton::clicked, this, [this]() {
|
||||
DiskManager::instance()->ShowDiskCacheSettingsDialog(
|
||||
DiskManager::instance()->show_disk_cache_settings_dialog(
|
||||
disk_cache_location_->text(), this);
|
||||
});
|
||||
disk_management_layout->addWidget(disk_cache_settings_btn, row, 1);
|
||||
@@ -78,19 +78,19 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
cache_behavior_layout->addWidget(new QLabel(tr("Cache Ahead:")), row, 0);
|
||||
|
||||
cache_ahead_slider_ = new FloatSlider();
|
||||
cache_ahead_slider_->SetFormat(tr("%1 seconds"));
|
||||
cache_ahead_slider_->SetMinimum(0);
|
||||
cache_ahead_slider_->SetValue(
|
||||
OLIVE_CONFIG("DiskCacheAhead").value<rational>().toDouble());
|
||||
cache_ahead_slider_->set_format(tr("%1 seconds"));
|
||||
cache_ahead_slider_->set_minimum(0);
|
||||
cache_ahead_slider_->set_value(
|
||||
OAK_CONFIG("DiskCacheAhead").value<Rational>().to_double());
|
||||
cache_behavior_layout->addWidget(cache_ahead_slider_, row, 1);
|
||||
|
||||
cache_behavior_layout->addWidget(new QLabel(tr("Cache Behind:")), row, 2);
|
||||
|
||||
cache_behind_slider_ = new FloatSlider();
|
||||
cache_behind_slider_->SetMinimum(0);
|
||||
cache_behind_slider_->SetFormat(tr("%1 seconds"));
|
||||
cache_behind_slider_->SetValue(
|
||||
OLIVE_CONFIG("DiskCacheBehind").value<rational>().toDouble());
|
||||
cache_behind_slider_->set_minimum(0);
|
||||
cache_behind_slider_->set_format(tr("%1 seconds"));
|
||||
cache_behind_slider_->set_value(
|
||||
OAK_CONFIG("DiskCacheBehind").value<Rational>().to_double());
|
||||
cache_behavior_layout->addWidget(cache_behind_slider_, row, 3);
|
||||
|
||||
row++;
|
||||
@@ -103,25 +103,25 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
|
||||
proxy_layout->addWidget(new QLabel(tr("Proxy Width:")), proxy_row, 0);
|
||||
proxy_width_slider_ = new IntegerSlider();
|
||||
proxy_width_slider_->SetMinimum(160);
|
||||
proxy_width_slider_->SetMaximum(4096);
|
||||
proxy_width_slider_->SetValue(OLIVE_CONFIG("ProxyWidth").value<int>());
|
||||
proxy_width_slider_->set_minimum(160);
|
||||
proxy_width_slider_->set_maximum(4096);
|
||||
proxy_width_slider_->set_value(OAK_CONFIG("ProxyWidth").value<int>());
|
||||
proxy_layout->addWidget(proxy_width_slider_, proxy_row, 1);
|
||||
|
||||
proxy_layout->addWidget(new QLabel(tr("Proxy Height:")), proxy_row, 2);
|
||||
proxy_height_slider_ = new IntegerSlider();
|
||||
proxy_height_slider_->SetMinimum(120);
|
||||
proxy_height_slider_->SetMaximum(2160);
|
||||
proxy_height_slider_->SetValue(OLIVE_CONFIG("ProxyHeight").value<int>());
|
||||
proxy_height_slider_->set_minimum(120);
|
||||
proxy_height_slider_->set_maximum(2160);
|
||||
proxy_height_slider_->set_value(OAK_CONFIG("ProxyHeight").value<int>());
|
||||
proxy_layout->addWidget(proxy_height_slider_, proxy_row, 3);
|
||||
|
||||
proxy_row++;
|
||||
|
||||
proxy_layout->addWidget(new QLabel(tr("Proxy CRF:")), proxy_row, 0);
|
||||
proxy_crf_slider_ = new IntegerSlider();
|
||||
proxy_crf_slider_->SetMinimum(0);
|
||||
proxy_crf_slider_->SetMaximum(51);
|
||||
proxy_crf_slider_->SetValue(OLIVE_CONFIG("ProxyCRF").value<int>());
|
||||
proxy_crf_slider_->set_minimum(0);
|
||||
proxy_crf_slider_->set_maximum(51);
|
||||
proxy_crf_slider_->set_value(OAK_CONFIG("ProxyCRF").value<int>());
|
||||
proxy_layout->addWidget(proxy_crf_slider_, proxy_row, 1);
|
||||
|
||||
proxy_layout->addWidget(new QLabel(tr("Proxy Preset:")), proxy_row, 2);
|
||||
@@ -136,7 +136,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
for (const QString &preset : presets) {
|
||||
proxy_preset_combo_->addItem(preset);
|
||||
}
|
||||
proxy_preset_combo_->setCurrentText(OLIVE_CONFIG("ProxyPreset").toString());
|
||||
proxy_preset_combo_->setCurrentText(OAK_CONFIG("ProxyPreset").toString());
|
||||
proxy_layout->addWidget(proxy_preset_combo_, proxy_row, 3);
|
||||
|
||||
proxy_row++;
|
||||
@@ -144,7 +144,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
proxy_include_audio_checkbox_ =
|
||||
new QCheckBox(tr("Include audio in proxies"));
|
||||
proxy_include_audio_checkbox_->setChecked(
|
||||
OLIVE_CONFIG("ProxyIncludeAudio").toBool());
|
||||
OAK_CONFIG("ProxyIncludeAudio").toBool());
|
||||
proxy_layout->addWidget(proxy_include_audio_checkbox_, proxy_row, 0, 1, 2);
|
||||
|
||||
proxy_row++;
|
||||
@@ -152,7 +152,7 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
proxy_layout->addWidget(new QLabel(tr("ffmpeg Executable:")), proxy_row,
|
||||
0);
|
||||
proxy_ffmpeg_path_edit_ =
|
||||
new QLineEdit(OLIVE_CONFIG("FFmpegPath").toString());
|
||||
new QLineEdit(OAK_CONFIG("FFmpegPath").toString());
|
||||
proxy_ffmpeg_path_edit_->setPlaceholderText(tr("Auto-detect"));
|
||||
proxy_layout->addWidget(proxy_ffmpeg_path_edit_, proxy_row, 1);
|
||||
|
||||
@@ -169,18 +169,18 @@ PreferencesDiskTab::PreferencesDiskTab()
|
||||
outer_layout->addStretch();
|
||||
}
|
||||
|
||||
bool PreferencesDiskTab::Validate()
|
||||
bool PreferencesDiskTab::validate()
|
||||
{
|
||||
if (disk_cache_location_->text() != default_disk_cache_folder_->GetPath()) {
|
||||
if (disk_cache_location_->text() != default_disk_cache_folder_->get_path()) {
|
||||
// Disk cache location is changing
|
||||
|
||||
// Check if the user is okay with invalidating the current cache
|
||||
if (!DiskManager::ShowDiskCacheChangeConfirmationDialog(this)) {
|
||||
if (!DiskManager::show_disk_cache_change_confirmation_dialog(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check validity of the new path
|
||||
if (!FileFunctions::DirectoryIsValid(disk_cache_location_->text())) {
|
||||
if (!FileFunctions::directory_is_valid(disk_cache_location_->text())) {
|
||||
QMessageBox::critical(
|
||||
this, tr("Disk Cache"),
|
||||
tr("Failed to set disk cache location. Access was denied."));
|
||||
@@ -191,28 +191,28 @@ bool PreferencesDiskTab::Validate()
|
||||
return true;
|
||||
}
|
||||
|
||||
void PreferencesDiskTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesDiskTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
if (disk_cache_location_->text() != default_disk_cache_folder_->GetPath()) {
|
||||
default_disk_cache_folder_->SetPath(disk_cache_location_->text());
|
||||
if (disk_cache_location_->text() != default_disk_cache_folder_->get_path()) {
|
||||
default_disk_cache_folder_->set_path(disk_cache_location_->text());
|
||||
}
|
||||
|
||||
OLIVE_CONFIG("DiskCacheBehind") = QVariant::fromValue(
|
||||
rational::fromDouble(cache_behind_slider_->GetValue()));
|
||||
OLIVE_CONFIG("DiskCacheAhead") = QVariant::fromValue(
|
||||
rational::fromDouble(cache_ahead_slider_->GetValue()));
|
||||
OAK_CONFIG("DiskCacheBehind") = QVariant::fromValue(
|
||||
Rational::from_double(cache_behind_slider_->get_value()));
|
||||
OAK_CONFIG("DiskCacheAhead") = QVariant::fromValue(
|
||||
Rational::from_double(cache_ahead_slider_->get_value()));
|
||||
|
||||
OLIVE_CONFIG("ProxyWidth") =
|
||||
static_cast<int>(proxy_width_slider_->GetValue());
|
||||
OLIVE_CONFIG("ProxyHeight") =
|
||||
static_cast<int>(proxy_height_slider_->GetValue());
|
||||
OLIVE_CONFIG("ProxyCRF") = static_cast<int>(proxy_crf_slider_->GetValue());
|
||||
OLIVE_CONFIG("ProxyPreset") = proxy_preset_combo_->currentText();
|
||||
OLIVE_CONFIG("ProxyIncludeAudio") =
|
||||
OAK_CONFIG("ProxyWidth") =
|
||||
static_cast<int>(proxy_width_slider_->get_value());
|
||||
OAK_CONFIG("ProxyHeight") =
|
||||
static_cast<int>(proxy_height_slider_->get_value());
|
||||
OAK_CONFIG("ProxyCRF") = static_cast<int>(proxy_crf_slider_->get_value());
|
||||
OAK_CONFIG("ProxyPreset") = proxy_preset_combo_->currentText();
|
||||
OAK_CONFIG("ProxyIncludeAudio") =
|
||||
proxy_include_audio_checkbox_->isChecked();
|
||||
OLIVE_CONFIG("FFmpegPath") = proxy_ffmpeg_path_edit_->text().trimmed();
|
||||
OAK_CONFIG("FFmpegPath") = proxy_ffmpeg_path_edit_->text().trimmed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESDISKTAB_H
|
||||
#define PREFERENCESDISKTAB_H
|
||||
#ifndef OAK_PREFERENCESDISKTAB_H
|
||||
#define OAK_PREFERENCESDISKTAB_H
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -41,9 +41,9 @@ class PreferencesDiskTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesDiskTab();
|
||||
|
||||
virtual bool Validate() override;
|
||||
virtual bool validate() override;
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private:
|
||||
PathWidget *disk_cache_location_;
|
||||
@@ -64,4 +64,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESDISKTAB_H
|
||||
#endif // OAK_PREFERENCESDISKTAB_H
|
||||
|
||||
@@ -53,10 +53,10 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
QDir language_dir(QStringLiteral(":/ts"));
|
||||
QStringList languages = language_dir.entryList();
|
||||
foreach (const QString &l, languages) {
|
||||
AddLanguage(l);
|
||||
add_language(l);
|
||||
}
|
||||
|
||||
QString current_language = OLIVE_CONFIG("Language").toString();
|
||||
QString current_language = OAK_CONFIG("Language").toString();
|
||||
if (current_language.isEmpty()) {
|
||||
// No configured language, use system language
|
||||
current_language = QLocale::system().name();
|
||||
@@ -86,11 +86,11 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
// ComboBox indices match enum indices
|
||||
autoscroll_method_ = new QComboBox();
|
||||
autoscroll_method_->addItem(tr("None"), AutoScroll::kNone);
|
||||
autoscroll_method_->addItem(tr("Page Scrolling"), AutoScroll::kPage);
|
||||
autoscroll_method_->addItem(tr("None"), AutoScroll::k_none);
|
||||
autoscroll_method_->addItem(tr("Page Scrolling"), AutoScroll::k_page);
|
||||
autoscroll_method_->addItem(tr("Smooth Scrolling"),
|
||||
AutoScroll::kSmooth);
|
||||
autoscroll_method_->setCurrentIndex(OLIVE_CONFIG("Autoscroll").toInt());
|
||||
AutoScroll::k_smooth);
|
||||
autoscroll_method_->setCurrentIndex(OAK_CONFIG("Autoscroll").toInt());
|
||||
timeline_layout->addWidget(autoscroll_method_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -100,7 +100,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
rectified_waveforms_ = new QCheckBox();
|
||||
rectified_waveforms_->setChecked(
|
||||
OLIVE_CONFIG("RectifiedWaveforms").toBool());
|
||||
OAK_CONFIG("RectifiedWaveforms").toBool());
|
||||
timeline_layout->addWidget(rectified_waveforms_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -109,11 +109,11 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Default Still Image Length:")), row, 0);
|
||||
|
||||
default_still_length_ = new RationalSlider();
|
||||
default_still_length_->SetMinimum(rational(100, 1000));
|
||||
default_still_length_->SetTimebase(rational(100, 1000));
|
||||
default_still_length_->SetFormat(tr("%1 seconds"));
|
||||
default_still_length_->SetValue(
|
||||
OLIVE_CONFIG("DefaultStillLength").value<rational>());
|
||||
default_still_length_->set_minimum(Rational(100, 1000));
|
||||
default_still_length_->set_timebase(Rational(100, 1000));
|
||||
default_still_length_->set_format(tr("%1 seconds"));
|
||||
default_still_length_->set_value(
|
||||
OAK_CONFIG("DefaultStillLength").value<Rational>());
|
||||
timeline_layout->addWidget(default_still_length_);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
autorecovery_enabled_ = new QCheckBox();
|
||||
autorecovery_enabled_->setChecked(
|
||||
OLIVE_CONFIG("AutorecoveryEnabled").toBool());
|
||||
OAK_CONFIG("AutorecoveryEnabled").toBool());
|
||||
autorecovery_layout->addWidget(autorecovery_enabled_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -139,12 +139,12 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Auto-Recovery Interval:")), row, 0);
|
||||
|
||||
autorecovery_interval_ = new IntegerSlider();
|
||||
autorecovery_interval_->SetMinimum(1);
|
||||
autorecovery_interval_->SetMaximum(60);
|
||||
autorecovery_interval_->SetFormat(
|
||||
autorecovery_interval_->set_minimum(1);
|
||||
autorecovery_interval_->set_maximum(60);
|
||||
autorecovery_interval_->set_format(
|
||||
QT_TRANSLATE_N_NOOP("olive::SliderBase", "%n minute(s)"), true);
|
||||
autorecovery_interval_->SetValue(
|
||||
OLIVE_CONFIG("AutorecoveryInterval").toLongLong());
|
||||
autorecovery_interval_->set_value(
|
||||
OAK_CONFIG("AutorecoveryInterval").toLongLong());
|
||||
autorecovery_layout->addWidget(autorecovery_interval_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -153,10 +153,10 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Maximum Versions Per Project:")), row, 0);
|
||||
|
||||
autorecovery_maximum_ = new IntegerSlider();
|
||||
autorecovery_maximum_->SetMinimum(1);
|
||||
autorecovery_maximum_->SetMaximum(1000);
|
||||
autorecovery_maximum_->SetValue(
|
||||
OLIVE_CONFIG("AutorecoveryMaximum").toLongLong());
|
||||
autorecovery_maximum_->set_minimum(1);
|
||||
autorecovery_maximum_->set_maximum(1000);
|
||||
autorecovery_maximum_->set_value(
|
||||
OAK_CONFIG("AutorecoveryMaximum").toLongLong());
|
||||
autorecovery_layout->addWidget(autorecovery_maximum_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -164,50 +164,50 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
QPushButton *browse_autorecoveries =
|
||||
new QPushButton(tr("Browse Auto-Recoveries"));
|
||||
connect(browse_autorecoveries, &QPushButton::clicked, Core::instance(),
|
||||
&Core::BrowseAutoRecoveries);
|
||||
&Core::browse_auto_recoveries);
|
||||
autorecovery_layout->addWidget(browse_autorecoveries, row, 1);
|
||||
}
|
||||
|
||||
{
|
||||
QGroupBox *behavior_groupbox =
|
||||
new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior"));
|
||||
new QGroupBox(PreferencesBehaviorTab::behavior_pref_tr("Behavior"));
|
||||
QVBoxLayout *behavior_layout = new QVBoxLayout(behavior_groupbox);
|
||||
layout->addWidget(behavior_groupbox);
|
||||
|
||||
hover_focus_ = new QCheckBox(
|
||||
PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus"));
|
||||
hover_focus_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
PreferencesBehaviorTab::behavior_pref_tr("Enable hover focus"));
|
||||
hover_focus_->setToolTip(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"Panels will be considered focused when the mouse cursor is over them without having to click them."));
|
||||
hover_focus_->setChecked(OLIVE_CONFIG("HoverFocus").toBool());
|
||||
hover_focus_->setChecked(OAK_CONFIG("HoverFocus").toBool());
|
||||
behavior_layout->addWidget(hover_focus_);
|
||||
|
||||
slider_ladder_ = new QCheckBox(
|
||||
PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder"));
|
||||
slider_ladder_->setChecked(OLIVE_CONFIG("UseSliderLadders").toBool());
|
||||
PreferencesBehaviorTab::behavior_pref_tr("Enable slider ladder"));
|
||||
slider_ladder_->setChecked(OAK_CONFIG("UseSliderLadders").toBool());
|
||||
behavior_layout->addWidget(slider_ladder_);
|
||||
|
||||
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"Scrolling zooms by default"));
|
||||
scroll_zooms_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
scroll_zooms_->setToolTip(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"By default, scrolling will move the view around, and holding Ctrl/Cmd will make it zoom instead. "
|
||||
"Enabling this will switch those, scrolling will zoom by default, and holding Ctrl/Cmd will move the view instead."));
|
||||
scroll_zooms_->setChecked(OLIVE_CONFIG("ScrollZooms").toBool());
|
||||
scroll_zooms_->setChecked(OAK_CONFIG("ScrollZooms").toBool());
|
||||
behavior_layout->addWidget(scroll_zooms_);
|
||||
}
|
||||
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void PreferencesGeneralTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesGeneralTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
OLIVE_CONFIG("RectifiedWaveforms") = rectified_waveforms_->isChecked();
|
||||
OAK_CONFIG("RectifiedWaveforms") = rectified_waveforms_->isChecked();
|
||||
|
||||
OLIVE_CONFIG("Autoscroll") = autoscroll_method_->currentData();
|
||||
OAK_CONFIG("Autoscroll") = autoscroll_method_->currentData();
|
||||
|
||||
OLIVE_CONFIG("DefaultStillLength") =
|
||||
QVariant::fromValue(default_still_length_->GetValue());
|
||||
OAK_CONFIG("DefaultStillLength") =
|
||||
QVariant::fromValue(default_still_length_->get_value());
|
||||
|
||||
QString set_language = language_combobox_->currentData().toString();
|
||||
if (QLocale::system().name() == set_language) {
|
||||
@@ -216,26 +216,26 @@ void PreferencesGeneralTab::Accept(MultiUndoCommand *command)
|
||||
}
|
||||
|
||||
// If the language has changed, set it now
|
||||
if (OLIVE_CONFIG("Language").toString() != set_language) {
|
||||
OLIVE_CONFIG("Language") = set_language;
|
||||
Core::instance()->SetLanguage(
|
||||
if (OAK_CONFIG("Language").toString() != set_language) {
|
||||
OAK_CONFIG("Language") = set_language;
|
||||
Core::instance()->set_language(
|
||||
set_language.isEmpty() ? QLocale::system().name() : set_language);
|
||||
}
|
||||
|
||||
OLIVE_CONFIG("AutorecoveryEnabled") = autorecovery_enabled_->isChecked();
|
||||
OLIVE_CONFIG("AutorecoveryInterval") =
|
||||
QVariant::fromValue(autorecovery_interval_->GetValue());
|
||||
OLIVE_CONFIG("AutorecoveryMaximum") =
|
||||
QVariant::fromValue(autorecovery_maximum_->GetValue());
|
||||
Core::instance()->SetAutorecoveryInterval(
|
||||
autorecovery_interval_->GetValue());
|
||||
OAK_CONFIG("AutorecoveryEnabled") = autorecovery_enabled_->isChecked();
|
||||
OAK_CONFIG("AutorecoveryInterval") =
|
||||
QVariant::fromValue(autorecovery_interval_->get_value());
|
||||
OAK_CONFIG("AutorecoveryMaximum") =
|
||||
QVariant::fromValue(autorecovery_maximum_->get_value());
|
||||
Core::instance()->set_autorecovery_interval(
|
||||
autorecovery_interval_->get_value());
|
||||
|
||||
OLIVE_CONFIG("HoverFocus") = hover_focus_->isChecked();
|
||||
OLIVE_CONFIG("UseSliderLadders") = slider_ladder_->isChecked();
|
||||
OLIVE_CONFIG("ScrollZooms") = scroll_zooms_->isChecked();
|
||||
OAK_CONFIG("HoverFocus") = hover_focus_->isChecked();
|
||||
OAK_CONFIG("UseSliderLadders") = slider_ladder_->isChecked();
|
||||
OAK_CONFIG("ScrollZooms") = scroll_zooms_->isChecked();
|
||||
}
|
||||
|
||||
void PreferencesGeneralTab::AddLanguage(const QString &locale_name)
|
||||
void PreferencesGeneralTab::add_language(const QString &locale_name)
|
||||
{
|
||||
language_combobox_->addItem(tr("%1 (%2)").arg(
|
||||
QLocale(locale_name).nativeLanguageName(), locale_name));
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESGENERALTAB_H
|
||||
#define PREFERENCESGENERALTAB_H
|
||||
#ifndef OAK_PREFERENCESGENERALTAB_H
|
||||
#define OAK_PREFERENCESGENERALTAB_H
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -39,10 +39,10 @@ class PreferencesGeneralTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesGeneralTab();
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private:
|
||||
void AddLanguage(const QString &locale_name);
|
||||
void add_language(const QString &locale_name);
|
||||
|
||||
QComboBox *language_combobox_;
|
||||
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESGENERALTAB_H
|
||||
#endif // OAK_PREFERENCESGENERALTAB_H
|
||||
|
||||
@@ -81,7 +81,7 @@ PreferencesKeyboardTab::PreferencesKeyboardTab(MainWindow *main_window)
|
||||
setup_kbd_shortcuts(main_window_->menuBar());
|
||||
}
|
||||
|
||||
void PreferencesKeyboardTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesKeyboardTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
@@ -90,7 +90,7 @@ void PreferencesKeyboardTab::Accept(MultiUndoCommand *command)
|
||||
key_shortcut_fields_.at(i)->set_action_shortcut();
|
||||
}
|
||||
|
||||
main_window_->SaveLayout();
|
||||
main_window_->save_layout();
|
||||
}
|
||||
|
||||
void PreferencesKeyboardTab::setup_kbd_shortcuts(QMenuBar *menubar)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESKEYBOARDTAB_H
|
||||
#define PREFERENCESKEYBOARDTAB_H
|
||||
#ifndef OAK_PREFERENCESKEYBOARDTAB_H
|
||||
#define OAK_PREFERENCESKEYBOARDTAB_H
|
||||
|
||||
#include <QMenuBar>
|
||||
#include <QTreeWidget>
|
||||
@@ -38,7 +38,7 @@ class PreferencesKeyboardTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesKeyboardTab(MainWindow *main_window);
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
@@ -142,4 +142,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESKEYBOARDTAB_H
|
||||
#endif // OAK_PREFERENCESKEYBOARDTAB_H
|
||||
|
||||
@@ -46,7 +46,7 @@ PreferencesLutTab::PreferencesLutTab()
|
||||
"these locations when picking a LUT file.")));
|
||||
|
||||
library_dirs_list_ = new QListWidget();
|
||||
library_dirs_list_->addItems(LUTLibrary::GetDirectories());
|
||||
library_dirs_list_->addItems(LUTLibrary::get_directories());
|
||||
library_layout->addWidget(library_dirs_list_);
|
||||
|
||||
QHBoxLayout *button_layout = new QHBoxLayout();
|
||||
@@ -74,7 +74,7 @@ PreferencesLutTab::PreferencesLutTab()
|
||||
outer_layout->addStretch();
|
||||
}
|
||||
|
||||
void PreferencesLutTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesLutTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
@@ -83,7 +83,7 @@ void PreferencesLutTab::Accept(MultiUndoCommand *command)
|
||||
dirs.append(library_dirs_list_->item(i)->text());
|
||||
}
|
||||
|
||||
LUTLibrary::SetDirectories(dirs);
|
||||
LUTLibrary::set_directories(dirs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PREFERENCESLUTTAB_H
|
||||
#define PREFERENCESLUTTAB_H
|
||||
#ifndef OAK_PREFERENCESLUTTAB_H
|
||||
#define OAK_PREFERENCESLUTTAB_H
|
||||
|
||||
#include <QListWidget>
|
||||
|
||||
@@ -33,7 +33,7 @@ class PreferencesLutTab : public ConfigDialogBaseTab {
|
||||
public:
|
||||
PreferencesLutTab();
|
||||
|
||||
virtual void Accept(MultiUndoCommand *command) override;
|
||||
virtual void accept(MultiUndoCommand *command) override;
|
||||
|
||||
private:
|
||||
QListWidget *library_dirs_list_;
|
||||
@@ -41,4 +41,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // PREFERENCESLUTTAB_H
|
||||
#endif // OAK_PREFERENCESLUTTAB_H
|
||||
|
||||
Reference in New Issue
Block a user