|
42 | 42 | from PyQt5.QtWidgets import (
|
43 | 43 | QWidget, QGraphicsScene,
|
44 | 44 | QMessageBox, QDialog, QColorDialog, QFontDialog,
|
45 |
| - QPushButton, QTextEdit, QLabel |
| 45 | + QPushButton, QLineEdit, QLabel |
46 | 46 | )
|
47 | 47 |
|
48 | 48 | import openshot
|
@@ -137,8 +137,8 @@ def txtLine_changed(self, txtWidget):
|
137 | 137 | # Loop through child widgets (and remove them)
|
138 | 138 | text_list = []
|
139 | 139 | for child in self.settingsContainer.children():
|
140 |
| - if type(child) == QTextEdit and child.objectName() != "txtFileName": |
141 |
| - text_list.append(child.toPlainText()) |
| 140 | + if type(child) == QLineEdit and child.objectName() != "txtFileName": |
| 141 | + text_list.append(child.text()) |
142 | 142 |
|
143 | 143 | # Update text values in the SVG
|
144 | 144 | for i, node in enumerate(self.tspan_nodes):
|
@@ -238,7 +238,7 @@ def load_svg_template(self, filename_field=None):
|
238 | 238 | label.setToolTip(label_line_text)
|
239 | 239 |
|
240 | 240 | # create text editor for file name
|
241 |
| - self.txtFileName = QTextEdit(self) |
| 241 | + self.txtFileName = QLineEdit(self) |
242 | 242 | self.txtFileName.setObjectName("txtFileName")
|
243 | 243 |
|
244 | 244 | # If edit mode or reload, set file name
|
@@ -302,7 +302,7 @@ def load_svg_template(self, filename_field=None):
|
302 | 302 | label.setToolTip(label_line_text)
|
303 | 303 |
|
304 | 304 | # create text editor for each text element in title
|
305 |
| - widget = QTextEdit(_(text)) |
| 305 | + widget = QLineEdit(_(text)) |
306 | 306 | widget.setFixedHeight(28)
|
307 | 307 | widget.textChanged.connect(functools.partial(self.txtLine_changed, widget))
|
308 | 308 | layout.addRow(label, widget)
|
@@ -581,10 +581,10 @@ def accept(self):
|
581 | 581 |
|
582 | 582 | else:
|
583 | 583 | # Create new title (with unique name)
|
584 |
| - file_name = "%s.svg" % self.txtFileName.toPlainText().strip() |
| 584 | + file_name = "%s.svg" % self.txtFileName.text().strip() |
585 | 585 | file_path = os.path.join(info.TITLE_PATH, file_name)
|
586 | 586 |
|
587 |
| - if self.txtFileName.toPlainText().strip(): |
| 587 | + if self.txtFileName.text().strip(): |
588 | 588 | # Do we have unsaved changes?
|
589 | 589 | if os.path.exists(file_path) and not self.edit_file_path:
|
590 | 590 | ret = QMessageBox.question(
|
@@ -614,7 +614,7 @@ def btnAdvanced_clicked(self):
|
614 | 614 | s = get_app().get_settings()
|
615 | 615 | prog = s.get("title_editor")
|
616 | 616 | # Store filename field to display on reload
|
617 |
| - filename_text = self.txtFileName.toPlainText().strip() |
| 617 | + filename_text = self.txtFileName.text().strip() |
618 | 618 | try:
|
619 | 619 | # launch advanced title editor
|
620 | 620 | log.info("Advanced title editor command: %s", str([prog, self.filename]))
|
|
0 commit comments