summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Murgia - StraToN <the.straton@gmail.com>2015-07-29 00:41:24 +0200
committerJulian Murgia - StraToN <the.straton@gmail.com>2015-07-29 00:41:24 +0200
commitf46e340ab541f3fb7c34ebaabbe60c06e842ca1c (patch)
tree135ff99b19531170b0e4f751790c76c99b9261c1
parentf697ec2fe022583dde5f3ae650f49cfd7f237c33 (diff)
Added "Clear" button top right of output debug console in editor
-rw-r--r--tools/editor/editor_log.cpp14
-rw-r--r--tools/editor/editor_log.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp
index 8d49655960..875f9d2fee 100644
--- a/tools/editor/editor_log.cpp
+++ b/tools/editor/editor_log.cpp
@@ -104,6 +104,13 @@ void EditorLog::_close_request() {
}
+void EditorLog::_clear_request() {
+
+ log->clear();
+
+}
+
+
void EditorLog::add_message(const String& p_msg,bool p_error) {
@@ -167,9 +174,11 @@ void EditorLog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_close_request"),&EditorLog::_close_request );
ObjectTypeDB::bind_method(_MD("_flip_request"),&EditorLog::_flip_request );
+ ObjectTypeDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request );
//ObjectTypeDB::bind_method(_MD("_dragged"),&EditorLog::_dragged );
ADD_SIGNAL( MethodInfo("close_request"));
ADD_SIGNAL( MethodInfo("show_request"));
+ ADD_SIGNAL( MethodInfo("clear_request"));
}
EditorLog::EditorLog() {
@@ -197,6 +206,11 @@ EditorLog::EditorLog() {
//hb->add_child(pd);
//pd->connect("dragged",this,"_dragged");
//pd->set_default_cursor_shape(Control::CURSOR_MOVE);
+
+ clearbutton = memnew( Button );
+ hb->add_child(clearbutton);
+ clearbutton->set_text("Clear");
+ clearbutton->connect("pressed", this,"_clear_request");
tb = memnew( TextureButton );
hb->add_child(tb);
diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h
index 1141d03911..56bdb2a366 100644
--- a/tools/editor/editor_log.h
+++ b/tools/editor/editor_log.h
@@ -45,6 +45,7 @@ class EditorLog : public PanelContainer {
OBJ_TYPE( EditorLog, PanelContainer );
ToolButton *button;
+ Button *clearbutton;
Label *title;
RichTextLabel *log;
TextureButton *tb;
@@ -62,6 +63,7 @@ class EditorLog : public PanelContainer {
// void _dragged(const Point2& p_ofs);
void _close_request();
void _flip_request();
+ void _clear_request();
static void _undo_redo_cbk(void *p_self,const String& p_name);
protected: