citra_qt/dumping: Add option set dialog

This dialog allows changing the value and unsetting one option. There are three possible variants of this dialog:

1. The LineEdit layout. This is used for normal options like string and duration, and just features a textbox for the user to type in whatever they want to set.

2. The ComboBox layout. This is used when there are named constants for an option, or when the option accepts an enum value like sample_format or pixel_format. A description will be displayed for the currently selected named constant. The user can also select 'custom' and type in their own value.

3. The CheckBox-es layout. This is used for flags options. A checkbox will be displayed for each named constant and the user can tick the flags they want to set.
This commit is contained in:
zhupengfei 2020-02-01 12:34:20 +08:00
parent 8c4bcf9f59
commit 94bc09d3ae
No known key found for this signature in database
GPG key ID: DD129E108BD09378
3 changed files with 421 additions and 0 deletions

View file

@ -0,0 +1,33 @@
// Copyright 2020 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <QDialog>
#include "core/dumping/ffmpeg_backend.h"
namespace Ui {
class OptionSetDialog;
}
class OptionSetDialog : public QDialog {
Q_OBJECT
public:
explicit OptionSetDialog(QWidget* parent, VideoDumper::OptionInfo option,
const std::string& initial_value);
~OptionSetDialog() override;
// {is_set, value}
std::pair<bool, std::string> GetCurrentValue();
private:
void InitializeUI(const std::string& initial_value);
void SetCheckBoxDefaults(const std::string& initial_value);
void UpdateUIDisplay();
std::unique_ptr<Ui::OptionSetDialog> ui;
VideoDumper::OptionInfo option;
bool is_set = true;
int layout_type = -1; // 0 - line edit, 1 - combo box, 2 - flags (check boxes)
};