mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-17 20:44:32 -04:00
feat: Add saving and loading chat history
* feat: Add chat history path * feat: Add save and load chat * fix: Change badge width calculation * refactor: Move chat action to top * feat: Add autosave of messageReceived * feat: Add settings for autosave
This commit is contained in:
@ -29,10 +29,6 @@ namespace QodeAssist::Chat {
|
||||
class ChatRootView : public QQuickItem
|
||||
{
|
||||
Q_OBJECT
|
||||
// Possibly Qt bug: QTBUG-131004
|
||||
// The class type name must be fully qualified
|
||||
// including the namespace.
|
||||
// Otherwise qmlls can't find it.
|
||||
Q_PROPERTY(QodeAssist::Chat::ChatModel *chatModel READ chatModel NOTIFY chatModelChanged FINAL)
|
||||
Q_PROPERTY(QString currentTemplate READ currentTemplate NOTIFY currentTemplateChanged FINAL)
|
||||
Q_PROPERTY(QColor backgroundColor READ backgroundColor CONSTANT FINAL)
|
||||
@ -57,6 +53,15 @@ public:
|
||||
|
||||
bool isSharingCurrentFile() const;
|
||||
|
||||
void saveHistory(const QString &filePath);
|
||||
void loadHistory(const QString &filePath);
|
||||
|
||||
Q_INVOKABLE void showSaveDialog();
|
||||
Q_INVOKABLE void showLoadDialog();
|
||||
|
||||
void autosave();
|
||||
QString getAutosaveFilePath() const;
|
||||
|
||||
public slots:
|
||||
void sendMessage(const QString &message, bool sharingCurrentFile = false) const;
|
||||
void copyToClipboard(const QString &text);
|
||||
@ -75,12 +80,16 @@ private:
|
||||
float saturationMod,
|
||||
float lightnessMod);
|
||||
|
||||
QString getChatsHistoryDir() const;
|
||||
QString getSuggestedFileName() const;
|
||||
|
||||
ChatModel *m_chatModel;
|
||||
ClientInterface *m_clientInterface;
|
||||
QString m_currentTemplate;
|
||||
QColor m_primaryColor;
|
||||
QColor m_secondaryColor;
|
||||
QColor m_codeColor;
|
||||
QString m_recentFilePath;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Chat
|
||||
|
Reference in New Issue
Block a user