diff --git a/app/ui_pc/chat/chat_info.py b/app/ui_pc/chat/chat_info.py index 3df71d3..9e8e36a 100644 --- a/app/ui_pc/chat/chat_info.py +++ b/app/ui_pc/chat/chat_info.py @@ -39,7 +39,7 @@ class ChatInfo(QWidget): self.show_chat_thread = ShowChatThread(self.contact) self.show_chat_thread.showSingal.connect(self.add_message) self.show_chat_thread.finishSingal.connect(self.show_finish) - self.show_chat_thread.start() + # self.show_chat_thread.start() def show_finish(self, ok): self.setScrollBarPos() diff --git a/app/ui_pc/chat/chat_window.py b/app/ui_pc/chat/chat_window.py index e5a6ba1..a0cf7cd 100644 --- a/app/ui_pc/chat/chat_window.py +++ b/app/ui_pc/chat/chat_window.py @@ -58,6 +58,7 @@ class ChatWindow(QWidget, Ui_Form): self.contacts = [[], []] self.init_ui() self.show_chats() + self.visited = set() def init_ui(self): search_action = QAction(self.lineEdit) @@ -112,6 +113,10 @@ class ChatWindow(QWidget, Ui_Form): def setCurrentIndex(self, row): # print(row) self.stackedWidget.setCurrentIndex(row) + if row not in self.visited: + chat_info_window = self.stackedWidget.currentWidget() + chat_info_window.update_history_messages() + self.visited.add(row) def stop_loading(self, a0): # self.label.setVisible(False)