From 4a081f9e051b4cdbb5c943eb709a9a2a5f9d747f Mon Sep 17 00:00:00 2001
From: Paolo Capriotti
Date: Sun, 27 Jun 2010 13:50:09 +0100
Subject: [PATCH] Extract Console#write_line.
---
lib/console.rb | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/console.rb b/lib/console.rb
index 09676f7..427d2e0 100644
--- a/lib/console.rb
+++ b/lib/console.rb
@@ -31,12 +31,7 @@ class Console < Qt::Widget
@bold_font.bold = true
@input.on(:return_pressed) do
- text = @input.text
- with_font(@bold_font) do
- @output.append text
- end
- @input.text = ''
- fire :input => text
+ write_line(@input.text)
end
end
@@ -50,4 +45,12 @@ class Console < Qt::Widget
def append(text)
@output.append(text)
end
+
+ def write_line(text)
+ with_font(@bold_font) do
+ @output.append text
+ end
+ @input.text = ''
+ fire :input => text
+ end
end
--
2.11.4.GIT