Revert "UI: Disable hotkeys when a user is expected to type text"
This reverts commit f832d14220
.
Reverting this until we do more investigation. Currently, any text
that can be typed in a dialog requires the dialog to re-enable hotkeys
on destruction, which is frustrating. There has to be a better way.
master
parent
1df2789978
commit
da04907927
|
@ -376,7 +376,6 @@ void SourceTreeItem::EnterEditMode()
|
||||||
editor->installEventFilter(this);
|
editor->installEventFilter(this);
|
||||||
boxLayout->insertWidget(index, editor);
|
boxLayout->insertWidget(index, editor);
|
||||||
setFocusProxy(editor);
|
setFocusProxy(editor);
|
||||||
App()->DisableHotkeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SourceTreeItem::ExitEditMode(bool save)
|
void SourceTreeItem::ExitEditMode(bool save)
|
||||||
|
@ -416,7 +415,6 @@ void SourceTreeItem::ExitEditModeInternal(bool save)
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
boxLayout->insertWidget(index, label);
|
boxLayout->insertWidget(index, label);
|
||||||
label->setFocus();
|
label->setFocus();
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
|
|
||||||
/* ----------------------------------------- */
|
/* ----------------------------------------- */
|
||||||
/* check for empty string */
|
/* check for empty string */
|
||||||
|
|
|
@ -936,7 +936,6 @@ void OBSBasicFilters::EditItem(QListWidgetItem *item, bool async)
|
||||||
list->editItem(item);
|
list->editItem(item);
|
||||||
item->setFlags(flags);
|
item->setFlags(flags);
|
||||||
editActive = true;
|
editActive = true;
|
||||||
App()->DisableHotkeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicFilters::DuplicateItem(QListWidgetItem *item)
|
void OBSBasicFilters::DuplicateItem(QListWidgetItem *item)
|
||||||
|
@ -1108,7 +1107,6 @@ void OBSBasicFilters::FilterNameEdited(QWidget *editor, QListWidget *list)
|
||||||
listItem->setText(QString());
|
listItem->setText(QString());
|
||||||
SetupVisibilityItem(list, listItem, filter);
|
SetupVisibilityItem(list, listItem, filter);
|
||||||
editActive = false;
|
editActive = false;
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicFilters::AsyncFilterNameEdited(
|
void OBSBasicFilters::AsyncFilterNameEdited(
|
||||||
|
|
|
@ -67,7 +67,6 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
|
||||||
};
|
};
|
||||||
|
|
||||||
connect(ui->preview, &OBSQTDisplay::DisplayCreated, addDrawCallback);
|
connect(ui->preview, &OBSQTDisplay::DisplayCreated, addDrawCallback);
|
||||||
App()->DisableHotkeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OBSBasicInteraction::~OBSBasicInteraction()
|
OBSBasicInteraction::~OBSBasicInteraction()
|
||||||
|
@ -75,7 +74,6 @@ OBSBasicInteraction::~OBSBasicInteraction()
|
||||||
// since QT fakes a mouse movement while destructing a widget
|
// since QT fakes a mouse movement while destructing a widget
|
||||||
// remove our event filter
|
// remove our event filter
|
||||||
ui->preview->removeEventFilter(eventFilter.get());
|
ui->preview->removeEventFilter(eventFilter.get());
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OBSEventFilter *OBSBasicInteraction::BuildEventFilter()
|
OBSEventFilter *OBSBasicInteraction::BuildEventFilter()
|
||||||
|
|
|
@ -4831,7 +4831,6 @@ void OBSBasic::on_scenes_currentItemChanged(QListWidgetItem *current,
|
||||||
|
|
||||||
void OBSBasic::EditSceneName()
|
void OBSBasic::EditSceneName()
|
||||||
{
|
{
|
||||||
App()->DisableHotkeys();
|
|
||||||
ui->scenesDock->removeAction(renameScene);
|
ui->scenesDock->removeAction(renameScene);
|
||||||
QListWidgetItem *item = ui->scenes->currentItem();
|
QListWidgetItem *item = ui->scenes->currentItem();
|
||||||
Qt::ItemFlags flags = item->flags();
|
Qt::ItemFlags flags = item->flags();
|
||||||
|
@ -5065,9 +5064,7 @@ void OBSBasic::on_actionAddScene_triggered()
|
||||||
|
|
||||||
void OBSBasic::on_actionRemoveScene_triggered()
|
void OBSBasic::on_actionRemoveScene_triggered()
|
||||||
{
|
{
|
||||||
App()->DisableHotkeys();
|
|
||||||
RemoveSelectedScene();
|
RemoveSelectedScene();
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::ChangeSceneIndex(bool relative, int offset, int invalidIdx)
|
void OBSBasic::ChangeSceneIndex(bool relative, int offset, int invalidIdx)
|
||||||
|
@ -5757,8 +5754,6 @@ void OBSBasic::on_actionRemoveSource_triggered()
|
||||||
if (!confirmed)
|
if (!confirmed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
App()->DisableHotkeys();
|
|
||||||
|
|
||||||
/* ----------------------------------------------- */
|
/* ----------------------------------------------- */
|
||||||
/* save undo data */
|
/* save undo data */
|
||||||
|
|
||||||
|
@ -5789,7 +5784,6 @@ void OBSBasic::on_actionRemoveSource_triggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateSceneUndoRedoAction(action_name, undo_data, redo_data);
|
CreateSceneUndoRedoAction(action_name, undo_data, redo_data);
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::on_actionInteract_triggered()
|
void OBSBasic::on_actionInteract_triggered()
|
||||||
|
@ -6075,7 +6069,6 @@ static void RenameListItem(OBSBasic *parent, QListWidget *listWidget,
|
||||||
void OBSBasic::SceneNameEdited(QWidget *editor,
|
void OBSBasic::SceneNameEdited(QWidget *editor,
|
||||||
QAbstractItemDelegate::EndEditHint endHint)
|
QAbstractItemDelegate::EndEditHint endHint)
|
||||||
{
|
{
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
OBSScene scene = GetCurrentScene();
|
OBSScene scene = GetCurrentScene();
|
||||||
QLineEdit *edit = qobject_cast<QLineEdit *>(editor);
|
QLineEdit *edit = qobject_cast<QLineEdit *>(editor);
|
||||||
string text = QT_TO_UTF8(edit->text().trimmed());
|
string text = QT_TO_UTF8(edit->text().trimmed());
|
||||||
|
|
|
@ -214,8 +214,6 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
|
||||||
} else {
|
} else {
|
||||||
preview->hide();
|
preview->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
App()->DisableHotkeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OBSBasicProperties::~OBSBasicProperties()
|
OBSBasicProperties::~OBSBasicProperties()
|
||||||
|
@ -226,7 +224,6 @@ OBSBasicProperties::~OBSBasicProperties()
|
||||||
obs_source_dec_showing(source);
|
obs_source_dec_showing(source);
|
||||||
main->SaveProject();
|
main->SaveProject();
|
||||||
main->UpdateContextBar();
|
main->UpdateContextBar();
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicProperties::AddPreviewButton()
|
void OBSBasicProperties::AddPreviewButton()
|
||||||
|
|
|
@ -297,13 +297,11 @@ void OBSBasicSourceSelect::on_buttonBox_accepted()
|
||||||
obs_sceneitem_release(item);
|
obs_sceneitem_release(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
done(DialogCode::Accepted);
|
done(DialogCode::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicSourceSelect::on_buttonBox_rejected()
|
void OBSBasicSourceSelect::on_buttonBox_rejected()
|
||||||
{
|
{
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
done(DialogCode::Rejected);
|
done(DialogCode::Rejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,8 +376,6 @@ OBSBasicSourceSelect::OBSBasicSourceSelect(OBSBasic *parent, const char *id_,
|
||||||
} else {
|
} else {
|
||||||
obs_enum_sources(EnumSources, this);
|
obs_enum_sources(EnumSources, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
App()->DisableHotkeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicSourceSelect::SourcePaste(const char *name, bool visible, bool dup)
|
void OBSBasicSourceSelect::SourcePaste(const char *name, bool visible, bool dup)
|
||||||
|
|
|
@ -67,7 +67,6 @@ bool NameDialog::AskForName(QWidget *parent, const QString &title,
|
||||||
const QString &text, std::string &userTextInput,
|
const QString &text, std::string &userTextInput,
|
||||||
const QString &placeHolder, int maxSize)
|
const QString &placeHolder, int maxSize)
|
||||||
{
|
{
|
||||||
App()->DisableHotkeys();
|
|
||||||
if (maxSize <= 0 || maxSize > 32767)
|
if (maxSize <= 0 || maxSize > 32767)
|
||||||
maxSize = 170;
|
maxSize = 170;
|
||||||
|
|
||||||
|
@ -85,7 +84,6 @@ bool NameDialog::AskForName(QWidget *parent, const QString &title,
|
||||||
}
|
}
|
||||||
userTextInput = dialog.userText->text().toUtf8().constData();
|
userTextInput = dialog.userText->text().toUtf8().constData();
|
||||||
CleanWhitespace(userTextInput);
|
CleanWhitespace(userTextInput);
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +94,6 @@ bool NameDialog::AskForNameWithOption(QWidget *parent, const QString &title,
|
||||||
bool &optionChecked,
|
bool &optionChecked,
|
||||||
const QString &placeHolder)
|
const QString &placeHolder)
|
||||||
{
|
{
|
||||||
App()->DisableHotkeys();
|
|
||||||
NameDialog dialog(parent);
|
NameDialog dialog(parent);
|
||||||
dialog.setWindowTitle(title);
|
dialog.setWindowTitle(title);
|
||||||
|
|
||||||
|
@ -113,6 +110,5 @@ bool NameDialog::AskForNameWithOption(QWidget *parent, const QString &title,
|
||||||
userTextInput = dialog.userText->text().toUtf8().constData();
|
userTextInput = dialog.userText->text().toUtf8().constData();
|
||||||
CleanWhitespace(userTextInput);
|
CleanWhitespace(userTextInput);
|
||||||
optionChecked = dialog.checkbox->isChecked();
|
optionChecked = dialog.checkbox->isChecked();
|
||||||
App()->UpdateHotkeyFocusSetting();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue