add review page to Msf::Assistant

git-svn-id: file:///home/svn/framework3/trunk@4889 4d416f70-5f16-0410-b530-b9f4589650da
unstable
fab 2007-05-07 23:19:45 +00:00
parent f19af7698e
commit f92b7dd466
2 changed files with 29 additions and 4 deletions

View File

@ -2,6 +2,9 @@ module Msf
module Ui
module Gtk2
#
# Subclass the TreeViewTooltips to add our get_tooltip function
#
class AssistantTips < Msf::Ui::Gtk2::TreeViewTooltips
def initialize(column)
@ -21,9 +24,6 @@ end
##
# This class perform an assistant to configure module
#
# attr_accessor :vbox, :hbox, :main, :page, :bbox, :vbox_left, :vbox_label
#
##
class MsfAssistant
@ -31,6 +31,7 @@ class MsfAssistant
class Exploit < Msf::Ui::Gtk2::Assistant
# to stock our values
WIZARD = {}
WizardStruct = Struct.new('Wizard',
@ -129,6 +130,7 @@ class MsfAssistant
nil
)
display()
review_completion()
end
end
@ -302,6 +304,26 @@ class MsfAssistant
self.main.show_all
end
#
# Display the review page
#
def review_completion
warning = Gtk::Label.new
warning.set_markup("Review your configuration before clicking the <b>apply</b> button")
self.main.pack_start(warning, false, false, 0)
label = Gtk::Label.new
review = "\n\n"
@hash.each do |key, value|
review << "<b>#{key}</b> : #{value}\n"
end
label.set_markup(review)
self.main.pack_start(label, false, false, 0)
self.main.show_all
end
#
# Add column and tips
#

View File

@ -69,6 +69,8 @@ class MyModuleTree < MyGlade
@treeview1.signal_connect('button_press_event') do |treeview, event|
if event.kind_of? Gdk::EventButton
# Right click
if (event.button == 3)
path, column, x, y = treeview.get_path_at_pos(event.x, event.y)
begin
@ -81,6 +83,8 @@ class MyModuleTree < MyGlade
rescue
nil
end
# Double click
elsif (event.event_type == Gdk::Event::BUTTON2_PRESS)
path, column, x, y = treeview.get_path_at_pos(event.x, event.y)
begin
@ -112,7 +116,6 @@ class MyModuleTree < MyGlade
type = active_module.get_value(APP)
if (type == "Standard")
MsfAssistant::Exploit.new(active_module.get_value(MODULE))
# MsfAssistant::Standard.new(active_module.get_value(MODULE))
elsif (type == "Payloads")
MsfAssistant::Payload.new(active_module.get_value(MODULE))
else