Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recent Scening toolbar and workflow issues #65

Merged
merged 4 commits into from Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion vspreview/main/timeline.py
Expand Up @@ -269,7 +269,7 @@ def mouseMoveEvent(self, event: QMouseEvent) -> None:
for notch in notches:
line = notch.line
if line.x1() - 0.5 <= event.pos().x() <= line.x1() + 0.5:
QToolTip.showText(event.globalPosition(), notch.label)
QToolTip.showText(event.globalPosition().toPoint(), notch.label)
return

def resizeEvent(self, event: QResizeEvent) -> None:
Expand Down
25 changes: 14 additions & 11 deletions vspreview/toolbars/scening/dialog.py
Expand Up @@ -85,9 +85,8 @@ def on_current_frame_changed(self, frame: Frame, time: Time) -> None:
selection.select(index, index)
self.tableview.selectionModel().select(
selection,
QItemSelectionModel.SelectionFlags(
QItemSelectionModel.Rows + QItemSelectionModel.ClearAndSelect
)
QItemSelectionModel.SelectionFlag.Rows
| QItemSelectionModel.SelectionFlag.ClearAndSelect
)

def on_current_list_changed(self, scening_list: SceningList | None = None) -> None:
Expand Down Expand Up @@ -121,8 +120,10 @@ def on_end_frame_changed(self, value: Frame | int) -> None:

frame = Frame(value)

index = self.tableview.selectionModel().selectedRows()[0]

try:
Setsugennoao marked this conversation as resolved.
Show resolved Hide resolved
index = self.tableview.selectionModel().selectedRows()[0]
except IndexError:
return
if not index.isValid():
return
index = index.siblingAtColumn(SceningList.END_FRAME_COLUMN)
Expand All @@ -133,9 +134,10 @@ def on_end_frame_changed(self, value: Frame | int) -> None:
def on_end_time_changed(self, time: Time) -> None:
if self.tableview.selectionModel() is None:
return

index = self.tableview.selectionModel().selectedRows()[0]

try:
index = self.tableview.selectionModel().selectedRows()[0]
except IndexError:
return
if not index.isValid():
return
index = index.siblingAtColumn(SceningList.END_TIME_COLUMN)
Expand All @@ -146,9 +148,10 @@ def on_end_time_changed(self, time: Time) -> None:
def on_label_changed(self, text: str) -> None:
if self.tableview.selectionModel() is None:
return

index = self.tableview.selectionModel().selectedRows()[0]

try:
index = self.tableview.selectionModel().selectedRows()[0]
except IndexError:
return
if not index.isValid():
return
index = self.scening_list.index(index.row(), SceningList.LABEL_COLUMN)
Expand Down
2 changes: 1 addition & 1 deletion vspreview/toolbars/scening/toolbar.py
Expand Up @@ -318,7 +318,7 @@ def on_seek_to_next_clicked(self, checked: bool | None = None) -> None:
def on_add_single_frame_clicked(self, checked: bool | None = None) -> None:
if self.current_list is None:
self.on_add_list_clicked()
cast(SceningList, self.current_list).add(self.main.current_output.last_showed_frame)
cast(SceningList, self.current_list).add(self.main.current_output.last_showed_frame, label=self.label_lineedit.text())
self.check_remove_export_possibility()

def on_add_to_list_clicked(self, checked: bool | None = None) -> None:
Expand Down