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

Fix documentation switching through combobox problem and add widget inside...

Fix documentation switching through combobox problem and add widget inside maxima settings to install additional qt help files
parent 76e6596b
......@@ -13,7 +13,7 @@ set( MaximaBackend_SRCS
kconfig_add_kcfg_files(MaximaBackend_SRCS settings.kcfgc)
install(FILES maximabackend.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
ki18n_wrap_ui(MaximaBackend_SRCS settings.ui)
ki18n_wrap_ui(MaximaBackend_SRCS settings.ui qthelpconfigeditdialog.ui)
add_backend(maximabackend ${MaximaBackend_SRCS})
......
......@@ -17,6 +17,7 @@
---
Copyright (C) 2009 Alexander Rieder <alexanderrieder@gmail.com>
Copyright (C) 2019 Alexander Semke <alexander.semke@web.de>
Copyright (C) 2020 Shubham <aryan100jangid@gmail.com>
*/
#include "maximabackend.h"
......@@ -24,6 +25,7 @@
#include "maximasession.h"
#include "settings.h"
#include "ui_settings.h"
#include "ui_qthelpconfigeditdialog.h"
MaximaBackend::MaximaBackend( QObject* parent,const QList<QVariant> args ) : Cantor::Backend( parent,args )
{
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QtHelpConfigEditDialog</class>
<widget class="QDialog" name="QtHelpConfigEditDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>125</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string comment="@label:chooser">Icon:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KIconButton" name="qchIcon">
<property name="toolTip">
<string comment="@info:tooltip">Select an icon</string>
</property>
<property name="iconSize">
<number>16</number>
</property>
<property name="strictIconSize">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string comment="@label:textbox">Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="qchName">
<property name="toolTip">
<string comment="@info:tooltip">Enter a name</string>
</property>
<property name="placeholderText">
<string comment="@info:placeholder">Select a name...</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string comment="@label:textbox">Path:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KUrlRequester" name="qchRequester">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string comment="@info:tooltip">Select a Qt Help file...</string>
</property>
<property name="filter">
<string notr="true">*.qch|Qt Compressed Help (.qch)</string>
</property>
<property name="placeholderText">
<string comment="@info:placeholder">Select a Qt Help file...</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIconButton</class>
<extends>QPushButton</extends>
<header>KIconButton</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>KUrlRequester</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>QtHelpConfigEditDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QtHelpConfigEditDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>414</width>
<height>241</height>
<height>628</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -73,7 +73,39 @@
</property>
<layout class="QVBoxLayout" name="verticalLayoutScripts">
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts" native="true"/>
<widget class="KEditListWidget" name="kcfg_autorunScripts"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox2">
<property name="toolTip">
<string>Install locally available documentation files or download from the KDE store</string>
</property>
<property name="title">
<string>Install Additional Documentation Files</string>
</property>
<layout class="QVBoxLayout" name="container">
<item>
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Add</string>
</property>
<property name="icon">
<iconset theme="project_add">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
</layout>
</widget>
......@@ -96,7 +128,7 @@
<customwidgets>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
......
......@@ -311,8 +311,8 @@ void DocumentationPanelWidget::updateDocumentation()
docSelected + QLatin1String("/help.qhc"));
m_engine = new QHelpEngine(fileName, this);
// if(!m_engine->setupData())
// qWarning() << "Couldn't setup QtHelp Engine: " << m_engine->error();
/*if(!m_engine->setupData())
qWarning() << "Couldn't setup QtHelp Engine: " << m_engine->error();*/
if(m_backend != QLatin1String("Octave"))
m_engine->setProperty("_q_readonly", QVariant::fromValue<bool>(true));
......@@ -347,13 +347,10 @@ void DocumentationPanelWidget::updateDocumentation()
* This widget would be NEVER shown*/
m_displayArea->addWidget(m_index);
//handle the URL scheme handler
static bool schemeInstalled = false;
if(!schemeInstalled)
{
m_textBrowser->page()->profile()->installUrlSchemeHandler("qthelp", new QtHelpSchemeHandler(m_engine));
schemeInstalled = true;
}
// handle the URL scheme handler
//m_textBrowser->page()->profile()->removeUrlScheme("qthelp");
m_textBrowser->page()->profile()->removeAllUrlSchemeHandlers(); // remove previously installed scheme handler and then install new one
m_textBrowser->page()->profile()->installUrlSchemeHandler("qthelp", new QtHelpSchemeHandler(m_engine));
// register the compressed help file (qch)
const QString& qchFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation,
......
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