Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
cc2954d8
Commit
cc2954d8
authored
Jul 04, 2020
by
Shubham .
Browse files
Remove redundant code
parent
e29544d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/panelplugins/documentationpanel/documentationpanelplugin.cpp
View file @
cc2954d8
...
...
@@ -44,7 +44,6 @@ QWidget* DocumentationPanelPlugin::widget()
if
(
!
m_widget
)
{
m_widget
=
new
DocumentationPanelWidget
(
session
(),
parentWidget
());
qDebug
()
<<
backendName
();
connect
(
parent
()
->
parent
(),
SIGNAL
(
requestDocumentation
(
QString
)),
m_widget
,
SLOT
(
contextSensitiveHelp
(
QString
)));
connect
(
parent
()
->
parent
(),
SIGNAL
(
requestDocumentation
(
QString
)),
this
,
SIGNAL
(
visibilityRequested
()));
}
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.cpp
View file @
cc2954d8
...
...
@@ -80,12 +80,17 @@ DocumentationPanelWidget::DocumentationPanelWidget(Cantor::Session* session, QWi
m_tabWidget
->
addTab
(
container
,
i18n
(
"Search"
));
m_textBrowser
=
new
QWebEngineView
(
this
);
const
QByteArray
contents
=
m_engine
->
fileData
(
QUrl
(
QLatin1String
(
"qthelp://org.kde.cantor/doc/maxima.html#SEC_Top"
)));
// set initial page contents
m_textBrowser
->
setContent
(
contents
,
QLatin1String
(
"text/html;charset=UTF-8"
));
m_textBrowser
->
show
();
//const QByteArray contents = m_engine->fileData(QUrl(QLatin1String("qthelp://org.kde.cantor/doc/figures/plotting1.png")));
//m_textBrowser->setContent(contents, QLatin1String("image/png;charset=UTF-8"));
// set initial page contents, otherwise page is blank
QByteArray
contents
;
if
(
m_backend
==
QLatin1String
(
"Maxima"
))
contents
=
m_engine
->
fileData
(
QUrl
(
QLatin1String
(
"qthelp://org.kde.cantor/doc/maxima.html#SEC_Top"
)));
else
if
(
m_backend
==
QLatin1String
(
"Octave"
))
contents
=
m_engine
->
fileData
(
QUrl
(
QLatin1String
(
"qthelp://org.octave.interpreter-1.0/doc/octave.html/index.html"
)));
m_textBrowser
->
setContent
(
contents
,
QLatin1String
(
"text/html;charset=UTF-8"
));
m_textBrowser
->
hide
();
m_splitter
=
new
QSplitter
(
Qt
::
Horizontal
,
this
);
m_splitter
->
addWidget
(
m_tabWidget
);
...
...
@@ -113,7 +118,7 @@ void DocumentationPanelWidget::displayHelp(const QUrl& url)
m_textBrowser
->
show
();
qDebug
()
<<
url
;
//display the actual keyword contents, not the header topic
const
QModelIndex
index
=
m_engine
->
indexWidget
()
->
currentIndex
();
const
QString
indexText
=
index
.
data
(
Qt
::
DisplayRole
).
toString
();
qDebug
()
<<
indexText
<<
"index pressed"
;
...
...
@@ -143,12 +148,6 @@ void DocumentationPanelWidget::loadDocumentation()
m_engine
->
registerDocumentation
(
fileName
);
}
void
DocumentationPanelWidget
::
unloadDocumentation
()
{
//Call this function when the user changes the current backend
m_engine
->
unregisterDocumentation
(
QLatin1String
(
"org.kde.cantor"
));
}
QString
DocumentationPanelWidget
::
backendName
()
const
{
return
m_backend
;
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.h
View file @
cc2954d8
...
...
@@ -48,7 +48,6 @@ class DocumentationPanelWidget : public QWidget
QString
backendName
()
const
;
void
loadDocumentation
();
void
unloadDocumentation
();
public:
Cantor
::
Session
*
m_session
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment