Browse Source

UI: Fix remux dialog ignoring filename changes

Anthony Torres 6 years ago
parent
commit
7ddab80d80
2 changed files with 8 additions and 0 deletions
  1. 6 0
      UI/window-remux.cpp
  2. 2 0
      UI/window-remux.hpp

+ 6 - 0
UI/window-remux.cpp

@@ -150,6 +150,7 @@ void RemuxEntryPathItemDelegate::setEditorData(QWidget *editor,
 {
 	QLineEdit *text = editor->findChild<QLineEdit *>();
 	text->setText(index.data().toString());
+	QObject::connect(text, SIGNAL(textEdited(QString)), this, SLOT(updateText()));
 	editor->setProperty(PATH_LIST_PROP, QVariant());
 }
 
@@ -257,6 +258,11 @@ void RemuxEntryPathItemDelegate::handleClear(QWidget *container)
 	emit commitData(container);
 }
 
+void RemuxEntryPathItemDelegate::updateText() {
+	QLineEdit *lineEdit = dynamic_cast<QLineEdit*>(sender());
+	QWidget *editor = lineEdit->parentWidget();
+	emit commitData(editor);
+}
 
 /**********************************************************
   Model - Manages the queue's data

+ 2 - 0
UI/window-remux.hpp

@@ -189,4 +189,6 @@ private:
 	void handleBrowse(QWidget *container);
 	void handleClear(QWidget *container);
 
+private slots:
+	void updateText();
 };