Commit 9c0de0d5 authored by Jan Möbius's avatar Jan Möbius

Split script widget for python

parent 4e4cbe13
...@@ -100,14 +100,14 @@ PythonWidget::PythonWidget(QWidget *parent ) ...@@ -100,14 +100,14 @@ PythonWidget::PythonWidget(QWidget *parent )
QTextEdit* coreInfo = new QTextEdit( infoTab ); QTextEdit* coreInfo = new QTextEdit( infoTab );
infoTab->addTab(coreInfo,"Core"); moduleTab->addTab(coreInfo,"Core");
QString coreDoc = interpreter->runScriptOutput("import pydoc ;import openflipper;html = pydoc.HTMLDoc();object, name = pydoc.resolve(openflipper);page = html.page(pydoc.describe(object), html.document(object, name));print(page)"); QString coreDoc = interpreter->runScriptOutput("import pydoc ;import openflipper;html = pydoc.HTMLDoc();object, name = pydoc.resolve(openflipper);page = html.page(pydoc.describe(object), html.document(object, name));print(page)");
coreInfo->setHtml(coreDoc); coreInfo->setHtml(coreDoc);
// Collect all Python Documentation for the OpenFlipper Plugin Modules // Collect all Python Documentation for the OpenFlipper Plugin Modules
for ( int i = 0 ; i < pythonPlugins.size() ; ++i ) { for ( int i = 0 ; i < pythonPlugins.size() ; ++i ) {
QTextEdit* edit = new QTextEdit( infoTab ); QTextEdit* edit = new QTextEdit( moduleTab );
infoTab->addTab(edit,pythonPlugins[i]); moduleTab->addTab(edit,pythonPlugins[i]);
QString data = interpreter->runScriptOutput("import pydoc ;import "+pythonPlugins[i]+";html = pydoc.HTMLDoc();object, name = pydoc.resolve("+pythonPlugins[i]+");page = html.page(pydoc.describe(object), html.document(object, name));print(page)"); QString data = interpreter->runScriptOutput("import pydoc ;import "+pythonPlugins[i]+";html = pydoc.HTMLDoc();object, name = pydoc.resolve("+pythonPlugins[i]+");page = html.page(pydoc.describe(object), html.document(object, name));print(page)");
edit->setHtml(data); edit->setHtml(data);
} }
......
...@@ -6,66 +6,159 @@ ...@@ -6,66 +6,159 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>994</width> <width>1474</width>
<height>659</height> <height>1004</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>About OpenFlipper</string> <string>About OpenFlipper</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
<widget class="QTabWidget" name="infoTab"> <widget class="QSplitter" name="splitter_4">
<property name="currentIndex"> <property name="orientation">
<number>0</number> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QFrame" name="frame">
<attribute name="title"> <property name="sizePolicy">
<string>Python Script</string> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
</attribute> <horstretch>0</horstretch>
<layout class="QVBoxLayout" name="verticalLayout_2"> <verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QTextEdit" name="scriptWidget"> <widget class="QTabWidget" name="infoTab">
<property name="readOnly"> <property name="currentIndex">
<bool>false</bool> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Python Script</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="handleWidth">
<number>4</number>
</property>
<widget class="QTextEdit" name="scriptWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
<widget class="QTextEdit" name="pythonOutput">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Python Information</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTextEdit" name="pythonInfo">
<property name="enabled">
<bool>true</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="pythonOutput"/> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="RunButton">
<property name="text">
<string>Run</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_2"> <widget class="QFrame" name="frame_3">
<attribute name="title"> <property name="frameShape">
<string>Python Information</string> <enum>QFrame::StyledPanel</enum>
</attribute> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QTextEdit" name="pythonInfo"> <widget class="QTabWidget" name="moduleTab">
<property name="enabled"> <property name="currentIndex">
<bool>true</bool> <number>-1</number>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -73,40 +166,6 @@ p, li { white-space: pre-wrap; } ...@@ -73,40 +166,6 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="RunButton">
<property name="text">
<string>Run</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<action name="actionClose"> <action name="actionClose">
......
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