preferences: allow users to set the default still image length

This commit is contained in:
itsmattkc
2020-01-21 14:31:45 +11:00
parent 5d4535b06d
commit 8932a5abeb
2 changed files with 14 additions and 1 deletions
@@ -74,6 +74,15 @@ PreferencesGeneralTab::PreferencesGeneralTab()
row++;
general_layout->addWidget(new QLabel(tr("Default Still Image Length:")), row, 0);
default_still_length_ = new FloatSlider();
default_still_length_->SetMinimum(0.1);
default_still_length_->SetValue(Config::Current()["DefaultStillLength"].value<rational>().toDouble());
general_layout->addWidget(default_still_length_);
row++;
general_layout->addWidget(new QLabel(tr("Default Sequence Settings:")), row, 0);
// General -> Default Sequence Settings
@@ -93,6 +102,8 @@ void PreferencesGeneralTab::Accept()
Config::Current()["DefaultSequenceAudioLayout"] = QVariant::fromValue(default_sequence_.audio_params().channel_layout());
Config::Current()["Autoscroll"] = autoscroll_method_->currentData();
Config::Current()["DefaultStillLength"] = QVariant::fromValue(rational::fromDouble(default_still_length_->GetValue()));
}
void PreferencesGeneralTab::edit_default_sequence_settings()
@@ -6,6 +6,7 @@
#include "preferencestab.h"
#include "project/item/sequence/sequence.h"
#include "widget/slider/floatslider.h"
class PreferencesGeneralTab : public PreferencesTab
{
@@ -26,12 +27,13 @@ private:
QComboBox* autoscroll_method_;
FloatSlider* default_still_length_;
/**
* @brief A sequence we can feed to a SequenceDialog to change the defaults
*/
Sequence default_sequence_;
};
#endif // PREFERENCESGENERALTAB_H