87 Private method to add an entry to the history. |
87 Private method to add an entry to the history. |
88 |
88 |
89 @param txt text to be added to the history (string) |
89 @param txt text to be added to the history (string) |
90 """ |
90 """ |
91 # Only add the entry, if it is not the same as last time |
91 # Only add the entry, if it is not the same as last time |
92 if len(self.__historyList) == 1 or \ |
92 if ( |
93 (len(self.__historyList) > 1 and self.__historyList[1] != txt): |
93 len(self.__historyList) == 1 or |
|
94 (len(self.__historyList) > 1 and self.__historyList[1] != txt) |
|
95 ): |
94 # Replace empty first entry and add new empty first entry |
96 # Replace empty first entry and add new empty first entry |
95 self.__historyList[0] = txt |
97 self.__historyList[0] = txt |
96 self.__historyList.insert(0, "") |
98 self.__historyList.insert(0, "") |
97 # Keep history below the defined limit |
99 # Keep history below the defined limit |
98 del self.__historyList[IrcMessageEdit.MaxHistory:] |
100 del self.__historyList[IrcMessageEdit.MaxHistory:] |