diff --git a/Changelog b/Changelog index 4d440e57..f678a304 100644 --- a/Changelog +++ b/Changelog @@ -1,7 +1,7 @@ 2024-02-?? Martin Dvorak * Released v2.0.0 - a major release that removes unused features - and brings several new features like Wingman + and brings several new features like Wingman. * Feature: Wingman brings OpenAI chat GPT integration allowing to compose, rewrite, summarize, do NER, fix, or chat with remarks. * Feature: Notebook Tree view brings ability to organize Notebooks to @@ -30,6 +30,8 @@ the list of Organizers. * Fix: Conflicting menu keyboard shortcuts resolution (e.g. Organizers view). * Fix: Edit and Format menus re-enabled on single Markdown file configuration. + * Upgrade: new version(s) of Qt with enhanced security support + added - Qt 5.15.2 LTS is supported on macOS and Windows. * Deprecation: dashboard view removed. * Deprecation: experimental Mitie (NER) code removed (replaced by LLM integration). diff --git a/FIX-IT.txt b/FIX-IT.txt deleted file mode 100644 index c164d809..00000000 --- a/FIX-IT.txt +++ /dev/null @@ -1 +0,0 @@ - $ mind
 libpng warning: iCCP: known incorrect sRGB profile
 libpng warning: iCCP: known incorrect sRGB profile
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsArxiv()
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsPandoc()
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsChatGpt()
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsWikipedia()
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsDocusaurus()
 QObject::connect: Cannot connect (null)::triggered() to m8r::MainWindowPresenter::doActionToolsDucDuckGo()
 diff --git a/app/src/qt/cli_n_breadcrumbs_presenter.cpp b/app/src/qt/cli_n_breadcrumbs_presenter.cpp index abdc94a3..18ccbdd5 100644 --- a/app/src/qt/cli_n_breadcrumbs_presenter.cpp +++ b/app/src/qt/cli_n_breadcrumbs_presenter.cpp @@ -61,21 +61,21 @@ void CliAndBreadcrumbsPresenter::handleCliTextChanged(const QString& text) // IMPROVE consider prefix,
separator and colors/bold "" "Use the following commands:" - "
" + "
"
                     "
? ... help" - "
/ ... search" + "
/ ... find" "
@ ... knowledge recherche" "
> ... run a command" //"
: ... chat with workspace, Notebook or Note" "
  ... or full-text search phrase" - "
" + "
" "
Examples:" - "
" - "
/ find notebook by tag TODO" - "
@ arxiv LLM" - "
> emojis" + "
"
+                    "
/notebook by tag TODO" + "
@arxiv LLM" + "
>emojis" //"
: explain in simple terms SELECTED" - "
" + "
" ) ); view->setCommand(""); @@ -183,20 +183,35 @@ void CliAndBreadcrumbsPresenter::executeCommand() // mainPresenter->getStatusBar()->showInfo(tr("Notebook ")+QString::fromStdString(outlines->front()->getName())); // mainPresenter->getStatusBar()->showInfo(tr("Notebook not found: ") += QString(name.c_str())); return; - } else if(command.startsWith(CliAndBreadcrumbsView::CMD_KNOW_WIKIPEDIA)) { - string name = command.toStdString().substr( - CliAndBreadcrumbsView::CMD_KNOW_WIKIPEDIA.size()); - MF_DEBUG(" executing: knowledge recherche of '" << name << "' @ wikipedia" << endl); - if(name.size()) { - QString phrase=QString::fromStdString(name); - // TODO choose tool - mainPresenter->doActionOpenRunToolDialog(phrase); - } else { - mainPresenter->getStatusBar()->showInfo(tr("Please specify a search phrase - it cannot be empty")); + } else + // knowledge lookup in the CLI: + // - @wikipedia ... opens tool dialog with Wikipedi SELECTED in the dropdown + // - @wikipedia llm ... opens directly https://wikipedia.org + if(command.startsWith(CliAndBreadcrumbsView::CHAR_KNOW)) { + for(auto c:CliAndBreadcrumbsView::HELP_KNOW_CMDS) { + QString toolName = command.mid(1, c.size()-1); + if(command.startsWith(c)) { + QString phrase = command.mid(1, c.size()); + MF_DEBUG( + " executing: knowledge recherche of '" + << phrase.toStdString() + << "' using command '" + << c.toStdString() << "' and tool '" + << toolName.toStdString() << "'" << endl); + if(phrase.size() > 1 && phrase.startsWith(" ")) { + phrase = phrase.mid(1); + mainPresenter->doActionOpenRunToolDialog(phrase, toolName, false); + mainPresenter->handleRunTool(); + } else { + // search phrase is empty + mainPresenter->doActionOpenRunToolDialog(phrase, toolName); + } + return; + } } - return; + // ELSE: unknown @unknown knowledge recherche tool do FTS as fallback + mainPresenter->getStatusBar()->showInfo(tr("Unknown knowledge recherche source - use valid source like @wikipedia")); } else { - // do FTS as fallback mainPresenter->doFts(view->getCommand(), true); } } else { diff --git a/app/src/qt/cli_n_breadcrumbs_view.cpp b/app/src/qt/cli_n_breadcrumbs_view.cpp index 804dfeb6..61319f3c 100644 --- a/app/src/qt/cli_n_breadcrumbs_view.cpp +++ b/app/src/qt/cli_n_breadcrumbs_view.cpp @@ -152,12 +152,13 @@ const QString CliAndBreadcrumbsView::CMD_KNOW_DUCK = "@duckduckgo"; const QString CliAndBreadcrumbsView::CMD_KNOW_GITHUB = "@github"; -const QString CliAndBreadcrumbsView::CMD_KNOW_BARD - = "@bard"; const QStringList CliAndBreadcrumbsView::HELP_KNOW_CMDS = QStringList() -// << CMD_KNOW_WIKIPEDIA -// << CMD_KNOW_ARXIV + << CMD_KNOW_WIKIPEDIA + << CMD_KNOW_ARXIV + << CMD_KNOW_STACK_OVERFLOW + << CMD_KNOW_DUCK + << CMD_KNOW_GITHUB ; const QString CliAndBreadcrumbsView::CHAR_CMD diff --git a/app/src/qt/dialogs/configuration_dialog.cpp b/app/src/qt/dialogs/configuration_dialog.cpp index 6bc0f73e..8ffba9c7 100644 --- a/app/src/qt/dialogs/configuration_dialog.cpp +++ b/app/src/qt/dialogs/configuration_dialog.cpp @@ -159,7 +159,9 @@ ConfigurationDialog::AppTab::AppTab(QWidget *parent) appearanceLayout->addWidget(appFontSizeSpin); appearanceLayout->addWidget(menuLabel); appearanceLayout->addWidget(nerdMenuCheck); - QGroupBox* appearanceGroup = new QGroupBox{tr("Appearance"), this}; + QGroupBox* appearanceGroup = new QGroupBox{ + tr("Appearance (requires restart)"), + this}; appearanceGroup->setLayout(appearanceLayout); QVBoxLayout* controlsLayout = new QVBoxLayout{this}; diff --git a/app/src/qt/dialogs/run_tool_dialog.cpp b/app/src/qt/dialogs/run_tool_dialog.cpp index 4a3ccb0e..a4ff2a25 100644 --- a/app/src/qt/dialogs/run_tool_dialog.cpp +++ b/app/src/qt/dialogs/run_tool_dialog.cpp @@ -89,7 +89,7 @@ RunToolDialog::RunToolDialog(QWidget* parent) ); // dialog - setWindowTitle(tr("Get Knowledge")); + setWindowTitle(tr("Retrieve Knowledge")); resize(fontMetrics().averageCharWidth()*55, height()); setModal(true); } diff --git a/app/src/qt/dialogs/run_tool_dialog.h b/app/src/qt/dialogs/run_tool_dialog.h index b9dc5c52..8f0d488c 100644 --- a/app/src/qt/dialogs/run_tool_dialog.h +++ b/app/src/qt/dialogs/run_tool_dialog.h @@ -61,6 +61,12 @@ class RunToolDialog : public QDialog this->toolCombo->currentIndex() ); } + void setSelectedTool(QString toolName) { + int index = this->toolCombo->findText(toolName); + if(index != -1) { + this->toolCombo->setCurrentIndex(index); + } + } QString getTemplateText() const { return this->templateEdit->text(); } diff --git a/app/src/qt/main_window_presenter.cpp b/app/src/qt/main_window_presenter.cpp index 900c69fb..0c422332 100644 --- a/app/src/qt/main_window_presenter.cpp +++ b/app/src/qt/main_window_presenter.cpp @@ -1796,10 +1796,14 @@ void MainWindowPresenter::doActionEditPasteImageData(QImage image) injectImageLinkToEditor(path, QString{"image"}); } -void MainWindowPresenter::doActionOpenRunToolDialog(QString& phrase) -{ +void MainWindowPresenter::doActionOpenRunToolDialog( + QString& phrase, + QString& toolName, + bool openDialog +) { MF_DEBUG("SIGNAL handled: open run tool dialog..."); this->runToolDialog->setPhraseText(phrase); + this->runToolDialog->setSelectedTool(toolName); QString templateText = this->runToolDialog->getTemplateTextForToolName( this->runToolDialog->getSelectedTool().toStdString()); if(templateText.length() == 0) { @@ -1807,7 +1811,9 @@ void MainWindowPresenter::doActionOpenRunToolDialog(QString& phrase) } this->runToolDialog->setTemplateText(templateText); - this->runToolDialog->show(); + if(openDialog) { + this->runToolDialog->show(); + } } void MainWindowPresenter::handleRunTool() @@ -3101,7 +3107,6 @@ void MainWindowPresenter::selectNoteInOutlineTree(Note* note, Outline::Patch& pa { QModelIndex idx; if(orloj->isFacetActive(OrlojPresenterFacets::FACET_MAP_OUTLINES)) { - QModelIndex idx; if(onUp) { idx = orloj->getOutlinesMap()->getModel()->index(patch.start, 0); } else { @@ -3110,7 +3115,6 @@ void MainWindowPresenter::selectNoteInOutlineTree(Note* note, Outline::Patch& pa orloj->getOutlinesMap()->getView()->setCurrentIndex(idx); } else { - QModelIndex idx; if(onUp) { idx = orloj->getOutlineView()->getOutlineTree()->getView()->model()->index(patch.start, 0); } else { diff --git a/app/src/qt/main_window_presenter.h b/app/src/qt/main_window_presenter.h index 139c5e70..70969796 100644 --- a/app/src/qt/main_window_presenter.h +++ b/app/src/qt/main_window_presenter.h @@ -362,7 +362,7 @@ public slots: void doActionEditFindAgain(); void doActionEditWordWrapToggle(); void doActionEditPasteImageData(QImage image); - void doActionOpenRunToolDialog(QString& phrase); + void doActionOpenRunToolDialog(QString& phrase, QString& tool, bool showDialog=true); void handleRunTool(); void doActionToggleLiveNotePreview(); void doActionNameDescFocusSwap();