2007-05-21 22:37:23 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
module Gtk2
|
|
|
|
|
|
|
|
class MsfWindow
|
|
|
|
|
|
|
|
#
|
2007-12-31 09:54:49 +00:00
|
|
|
# This class performs a Gtk::Window to display logs from framework
|
2007-05-21 22:37:23 +00:00
|
|
|
#
|
|
|
|
class Logs < Msf::Ui::Gtk2::SkeletonBasic
|
|
|
|
|
|
|
|
include Msf::Ui::Gtk2::MyControls
|
|
|
|
|
|
|
|
def initialize
|
2007-06-02 20:10:24 +00:00
|
|
|
console_style = File.join(driver.resource_directory, 'style', 'console.rc')
|
|
|
|
Gtk::RC.parse(console_style)
|
|
|
|
|
2007-05-21 22:37:23 +00:00
|
|
|
# call the parent
|
|
|
|
super("MsfLogs")
|
|
|
|
|
|
|
|
# Define the size and border
|
|
|
|
set_default_size(400, 400)
|
|
|
|
set_border_width(10)
|
|
|
|
|
|
|
|
# Main hbox
|
|
|
|
vbox = Gtk::VBox.new(false, 0)
|
|
|
|
add(vbox)
|
|
|
|
|
|
|
|
textview = Gtk::TextView.new($gtk2driver.log_text.buffer)
|
2007-12-31 09:54:49 +00:00
|
|
|
textview.set_editable(false)
|
2007-05-21 22:37:23 +00:00
|
|
|
|
|
|
|
sw = Gtk::ScrolledWindow.new()
|
|
|
|
sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
|
|
|
|
vbox.pack_start(sw, true, true, 0)
|
|
|
|
|
|
|
|
sw.add(textview)
|
|
|
|
|
|
|
|
show_all
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|