Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenFlipper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
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
Hide 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 {
/// Log with OUT,WARN or ERR as type
void
log
(
Logtype
_type
,
QString
_message
);
/// Default logging as OUT
void
log
(
QString
_message
);
public:
...
...
widgets/pythonWidget/pythonWidget.cc
View file @
6cdb88d8
...
...
@@ -95,6 +95,9 @@ PythonWidget::PythonWidget(QWidget *parent )
}
PythonInterpreter
*
interpreter
=
PythonInterpreter
::
getInstance
();
if
(
OpenFlipper
::
Options
::
gui
()
)
connect
(
interpreter
,
SIGNAL
(
log
(
Logtype
,
QString
))
,
this
,
SLOT
(
slotLocalLog
(
Logtype
,
QString
)));
QTextEdit
*
coreInfo
=
new
QTextEdit
(
infoTab
);
infoTab
->
addTab
(
coreInfo
,
"Core"
);
...
...
@@ -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
public
slots
:
void
runScript
();
private
slots
:
void
slotLocalLog
(
Logtype
_type
,
QString
_logString
);
};
...
...
widgets/pythonWidget/pythonWidget.ui
View file @
6cdb88d8
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
994
</width>
<height>
6
9
9
</height>
<height>
6
5
9
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -26,11 +26,18 @@
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<widget
class=
"QTextEdit"
name=
"scriptWidget"
>
<property
name=
"readOnly"
>
<bool>
false
</bool>
</property>
</widget>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<item>
<widget
class=
"QTextEdit"
name=
"scriptWidget"
>
<property
name=
"readOnly"
>
<bool>
false
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"QTextEdit"
name=
"pythonOutput"
/>
</item>
</layout>
</item>
</layout>
</widget>
...
...
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