Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
6cdb88d8
Commit
6cdb88d8
authored
Feb 28, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added python output textedit to python widget
parent
b86bdb3c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
9 deletions
+42
-9
PythonInterpreter/PythonInterpreter.hh
PythonInterpreter/PythonInterpreter.hh
+0
-3
widgets/pythonWidget/pythonWidget.cc
widgets/pythonWidget/pythonWidget.cc
+26
-0
widgets/pythonWidget/pythonWidget.hh
widgets/pythonWidget/pythonWidget.hh
+3
-0
widgets/pythonWidget/pythonWidget.ui
widgets/pythonWidget/pythonWidget.ui
+13
-6
No files found.
PythonInterpreter/PythonInterpreter.hh
View file @
6cdb88d8
...
@@ -53,9 +53,6 @@ class PythonInterpreter : public QObject {
...
@@ -53,9 +53,6 @@ class PythonInterpreter : public QObject {
/// Log with OUT,WARN or ERR as type
/// Log with OUT,WARN or ERR as type
void
log
(
Logtype
_type
,
QString
_message
);
void
log
(
Logtype
_type
,
QString
_message
);
/// Default logging as OUT
void
log
(
QString
_message
);
public:
public:
...
...
widgets/pythonWidget/pythonWidget.cc
View file @
6cdb88d8
...
@@ -95,6 +95,9 @@ PythonWidget::PythonWidget(QWidget *parent )
...
@@ -95,6 +95,9 @@ PythonWidget::PythonWidget(QWidget *parent )
}
}
PythonInterpreter
*
interpreter
=
PythonInterpreter
::
getInstance
();
PythonInterpreter
*
interpreter
=
PythonInterpreter
::
getInstance
();
if
(
OpenFlipper
::
Options
::
gui
()
)
connect
(
interpreter
,
SIGNAL
(
log
(
Logtype
,
QString
))
,
this
,
SLOT
(
slotLocalLog
(
Logtype
,
QString
)));
QTextEdit
*
coreInfo
=
new
QTextEdit
(
infoTab
);
QTextEdit
*
coreInfo
=
new
QTextEdit
(
infoTab
);
infoTab
->
addTab
(
coreInfo
,
"Core"
);
infoTab
->
addTab
(
coreInfo
,
"Core"
);
...
@@ -126,6 +129,29 @@ void PythonWidget::runScript() {
...
@@ -126,6 +129,29 @@ void PythonWidget::runScript() {
}
}
void
PythonWidget
::
slotLocalLog
(
Logtype
_type
,
QString
_logString
)
{
switch
(
_type
)
{
case
LOGINFO
:
pythonOutput
->
setTextColor
(
QColor
(
Qt
::
darkGreen
)
);
break
;
case
LOGOUT
:
pythonOutput
->
setTextColor
(
QPalette
{}.
windowText
().
color
()
);
break
;
case
LOGWARN
:
pythonOutput
->
setTextColor
(
QColor
(
160
,
160
,
0
)
);
break
;
case
LOGERR
:
pythonOutput
->
setTextColor
(
QColor
(
Qt
::
red
)
);
break
;
case
LOGSTATUS
:
pythonOutput
->
setTextColor
(
QColor
(
Qt
::
blue
)
);
break
;
}
pythonOutput
->
append
(
_logString
);
}
...
...
widgets/pythonWidget/pythonWidget.hh
View file @
6cdb88d8
...
@@ -56,6 +56,9 @@ class PythonWidget : public QMainWindow, public Ui::PythonWidget
...
@@ -56,6 +56,9 @@ class PythonWidget : public QMainWindow, public Ui::PythonWidget
public
slots
:
public
slots
:
void
runScript
();
void
runScript
();
private
slots
:
void
slotLocalLog
(
Logtype
_type
,
QString
_logString
);
};
};
...
...
widgets/pythonWidget/pythonWidget.ui
View file @
6cdb88d8
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
994
</width>
<width>
994
</width>
<height>
6
9
9
</height>
<height>
6
5
9
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
<string>
Python Script
</string>
<string>
Python Script
</string>
</attribute>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<item>
<item>
<widget
class=
"QTextEdit"
name=
"scriptWidget"
>
<widget
class=
"QTextEdit"
name=
"scriptWidget"
>
<property
name=
"readOnly"
>
<property
name=
"readOnly"
>
...
@@ -32,6 +34,11 @@
...
@@ -32,6 +34,11 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item>
<widget
class=
"QTextEdit"
name=
"pythonOutput"
/>
</item>
</layout>
</item>
</layout>
</layout>
</widget>
</widget>
<widget
class=
"QWidget"
name=
"tab_2"
>
<widget
class=
"QWidget"
name=
"tab_2"
>
...
...
Write
Preview
Markdown
is supported
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