Commit b45bc45f authored by Shubham  .'s avatar Shubham .
Browse files

Fix the signal slot connection

parent 7ef01c64
...@@ -41,6 +41,7 @@ QWidget* DocumentationPanelPlugin::widget() ...@@ -41,6 +41,7 @@ QWidget* DocumentationPanelPlugin::widget()
{ {
// find the default backend and then load it, currently hardcoding the values // find the default backend and then load it, currently hardcoding the values
m_widget = new DocumentationPanelWidget(QLatin1String("Maxima"), QLatin1String("maximabackend"), parentWidget()); m_widget = new DocumentationPanelWidget(QLatin1String("Maxima"), QLatin1String("maximabackend"), parentWidget());
connect(m_cantorShell, SIGNAL(requestDocumentation(QString)), m_widget, SLOT(contextSensitiveHelp(QString)));
} }
return m_widget; return m_widget;
...@@ -63,7 +64,7 @@ QString DocumentationPanelPlugin::backendName() const ...@@ -63,7 +64,7 @@ QString DocumentationPanelPlugin::backendName() const
void DocumentationPanelPlugin::connectToShell(QObject* cantorShell) void DocumentationPanelPlugin::connectToShell(QObject* cantorShell)
{ {
connect(cantorShell, SIGNAL(requestDocumentation(QString)), m_widget, SLOT(contextSensitiveHelp(QString))); m_cantorShell = cantorShell;
connect(cantorShell, SIGNAL(requestDocumentation(QString)), this, SIGNAL(visibilityRequested())); connect(cantorShell, SIGNAL(requestDocumentation(QString)), this, SIGNAL(visibilityRequested()));
} }
......
...@@ -53,6 +53,8 @@ class DocumentationPanelPlugin : public Cantor::PanelPlugin ...@@ -53,6 +53,8 @@ class DocumentationPanelPlugin : public Cantor::PanelPlugin
QPointer<DocumentationPanelWidget> m_widget; QPointer<DocumentationPanelWidget> m_widget;
QString m_backendName; QString m_backendName;
QString m_backendIcon; QString m_backendIcon;
QObject* m_cantorShell = nullptr;
}; };
#endif /* _DOCUMENTATIONPANELPLUGIN_H */ #endif /* _DOCUMENTATIONPANELPLUGIN_H */
...@@ -327,6 +327,7 @@ void DocumentationPanelWidget::updateBackend(const QString& backendName, const Q ...@@ -327,6 +327,7 @@ void DocumentationPanelWidget::updateBackend(const QString& backendName, const Q
// update the QComboBox to display all the docs for newly changed backend worksheet // update the QComboBox to display all the docs for newly changed backend worksheet
m_documentationSelector->addItem(QIcon::fromTheme(m_icon), m_backend); m_documentationSelector->addItem(QIcon::fromTheme(m_icon), m_backend);
// Since new documentation files have been loaded, now add the widgets again and refresh the display
m_displayArea->addWidget(m_engine->contentWidget()); m_displayArea->addWidget(m_engine->contentWidget());
m_displayArea->addWidget(m_textBrowser); m_displayArea->addWidget(m_textBrowser);
m_displayArea->addWidget(m_index); m_displayArea->addWidget(m_index);
...@@ -382,6 +383,7 @@ void DocumentationPanelWidget::returnPressed() ...@@ -382,6 +383,7 @@ void DocumentationPanelWidget::returnPressed()
void DocumentationPanelWidget::contextSensitiveHelp(const QString& keyword) void DocumentationPanelWidget::contextSensitiveHelp(const QString& keyword)
{ {
qDebug() << keyword;
// First make sure we have display browser as the current widget on the QStackedWidget // First make sure we have display browser as the current widget on the QStackedWidget
emit activateBrowser(); emit activateBrowser();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment