Skip to content

Commit

Permalink
gui: fix regression of options
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Mar 3, 2025
1 parent 06bcb41 commit 9a077fa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion libresvip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os

__version__ = "1.9.0"
__version__ = "1.9.1"
os.environ.setdefault("LOGURU_AUTOINIT", "false")
2 changes: 1 addition & 1 deletion libresvip/plugins/ass/ass_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def lyric_included(self, lyric: str) -> bool:
else:
return True

def commit_current_lyric_line(self, lyric_lines: list[SSAEvent], buffer: list[Note]) -> None:
def commit_current_lyric_line(self, lyric_lines: SSAFile, buffer: list[Note]) -> None:
start_time = int(self.synchronizer.get_actual_secs_from_ticks(buffer[0].start_pos) * 1000)
end_time = int(self.synchronizer.get_actual_secs_from_ticks(buffer[-1].end_pos) * 1000)
lyrics = "".join(
Expand Down
2 changes: 1 addition & 1 deletion libresvip/plugins/srt/srt_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def lyric_included(self, lyric: str) -> bool:
else:
return True

def commit_current_lyric_line(self, lyric_lines: list[SSAEvent], buffer: list[Note]) -> None:
def commit_current_lyric_line(self, lyric_lines: SSAFile, buffer: list[Note]) -> None:
start_time = int(self.synchronizer.get_actual_secs_from_ticks(buffer[0].start_pos) * 1000)
end_time = int(self.synchronizer.get_actual_secs_from_ticks(buffer[-1].end_pos) * 1000)
lyrics = "".join(
Expand Down
44 changes: 23 additions & 21 deletions libresvip/res/qml/components/converter_page.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Page {
RowLayout {
property var field: {}
property int index
property QtObject list_view
property QtObject list_model
height: 40
Layout.fillWidth: true
Label {
Expand All @@ -36,7 +36,7 @@ Page {
Layout.fillWidth: true
text: field.value
onEditingFinished: {
list_view.model.update(index, {
list_model.update(index, {
value: text
});
}
Expand All @@ -48,7 +48,7 @@ Page {
onClicked: {
dialogs.colorDialog.bind_color(colorField.text, color => {
colorField.text = color;
list_view.model.update(index, {
list_model.update(index, {
value: colorField.text
});
});
Expand All @@ -74,7 +74,7 @@ Page {
RowLayout {
property var field: {}
property int index
property QtObject list_view
property QtObject list_model
height: 40
Layout.fillWidth: true
Label {
Expand All @@ -90,7 +90,7 @@ Page {
this.checked = field.value;
}
onCheckedChanged: {
list_view.model.update(index, {
list_model.update(index, {
value: this.checked
});
}
Expand Down Expand Up @@ -121,7 +121,7 @@ Page {
id: comboBoxRow
property var field: {}
property int index
property QtObject list_view
property QtObject list_model
height: 40
Layout.fillWidth: true
Label {
Expand Down Expand Up @@ -171,7 +171,7 @@ Page {
this.currentIndex = indexOfValue(field.value);
}
onActivated: index => {
list_view.model.update(comboBoxRow.index, {
list_model.update(comboBoxRow.index, {
value: this.currentValue
});
}
Expand All @@ -197,7 +197,7 @@ Page {
RowLayout {
property var field: {}
property int index
property QtObject list_view
property QtObject list_model
height: 40
Layout.fillWidth: true
Label {
Expand All @@ -224,7 +224,7 @@ Page {
}
}
onEditingFinished: {
list_view.model.update(index, {
list_model.update(index, {
value: text
});
}
Expand Down Expand Up @@ -1158,7 +1158,7 @@ Page {
item = switchItem.createObject(middlewareContainer, {
"field": middleware_state,
"index": i,
"list_view": middlewareFields
"list_model": middlewareFields.model
});
break;
}
Expand All @@ -1167,7 +1167,7 @@ Page {
item = comboBoxItem.createObject(middlewareContainer, {
"field": middleware_state,
"index": i,
"list_view": middlewareFields
"list_model": middlewareFields.model
});
break;
}
Expand All @@ -1176,7 +1176,7 @@ Page {
item = colorPickerItem.createObject(middlewareContainer, {
"field": middleware_state,
"index": i,
"list_view": middlewareFields
"list_model": middlewareFields.model
});
break;
}
Expand All @@ -1185,7 +1185,7 @@ Page {
item = textFieldItem.createObject(middlewareContainer, {
"field": middleware_state,
"index": i,
"list_view": middlewareFields
"list_model": middlewareFields.model
});
break;
}
Expand Down Expand Up @@ -1337,13 +1337,14 @@ Page {
let separator_item = separatorItem.createObject(inputContainer);
this.Component.onDestruction.connect(separator_item.destroy);
let item = null;
let list_model = taskManager.qget("input_fields");
switch (modelData.type) {
case "bool":
{
item = switchItem.createObject(inputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": inputFields
"list_model": list_model
});
break;
}
Expand All @@ -1352,7 +1353,7 @@ Page {
item = comboBoxItem.createObject(inputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": inputFields
"list_model": list_model
});
break;
}
Expand All @@ -1361,7 +1362,7 @@ Page {
item = colorPickerItem.createObject(inputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": inputFields
"list_model": list_model
});
break;
}
Expand All @@ -1370,7 +1371,7 @@ Page {
item = textFieldItem.createObject(inputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": inputFields
"list_model": list_model
});
break;
}
Expand All @@ -1392,13 +1393,14 @@ Page {
let separator_item = separatorItem.createObject(outputContainer);
this.Component.onDestruction.connect(separator_item.destroy);
let item = null;
let list_model = taskManager.qget("output_fields");
switch (modelData.type) {
case "bool":
{
item = switchItem.createObject(outputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": outputFields
"list_model": list_model
});
break;
}
Expand All @@ -1407,7 +1409,7 @@ Page {
item = comboBoxItem.createObject(outputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": outputFields
"list_model": list_model
});
break;
}
Expand All @@ -1416,7 +1418,7 @@ Page {
item = colorPickerItem.createObject(outputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": outputFields
"list_model": list_model
});
break;
}
Expand All @@ -1425,7 +1427,7 @@ Page {
item = textFieldItem.createObject(outputContainer, {
"field": modelData,
"index": modelData.index,
"list_view": outputFields
"list_model": list_model
});
break;
}
Expand Down

0 comments on commit 9a077fa

Please sign in to comment.