mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-18 16:17:23 -05:00
Adjust to FilterComboBox
This commit is contained in:
parent
d9c1ef4c22
commit
78d73af589
|
|
@ -38,7 +38,7 @@ void MacroSelection::SetCurrentMacro(const MacroRef ¯o)
|
|||
{
|
||||
auto m = macro.GetMacro();
|
||||
if (!m) {
|
||||
this->setCurrentIndex(0);
|
||||
this->setCurrentIndex(-1);
|
||||
} else {
|
||||
this->setCurrentText(QString::fromStdString(m->Name()));
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ void MacroSelection::MacroRemove(const QString &name)
|
|||
return;
|
||||
}
|
||||
removeItem(idx);
|
||||
setCurrentIndex(0);
|
||||
setCurrentIndex(-1);
|
||||
}
|
||||
|
||||
void MacroSelection::MacroRename(const QString &oldName, const QString &newName)
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ void ConnectionSelection::SetConnection(const std::string &con)
|
|||
if (!!GetConnectionByName(con)) {
|
||||
_selection->setCurrentText(QString::fromStdString(con));
|
||||
} else {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ void ConnectionSelection::SetConnection(
|
|||
if (connection) {
|
||||
SetConnection(connection->Name());
|
||||
} else {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void ItemSelection::SetItem(const std::string &item)
|
|||
if (!!GetItemByName(item, _items)) {
|
||||
_selection->setCurrentText(QString::fromStdString(item));
|
||||
} else {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ void ItemSelection::ChangeSelection(const QString &sel)
|
|||
auto item = _create();
|
||||
bool accepted = _askForSettings(this, *item.get());
|
||||
if (!accepted) {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
return;
|
||||
}
|
||||
_items.emplace_back(item);
|
||||
|
|
|
|||
|
|
@ -84,28 +84,20 @@ void TransitionSelectionWidget::SetTransition(TransitionSelection &t)
|
|||
// 2. Current transition
|
||||
// 4. Transitions
|
||||
|
||||
int idx;
|
||||
|
||||
switch (t.GetType()) {
|
||||
case TransitionSelection::Type::TRANSITION:
|
||||
setCurrentText(QString::fromStdString(t.ToString()));
|
||||
break;
|
||||
case TransitionSelection::Type::CURRENT:
|
||||
idx = findText(QString::fromStdString(
|
||||
obs_module_text("AdvSceneSwitcher.currentTransition")));
|
||||
if (idx != -1) {
|
||||
setCurrentIndex(idx);
|
||||
}
|
||||
setCurrentIndex(findText(QString::fromStdString(obs_module_text(
|
||||
"AdvSceneSwitcher.currentTransition"))));
|
||||
break;
|
||||
case TransitionSelection::Type::ANY:
|
||||
idx = findText(QString::fromStdString(
|
||||
obs_module_text("AdvSceneSwitcher.anyTransition")));
|
||||
if (idx != -1) {
|
||||
setCurrentIndex(idx);
|
||||
}
|
||||
setCurrentIndex(findText(QString::fromStdString(
|
||||
obs_module_text("AdvSceneSwitcher.anyTransition"))));
|
||||
break;
|
||||
default:
|
||||
setCurrentIndex(0);
|
||||
setCurrentIndex(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -116,7 +108,7 @@ void TransitionSelectionWidget::Repopulate(bool current, bool any)
|
|||
const QSignalBlocker blocker(this);
|
||||
clear();
|
||||
PopulateTransitionSelection(this, current, any);
|
||||
setCurrentIndex(0);
|
||||
setCurrentIndex(-1);
|
||||
}
|
||||
TransitionSelection t;
|
||||
emit TransitionChanged(t);
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ void VariableSelection::SetVariable(const std::string &variable)
|
|||
if (!!GetVariableByName(variable)) {
|
||||
_selection->setCurrentText(QString::fromStdString(variable));
|
||||
} else {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ void VariableSelection::SetVariable(const std::weak_ptr<Variable> &variable_)
|
|||
if (var) {
|
||||
SetVariable(var->Name());
|
||||
} else {
|
||||
_selection->setCurrentIndex(0);
|
||||
_selection->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user