Skip to content

Commit

Permalink
Fixin non-initialized OpenAI model #1514; fixing knowledge navigator …
Browse files Browse the repository at this point in the history
…undesired menu pop-up
  • Loading branch information
dvorka committed Jan 29, 2024
1 parent 8082754 commit 2fc8c7e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
23 changes: 14 additions & 9 deletions app/src/qt/main_menu_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView)
#endif
mainWindow
);
actionOrganizerFocusPrevious->setStatusTip(tr("Move focus to previous column or quandrant..."));
actionOrganizerFocusPrevious->setStatusTip(tr("Move focus to previous column or quadrant..."));

actionOrganizerFocusNext = new QAction(
QIcon(":/menu-icons/right.svg"),
Expand All @@ -477,7 +477,7 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView)
#endif
mainWindow
);
actionOrganizerFocusNext->setStatusTip(tr("Move focus to next column or quandrant..."));
actionOrganizerFocusNext->setStatusTip(tr("Move focus to next column or quadrant..."));

menuOrganizer->addAction(actionOrganizerNew);
menuOrganizer->addAction(actionOrganizerEdit);
Expand Down Expand Up @@ -1092,7 +1092,6 @@ void MainMenuView::showAllMenuItems()
actionOrganizerMovePrevious->setEnabled(true);
actionOrganizerMoveNext->setEnabled(true);

menuNavigator->show();
menuNavigator->setEnabled(true);
actionViewOrganizers->setEnabled(true);
actionOutlineEdit->setEnabled(true);
Expand Down Expand Up @@ -1195,7 +1194,7 @@ void MainMenuView::showFacetOrganizerList(bool repositoryMode, bool mfMode)
actionOrganizerMoveNext->setEnabled(false);

submenuMindLibrary->setEnabled(false);
menuNavigator->setEnabled(false); menuNavigator->setVisible(false);
menuNavigator->setEnabled(false);
menuOutline->setEnabled(false);
menuNote->setEnabled(false);
menuEdit->setEnabled(false);
Expand All @@ -1210,7 +1209,7 @@ void MainMenuView::showFacetOrganizerView(bool repositoryMode, bool mfMode)
showAllMenuItems();

submenuMindLibrary->setEnabled(false);
menuNavigator->setEnabled(false); menuNavigator->hide();
menuNavigator->setEnabled(false);
menuOutline->setEnabled(false);
menuNote->setEnabled(false);
menuEdit->setEnabled(false);
Expand All @@ -1224,7 +1223,7 @@ void MainMenuView::showFacetOutlineList(bool repositoryMode, bool mfMode)
{
showAllMenuItems();

menuNavigator->setEnabled(false); menuNavigator->hide();
menuNavigator->setEnabled(false);
menuOrganizer->setEnabled(false);
menuEdit->setEnabled(false);
menuFormat->setEnabled(false);
Expand All @@ -1249,7 +1248,7 @@ void MainMenuView::showFacetOutlinesMap(bool repositoryMode, bool mfMode)
{
showAllMenuItems();

menuNavigator->setEnabled(false); menuNavigator->hide();
menuNavigator->setEnabled(false);
menuOrganizer->setEnabled(false);
menuEdit->setEnabled(false);
menuFormat->setEnabled(false);
Expand All @@ -1264,7 +1263,7 @@ void MainMenuView::showFacetOutlineView(bool repositoryMode, bool mfMode)
showAllMenuItems();

submenuMindLibrary->setEnabled(false);
menuNavigator->setEnabled(false); menuNavigator->hide();
menuNavigator->setEnabled(false);
menuOrganizer->setEnabled(false);
menuEdit->setEnabled(false);
menuFormat->setEnabled(false);
Expand Down Expand Up @@ -1312,7 +1311,7 @@ void MainMenuView::showFacetNoteEdit(bool repositoryMode, bool mfMode)
actionViewLimbo->setEnabled(false);
actionViewRecentNotes->setEnabled(false);

menuNavigator->setEnabled(false); menuNavigator->hide();
menuNavigator->setEnabled(false);
actionViewOrganizers->setEnabled(false);
actionOutlineEdit->setEnabled(false);
actionOutlineClone->setEnabled(false);
Expand Down Expand Up @@ -1365,6 +1364,12 @@ void MainMenuView::showFacetNavigator()
{
showAllMenuItems();

#ifdef MF_WIP
menuFlashcards->setEnabled(false);
#endif

menuOrganizer->setEnabled(false);
menuOutline->setEnabled(false);
menuNote->setEnabled(false);
menuEdit->setEnabled(false);
menuFormat->setEnabled(false);
Expand Down
5 changes: 4 additions & 1 deletion lib/src/config/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const string Configuration::DEFAULT_UI_THEME_NAME = string{UI_DEFAULT_THEME};
const string Configuration::DEFAULT_UI_HTML_CSS_THEME = string{UI_DEFAULT_HTML_CSS_THEME};
const string Configuration::DEFAULT_EDITOR_FONT= string{UI_DEFAULT_EDITOR_FONT};
const string Configuration::DEFAULT_TIME_SCOPE = string{"0y0m0d0h0m"};
const string Configuration::DEFAULT_WINGMAN_LLM_MODEL_OPENAI = string{"gpt-3.5-turbo"};

Configuration::Configuration()
: asyncMindThreshold{},
Expand All @@ -49,7 +50,7 @@ Configuration::Configuration()
autolinkingCaseInsensitive{},
wingmanProvider{DEFAULT_WINGMAN_LLM_PROVIDER},
wingmanApiKey{},
wingmanLlmModel{"gpt-3.5-turbo"},
wingmanLlmModel{DEFAULT_WINGMAN_LLM_MODEL_OPENAI},
md2HtmlOptions{},
distributorSleepInterval{DEFAULT_DISTRIBUTOR_SLEEP_INTERVAL},
markdownQuoteSections{},
Expand Down Expand Up @@ -430,6 +431,7 @@ bool Configuration::initWingmanOpenAi() {
const char* apiKeyEnv = std::getenv(ENV_VAR_OPENAI_API_KEY);
MF_DEBUG(" Wingman API key loaded from the env: " << apiKeyEnv << endl);
wingmanApiKey = apiKeyEnv;
wingmanLlmModel = DEFAULT_WINGMAN_LLM_MODEL_OPENAI;
wingmanProvider = WingmanLlmProviders::WINGMAN_PROVIDER_OPENAI;
return true;
}
Expand All @@ -438,6 +440,7 @@ bool Configuration::initWingmanOpenAi() {
" Wingman OpenAI API key NOT found in the environment variable "
"MINDFORGER_OPENAI_API_KEY" << endl);
wingmanApiKey.clear();
wingmanLlmModel.clear();
wingmanProvider = WingmanLlmProviders::WINGMAN_PROVIDER_NONE;
return false;
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class Configuration {

static const std::string DEFAULT_ACTIVE_REPOSITORY_PATH;
static const std::string DEFAULT_TIME_SCOPE;
static const std::string DEFAULT_WINGMAN_LLM_MODEL_OPENAI;

static constexpr const bool DEFAULT_AUTOLINKING = false;
static constexpr const bool DEFAULT_AUTOLINKING_COLON_SPLIT = true;
Expand Down

0 comments on commit 2fc8c7e

Please sign in to comment.