aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Semke <[email protected]>2018-02-05 21:30:28 +0100
committerAlexander Semke <[email protected]>2018-02-05 21:30:28 +0100
commitd2bb5bbc44e23eadfdb21b772bd94222b29e9e42 (patch)
tree11cdf8116b8b04588fadcf402d66ad0c43581be2
parent6dea4b1b4668c2e712a10a28e8f3b61889e4a1d1 (diff)
When fetching the completion for R, Octave and Julia, login to the backend first if not done yet.
-rw-r--r--src/cantor_part.cpp1
-rw-r--r--src/worksheet.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/cantor_part.cpp b/src/cantor_part.cpp
index 4c41bdd..27c8bcc 100644
--- a/src/cantor_part.cpp
+++ b/src/cantor_part.cpp
@@ -581,6 +581,7 @@ void CantorPart::worksheetSessionLoginStarted() {
}
void CantorPart::worksheetSessionLoginDone() {
+ setStatusMessage(i18n("Ready"));
QApplication::restoreOverrideCursor();
}
diff --git a/src/worksheet.cpp b/src/worksheet.cpp
index ec0b33d..ebe28a1 100644
--- a/src/worksheet.cpp
+++ b/src/worksheet.cpp
@@ -470,6 +470,17 @@ bool Worksheet::completionEnabled()
void Worksheet::showCompletion()
{
+ //for backends which fetch the completion from the corresponding interpreter
+ //we need to do the login first.
+ //TODO: ideally, this logic is implemented in the actual session classes
+ //and the worksheet doesn't need to know anything about this.
+ //But as long as we have some additional logic in Worksheet::loginToSession(),
+ //we need to handle this here.
+ if (!m_loginDone && (m_session->backend()->name() == QLatin1String("Julia")
+ || m_session->backend()->name() == QLatin1String("R")
+ || m_session->backend()->name() == QLatin1String("Octave")) )
+ loginToSession();
+
WorksheetEntry* current = currentEntry();
current->showCompletion();
}