diff --git a/qodeassist.cpp b/qodeassist.cpp index 8c4dcc5..4f7d214 100644 --- a/qodeassist.cpp +++ b/qodeassist.cpp @@ -108,8 +108,10 @@ public: UpdateDialog::checkForUpdatesAndShow(Core::ICore::mainWindow()); }); - m_chatOutputPane = new Chat::ChatOutputPane(this); - m_navigationPanel = new Chat::NavigationPanel(); + if (Settings::generalSettings().enableChat()) { + m_chatOutputPane = new Chat::ChatOutputPane(this); + m_navigationPanel = new Chat::NavigationPanel(); + } Settings::setupProjectPanel(); ConfigurationManager::instance().init(); diff --git a/settings/GeneralSettings.cpp b/settings/GeneralSettings.cpp index de886b2..ed5169d 100644 --- a/settings/GeneralSettings.cpp +++ b/settings/GeneralSettings.cpp @@ -66,6 +66,10 @@ GeneralSettings::GeneralSettings() enableCheckUpdate.setLabelText(TrConstants::ENABLE_CHECK_UPDATE_ON_START); enableCheckUpdate.setDefaultValue(true); + enableChat.setSettingsKey(Constants::ENABLE_CHAT); + enableChat.setLabelText(TrConstants::ENABLE_CHAT); + enableChat.setDefaultValue(true); + resetToDefaults.m_buttonText = TrConstants::RESET_TO_DEFAULTS; checkUpdate.m_buttonText = TrConstants::CHECK_UPDATE; @@ -196,6 +200,7 @@ GeneralSettings::GeneralSettings() Row{enableQodeAssist, Stretch{1}, Row{checkUpdate, resetToDefaults}}, Row{enableLogging, Stretch{1}}, Row{enableCheckUpdate, Stretch{1}}, + Row{enableChat, Stretch{1}}, Space{8}, ccGroup, Space{8}, diff --git a/settings/GeneralSettings.hpp b/settings/GeneralSettings.hpp index 51aecfc..f1b57de 100644 --- a/settings/GeneralSettings.hpp +++ b/settings/GeneralSettings.hpp @@ -36,6 +36,8 @@ public: Utils::BoolAspect enableQodeAssist{this}; Utils::BoolAspect enableLogging{this}; Utils::BoolAspect enableCheckUpdate{this}; + Utils::BoolAspect enableChat{this}; + ButtonAspect checkUpdate{this}; ButtonAspect resetToDefaults{this}; diff --git a/settings/SettingsConstants.hpp b/settings/SettingsConstants.hpp index 74336a5..a1ea181 100644 --- a/settings/SettingsConstants.hpp +++ b/settings/SettingsConstants.hpp @@ -60,6 +60,7 @@ const char ENABLE_QODE_ASSIST[] = "QodeAssist.enableQodeAssist"; const char CC_AUTO_COMPLETION[] = "QodeAssist.ccAutoCompletion"; const char ENABLE_LOGGING[] = "QodeAssist.enableLogging"; const char ENABLE_CHECK_UPDATE[] = "QodeAssist.enableCheckUpdate"; +const char ENABLE_CHAT[] = "QodeAssist.enableChat"; const char PROVIDER_PATHS[] = "QodeAssist.providerPaths"; const char СС_START_SUGGESTION_TIMER[] = "QodeAssist.startSuggestionTimer"; diff --git a/settings/SettingsTr.hpp b/settings/SettingsTr.hpp index 50a4c2c..b38f303 100644 --- a/settings/SettingsTr.hpp +++ b/settings/SettingsTr.hpp @@ -39,6 +39,9 @@ inline const char *TEST = QT_TRANSLATE_NOOP("QtC::QodeAssist", "Test"); inline const char *ENABLE_LOG = QT_TRANSLATE_NOOP("QtC::QodeAssist", "Enable Logging"); inline const char *ENABLE_CHECK_UPDATE_ON_START = QT_TRANSLATE_NOOP("QtC::QodeAssist", "Check for updates when Qt Creator starts"); +inline const char *ENABLE_CHAT = QT_TRANSLATE_NOOP( + "QtC::QodeAssist", + "Enable Chat(If you have performance issues try disabling this, need restart QtC)"); inline const char *CODE_COMPLETION = QT_TRANSLATE_NOOP("QtC::QodeAssist", "Code Completion"); inline const char *CHAT_ASSISTANT = QT_TRANSLATE_NOOP("QtC::QodeAssist", "Chat Assistant");