- link MsfAssistant to bidirectionnal_pide

- add Gtk::Entry to console


git-svn-id: file:///home/svn/framework3/trunk@4327 4d416f70-5f16-0410-b530-b9f4589650da
unstable
fab 2007-02-05 21:08:35 +00:00
parent a38dc64158
commit 7be3d1c3de
3 changed files with 66 additions and 4 deletions

View File

@ -982,6 +982,8 @@
<child>
<widget class="GtkTextView" id="textview">
<property name="width_request">300</property>
<property name="height_request">300</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@ -1008,7 +1010,61 @@
</child>
<child>
<placeholder/>
<widget class="GtkHBox" id="hbox4">
<property name="border_width">15</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label24">
<property name="visible">True</property>
<property name="label" translatable="yes">&gt;&gt;&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="cmd_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>

View File

@ -8,7 +8,7 @@ require 'rex/ui/text/input/buffer'
class BidirectionalPipe < Rex::Ui::Text::Input
def initialize(buffer, entry)
def initialize(buffer)
@buffer = buffer
@subscribers_out = {}
@pipe_input = Rex::Ui::Text::Input::Buffer.new
@ -54,14 +54,16 @@ class BidirectionalPipe < Rex::Ui::Text::Input
def print_error(msg)
@buffer.insert_at_cursor('[-] ' + msg)
print_line
end
def print_line(msg)
def print_line(msg = "")
@buffer.insert_at_cursor(msg + "\n")
end
def print_good(msg)
@buffer.insert_at_cursor('[+] ' + msg)
print_line
end
def flush
@ -69,6 +71,7 @@ class BidirectionalPipe < Rex::Ui::Text::Input
def print_status(msg)
@buffer.insert_at_cursor('[*] ' + msg)
print_line
end
protected

View File

@ -34,6 +34,9 @@ end
##
class MsfAssistant
attr_accessor :input
attr_accessor :output
PIX, TARGET, STAGED, OWNED, NAME, OBJECT, DRIVER, INPUT, OUTPUT = *(0..9).to_a
KEY, DEFAULT, VALUE, DESC = *(0..5).to_a
@ -380,7 +383,7 @@ class MsfAssistant
pipe = BidirectionalPipe.new(@buffer)
pipe.input = pipe.pipe_input
# pipe.input = pipe.pipe_input
input = pipe
output = pipe