21 QMenu, |
21 QMenu, |
22 QVBoxLayout, |
22 QVBoxLayout, |
23 QWidget, |
23 QWidget, |
24 ) |
24 ) |
25 |
25 |
26 from eric7 import Globals |
|
27 from eric7.EricGui import EricPixmapCache |
26 from eric7.EricGui import EricPixmapCache |
28 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
27 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
29 from eric7.EricWidgets.EricApplication import ericApp |
28 from eric7.EricWidgets.EricApplication import ericApp |
30 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
29 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
|
30 |
|
31 try: |
|
32 from eric7.EricUtilities import getConfigDir |
|
33 except ImportError: |
|
34 # backward compatibility for eric < 24.10 |
|
35 from Globals import getConfigDir |
31 |
36 |
32 from .OllamaChatWidget import OllamaChatDialog, OllamaChatWidget |
37 from .OllamaChatWidget import OllamaChatDialog, OllamaChatWidget |
33 from .OllamaClient import OllamaClient |
38 from .OllamaClient import OllamaClient |
34 from .OllamaHistoryWidget import OllamaHistoryWidget |
39 from .OllamaHistoryWidget import OllamaHistoryWidget |
35 from .Ui_OllamaWidget import Ui_OllamaWidget |
40 from .Ui_OllamaWidget import Ui_OllamaWidget |
324 Private method to get the path name of the chat history file. |
329 Private method to get the path name of the chat history file. |
325 |
330 |
326 @return file path of the chat history file |
331 @return file path of the chat history file |
327 @rtype str |
332 @rtype str |
328 """ |
333 """ |
329 return os.path.join(Globals.getConfigDir(), OllamaWidget.OllamaHistoryFile) |
334 return os.path.join(getConfigDir(), OllamaWidget.OllamaHistoryFile) |
330 |
335 |
331 @pyqtSlot() |
336 @pyqtSlot() |
332 def __saveHistory(self): |
337 def __saveHistory(self): |
333 """ |
338 """ |
334 Private method to save the current chat history to the history file. |
339 Private method to save the current chat history to the history file. |