|
12 | 12 | QEasingCurve
|
13 | 13 | from PySide6.QtGui import QPixmap, QIcon, QTextCursor, QTextOption, Qt, QDesktopServices
|
14 | 14 |
|
15 |
| -from interpreter import interpreter |
| 15 | +# from interpreter import interpreter |
| 16 | +from src.plugins.openinterpreter.src import interpreter |
16 | 17 |
|
17 | 18 | from src.utils.helpers import path_to_pixmap, display_message_box, get_avatar_paths_from_config, \
|
18 | 19 | get_member_name_from_config, apply_alpha_to_hex, split_lang_and_code, try_parse_json, block_signals, display_message
|
@@ -501,7 +502,7 @@ def set_message(self, message):
|
501 | 502 | button_v_layout.addWidget(self.btn_goto_tool)
|
502 | 503 |
|
503 | 504 | is_runnable = message.role in ('code', 'tool')
|
504 |
| - if is_runnable: |
| 505 | + if is_runnable and not hasattr(self, 'btn_rerun'): |
505 | 506 | self.btn_rerun = self.RerunButton(self)
|
506 | 507 | self.btn_countdown = self.CountdownButton(self)
|
507 | 508 | countdown_h_layout = CHBoxLayout()
|
@@ -561,25 +562,37 @@ def view_log(self, _):
|
561 | 562 |
|
562 | 563 | def enterEvent(self, event):
|
563 | 564 | self.check_and_toggle_buttons()
|
| 565 | + # buttons = [ |
| 566 | + # 'btn_resend', |
| 567 | + # 'btn_rerun', |
| 568 | + # 'btn_goto_tool', |
| 569 | + # ] |
| 570 | + # for btn_name in buttons: |
| 571 | + # btn = getattr(self, btn_name, None) |
| 572 | + # if btn: |
| 573 | + # btn.setVisible(True) |
564 | 574 | super().enterEvent(event)
|
565 | 575 |
|
566 | 576 | def leaveEvent(self, event):
|
567 | 577 | self.check_and_toggle_buttons()
|
568 | 578 | super().leaveEvent(event)
|
569 | 579 |
|
570 | 580 | def check_and_toggle_buttons(self):
|
571 |
| - is_under_mouse = self.underMouse() |
572 | 581 | buttons = [
|
573 | 582 | 'btn_resend',
|
574 | 583 | 'btn_rerun',
|
575 | 584 | 'btn_goto_tool',
|
576 | 585 | ]
|
577 |
| - for btn_name in buttons: |
578 |
| - btn = getattr(self, btn_name, None) |
579 |
| - if btn: |
580 |
| - btn.setVisible(is_under_mouse) |
581 |
| - if hasattr(self, 'btn_countdown'): |
582 |
| - self.btn_countdown.reset_countdown() |
| 586 | + try: |
| 587 | + is_under_mouse = self.underMouse() |
| 588 | + for btn_name in buttons: |
| 589 | + btn = getattr(self, btn_name, None) |
| 590 | + if btn: |
| 591 | + btn.setVisible(is_under_mouse) |
| 592 | + if hasattr(self, 'btn_countdown'): |
| 593 | + self.btn_countdown.reset_countdown() |
| 594 | + except RuntimeError: |
| 595 | + pass |
583 | 596 |
|
584 | 597 | def start_new_branch(self):
|
585 | 598 | branch_msg_id = self.branch_msg_id
|
|
0 commit comments