Commit 3dc7eead authored by Alexander Semke's avatar Alexander Semke
Browse files

[maxima] put the autorun scripts and the documentation widget to new

tabs in a TabWidget. This reduces the size of the backend settings
widget and makes the separation of the different logics more clear. This
change will also be done for all other backends.
parent e8ea71fa
......@@ -30,19 +30,7 @@ MaximaSettingsWidget::MaximaSettingsWidget(QWidget *parent) : QWidget(parent)
// Add QtHelp widget
QtHelpConfig* docWidget = new QtHelpConfig(QLatin1String("maxima"));
static_cast<QGridLayout*>(this->layout())->addWidget(docWidget, 6, 0, 1, 3);
loadSettings(); // load previously saved settings from read KConfig
auto hboxLayout = new QHBoxLayout(tabDocumentation);
hboxLayout->addWidget(docWidget);
}
void MaximaSettingsWidget::loadSettings()
{
const KConfigGroup cg = KSharedConfig::openConfig()->group(QLatin1String("Settings_Documentation"));
QStringList nameList = cg.readEntry("Names", QStringList());
QStringList pathList = cg.readEntry("Paths", QStringList());
qDebug() << nameList.at(0);
/*ui.chkShowColumnType->setChecked(group.readEntry(QLatin1String("Names"), QStringList()));
ui.chkShowPlotDesignation->setChecked(group.readEntry(QLatin1String("Paths"), QStringList()));*/
}
......@@ -29,10 +29,7 @@ class MaximaSettingsWidget : public QWidget, public Ui::MaximaSettingsBase
Q_OBJECT
public:
explicit MaximaSettingsWidget(QWidget *parent = nullptr);
private:
void loadSettings();
explicit MaximaSettingsWidget(QWidget* parent = nullptr);
};
#endif /* _MAXIMASETTINGSWIDGET_H */
......@@ -6,100 +6,121 @@
<rect>
<x>0</x>
<y>0</y>
<width>505</width>
<height>793</height>
<width>420</width>
<height>355</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QCheckBox" name="kcfg_integratePlots">
<property name="toolTip">
<string>If enabled, plots will be shown inside of the worksheet. Otherwise, plots will be shown in an external window.</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KUrlRequester" name="kcfg_localDoc">
<property name="toolTip">
<string>If empty, the &quot;Show help&quot; action will show the default online documentation. Otherwise, the specified URL will be opened.</string>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lVariableManagement">
<property name="text">
<string>Variable Management:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="kcfg_variableManagement">
<property name="toolTip">
<string>Monitor the creation and destruction of variables and show the existing variables in the variable panel.</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KUrlRequester" name="kcfg_localDoc">
<property name="toolTip">
<string>If empty, the &quot;Show help&quot; action will show the default online documentation. Otherwise, the specified URL will be opened.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lPlotIntegration">
<property name="text">
<string>Plot Integration:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="kcfg_integratePlots">
<property name="toolTip">
<string>If enabled, plots will be shown inside of the worksheet. Otherwise, plots will be shown in an external window.</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label2">
<property name="text">
<string>Documentation:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAutorun">
<attribute name="title">
<string>Autorun</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Commands to autorun</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabDocumentation">
<attribute name="title">
<string>Documentation</string>
</attribute>
</widget>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lVariableManagement">
<property name="text">
<string>Variable Management:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>96</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="toolTip">
<string>Commands to automatically run on start. They can be useful for loading needed modules, changing environment, etc.</string>
</property>
<property name="title">
<string>Commands to autorun</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutScripts">
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label2">
<property name="text">
<string>Documentation:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lPlotIntegration">
<property name="text">
<string>Plot Integration:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="kcfg_variableManagement">
<property name="toolTip">
<string>Monitor the creation and destruction of variables and show the existing variables in the variable panel.</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout>
</widget>
<customwidgets>
......
......@@ -55,16 +55,15 @@ public:
{
setupUi(this);
if (modifiedItem) {
if (modifiedItem)
setWindowTitle(i18nc("@title:window", "Modify Entry"));
} else {
else
setWindowTitle(i18nc("@title:window", "Add New Entry"));
}
qchIcon->setIcon(QStringLiteral("qtlogo"));
}
bool checkQtHelpFile();
void accept() override;
private:
......@@ -95,9 +94,6 @@ QtHelpConfig::QtHelpConfig(const QString& backend)
{
m_backend = backend;
// load settings for Install Additional Help Files widget
loadSettings();
m_configWidget = new Ui::QtHelpConfigUI;
m_configWidget->setupUi(this);
m_configWidget->addButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
......@@ -114,11 +110,16 @@ QtHelpConfig::QtHelpConfig(const QString& backend)
m_configWidget->qchTable->header()->setSectionResizeMode(ConfigColumn, QHeaderView::Fixed);
// Add GHNS button // shift this code to backend specific
auto* knsButton = new KNS3::Button(i18nc("@action:button Allow user to get some API documentation with GHNS", "Get New Documentation"), QStringLiteral("kdevelop-qthelp.knsrc"), m_configWidget->boxQchManage);
auto* knsButton = new KNS3::Button(i18nc("@action:button Allow user to get some API documentation with GHNS", "Get New Documentation"),
QStringLiteral("cantor-qthelp.knsrc"),
this);
m_configWidget->tableCtrlLayout->insertWidget(1, knsButton);
connect(knsButton, &KNS3::Button::dialogFinished, this, &QtHelpConfig::knsUpdate);
connect(this, &QtHelpConfig::settingsChanged, this, &QtHelpConfig::saveSettings);
// load settings for Install Additional Help Files widget
loadSettings();
}
QtHelpConfig::~QtHelpConfig()
......
......@@ -6,139 +6,94 @@
<rect>
<x>0</x>
<y>0</y>
<width>560</width>
<height>443</height>
<width>588</width>
<height>389</height>
</rect>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="boxQchManage">
<property name="title">
<string comment="@title:group">Install Additional Documentation Files</string>
<widget class="QLabel" name="label">
<property name="text">
<string>Install Additional Documentation Files</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="qchTable">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="columnCount">
<number>5</number>
</property>
<property name="showGrid" stdset="0">
<bool>false</bool>
</property>
<attribute name="headerVisible">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string comment="@title:column">Name</string>
</property>
</column>
<column>
<property name="text">
<string comment="@title:column">Path</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">IconName</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">Ghns</string>
</property>
</column>
<column>
<property name="text">
<string notr="true"/>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="tableCtrlLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string comment="@action:button">Add</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QTreeWidget" name="qchTable">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="columnCount">
<number>5</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="showGrid" stdset="0">
<bool>false</bool>
</property>
</spacer>
<attribute name="headerVisible">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string comment="@title:column">Name</string>
</property>
</column>
<column>
<property name="text">
<string comment="@title:column">Path</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">IconName</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">Ghns</string>
</property>
</column>
<column>
<property name="text">
<string notr="true"/>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="tableCtrlLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string comment="@action:button">Add</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
......
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