mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-07-18 17:04:28 -05:00
Fix title of script open dialog
This commit is contained in:
parent
35e5b7620e
commit
85460157b1
|
|
@ -1701,6 +1701,7 @@ AdvSceneSwitcher.script.language.lua="LUA"
|
|||
AdvSceneSwitcher.script.language.select="--select language--"
|
||||
AdvSceneSwitcher.script.language.layout="Script language:{{language}}"
|
||||
AdvSceneSwitcher.script.file.open="Open"
|
||||
AdvSceneSwitcher.script.file.select="Select Script File"
|
||||
AdvSceneSwitcher.script.file.open.failed="Could not open script file!"
|
||||
AdvSceneSwitcher.script.file.warning.notFound="Warning: The given file path was not found!"
|
||||
AdvSceneSwitcher.script.file.warning.openFail="Warning: Could not open the script file!"
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
namespace advss {
|
||||
|
||||
FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
|
||||
FileSelection::FileSelection(FileSelection::Type type, QWidget *parent,
|
||||
const QString &browseTitle)
|
||||
: QWidget(parent),
|
||||
_type(type),
|
||||
_browseTitle(browseTitle),
|
||||
_filePath(new VariableLineEdit(this)),
|
||||
_browseButton(
|
||||
new QPushButton(obs_module_text("AdvSceneSwitcher.browse")))
|
||||
|
|
@ -55,11 +57,14 @@ void FileSelection::BrowseButtonClicked()
|
|||
QString defaultPath = ValidPathOrDesktop(_filePath->text());
|
||||
QString path;
|
||||
if (_type == FileSelection::Type::WRITE) {
|
||||
path = QFileDialog::getSaveFileName(this, "", defaultPath);
|
||||
path = QFileDialog::getSaveFileName(this, _browseTitle,
|
||||
defaultPath);
|
||||
} else if (_type == FileSelection::Type::READ) {
|
||||
path = QFileDialog::getOpenFileName(this, "", defaultPath);
|
||||
path = QFileDialog::getOpenFileName(this, _browseTitle,
|
||||
defaultPath);
|
||||
} else {
|
||||
path = QFileDialog::getExistingDirectory(this, "", defaultPath);
|
||||
path = QFileDialog::getExistingDirectory(this, _browseTitle,
|
||||
defaultPath);
|
||||
}
|
||||
|
||||
if (path.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public:
|
|||
|
||||
EXPORT
|
||||
FileSelection(FileSelection::Type type = FileSelection::Type::READ,
|
||||
QWidget *parent = 0);
|
||||
QWidget *parent = 0, const QString &browseTitle = "");
|
||||
EXPORT void SetPath(const StringVariable &);
|
||||
EXPORT void SetPath(const QString &);
|
||||
EXPORT QString GetPath() const;
|
||||
|
|
@ -34,6 +34,7 @@ signals:
|
|||
|
||||
private:
|
||||
Type _type;
|
||||
QString _browseTitle;
|
||||
VariableLineEdit *_filePath;
|
||||
QPushButton *_browseButton;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ MacroSegmentScriptInlineEdit::MacroSegmentScriptInlineEdit(
|
|||
_scriptType(new QComboBox(this)),
|
||||
_language(new QComboBox(this)),
|
||||
_script(new ScriptEditor(this)),
|
||||
_path(new FileSelection(FileSelection::Type::WRITE, this)),
|
||||
_path(new FileSelection(
|
||||
FileSelection::Type::WRITE, this,
|
||||
obs_module_text("AdvSceneSwitcher.script.file.select"))),
|
||||
_openFile(new QPushButton(
|
||||
obs_module_text("AdvSceneSwitcher.script.file.open"), this)),
|
||||
_fileLayout(new QHBoxLayout()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user