mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-30 21:39:45 -05:00
Fix title of script open dialog
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user