diff --git a/forms/advanced-scene-switcher.ui b/forms/advanced-scene-switcher.ui index be5ccc02..091e18eb 100644 --- a/forms/advanced-scene-switcher.ui +++ b/forms/advanced-scene-switcher.ui @@ -2198,10 +2198,20 @@ + + + + If the + + + + + + - If the file + file diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp index c9bae305..ad3b7865 100644 --- a/src/advanced-scene-switcher.cpp +++ b/src/advanced-scene-switcher.cpp @@ -289,6 +289,9 @@ void SceneSwitcher::loadUI() item->setData(Qt::UserRole, text); } + ui->fileType->addItem("local"); + ui->fileType->addItem("remote"); + for (auto &s : switcher->fileSwitches) { std::string sceneName = GetWeakSourceName(s.scene); std::string transitionName = GetWeakSourceName(s.transition); diff --git a/src/file-switch.cpp b/src/file-switch.cpp index 81e3a782..d193856c 100644 --- a/src/file-switch.cpp +++ b/src/file-switch.cpp @@ -2,8 +2,13 @@ #include #include #include +#include + #include "headers/advanced-scene-switcher.hpp" +#define LOCAL_FILE_IDX 0 +#define REMOTE_FILE_IDX 1 + void SceneSwitcher::on_browseButton_clicked() { QString path = QFileDialog::getOpenFileName( @@ -176,6 +181,15 @@ void SceneSwitcher::on_browseButton_3_clicked() ui->filePathLineEdit->setText(path); } +void SceneSwitcher::on_fileType_currentIndexChanged(int idx) { + if (idx == -1) + return; + if (idx == LOCAL_FILE_IDX) + ui->browseButton_3->setDisabled(false); + if (idx == REMOTE_FILE_IDX) + ui->browseButton_3->setDisabled(true); +} + void SceneSwitcher::on_fileAdd_clicked() { QString sceneName = ui->fileScenes->currentText(); diff --git a/src/headers/advanced-scene-switcher.hpp b/src/headers/advanced-scene-switcher.hpp index 37c031f4..05777e7c 100644 --- a/src/headers/advanced-scene-switcher.hpp +++ b/src/headers/advanced-scene-switcher.hpp @@ -104,6 +104,7 @@ public slots: void on_browseButton_clicked(); void on_readFileCheckBox_stateChanged(int state); + void on_fileType_currentIndexChanged(int idx); void on_readPathLineEdit_textChanged(const QString &text); void on_writePathLineEdit_textChanged(const QString &text); void on_browseButton_2_clicked(); diff --git a/src/headers/switcher-data-structs.hpp b/src/headers/switcher-data-structs.hpp index 67731df9..45e5d568 100644 --- a/src/headers/switcher-data-structs.hpp +++ b/src/headers/switcher-data-structs.hpp @@ -169,6 +169,7 @@ struct FileSwitch { OBSWeakSource transition; std::string file; std::string text; + bool local = true; bool useRegex = false; bool useTime = false; QDateTime lastMod;