From 4d7ddb0e07bf2fc50a8911de50572171ec0b6510 Mon Sep 17 00:00:00 2001 From: fab <> Date: Sat, 24 Mar 2007 22:56:59 +0000 Subject: [PATCH] add parameters stuff (menu, widget, ...) git-svn-id: file:///home/svn/framework3/trunk@4557 4d416f70-5f16-0410-b530-b9f4589650da --- data/msfgui/msfgui.glade | 24 +++++++--- lib/msf/ui/gtk2/app.rb | 12 +++-- lib/msf/ui/gtk2/driver.rb | 2 +- lib/msf/ui/gtk2/{options.rb => parameters.rb} | 47 +++++++++++++++++-- 4 files changed, 70 insertions(+), 15 deletions(-) rename lib/msf/ui/gtk2/{options.rb => parameters.rb} (66%) diff --git a/data/msfgui/msfgui.glade b/data/msfgui/msfgui.glade index aabbc93a39..2be02c767e 100644 --- a/data/msfgui/msfgui.glade +++ b/data/msfgui/msfgui.glade @@ -72,13 +72,13 @@ - + True - Options + Parameters True - + @@ -90,11 +90,23 @@ - + True - Payload + Databases True - + + + + + True + gtk-network + 1 + 0.5 + 0.5 + 0 + 0 + + diff --git a/lib/msf/ui/gtk2/app.rb b/lib/msf/ui/gtk2/app.rb index 5c633fb2b9..5a62bfd314 100644 --- a/lib/msf/ui/gtk2/app.rb +++ b/lib/msf/ui/gtk2/app.rb @@ -106,12 +106,18 @@ class MyApp < MyGlade Gtk.main_quit end + # + # Action for "Parameters/Preferences" + # def on_preferences_activate - MsfOptions::Preferences.new() + MsfParameters::Preferences.new() end - def on_payload_activate - puts "TODO: Set preferences for the payload choice" + # + # Action for "Parameters"/"Databases" menu + # + def on_databases_activate + MsfParameters::Databases.new() end # diff --git a/lib/msf/ui/gtk2/driver.rb b/lib/msf/ui/gtk2/driver.rb index 15940c9c5e..5918d4d2af 100644 --- a/lib/msf/ui/gtk2/driver.rb +++ b/lib/msf/ui/gtk2/driver.rb @@ -11,7 +11,7 @@ require 'msf/ui/gtk2/dialogs' require 'msf/ui/gtk2/console' require 'msf/ui/gtk2/view' require 'msf/ui/gtk2/search' -require 'msf/ui/gtk2/options' +require 'msf/ui/gtk2/parameters' require 'msf/ui/gtk2/framework_event_manager' diff --git a/lib/msf/ui/gtk2/options.rb b/lib/msf/ui/gtk2/parameters.rb similarity index 66% rename from lib/msf/ui/gtk2/options.rb rename to lib/msf/ui/gtk2/parameters.rb index ef26db536d..fe5b07991f 100644 --- a/lib/msf/ui/gtk2/options.rb +++ b/lib/msf/ui/gtk2/parameters.rb @@ -17,25 +17,33 @@ class SkeletonOption < Gtk::Dialog self.resizable = true self.has_separator = true self.vbox.spacing = 12 + self.vbox.set_homogeneous(false) self.title = title + self.set_default_size(500, 400) model = create_model(items) treeview = Gtk::TreeView.new(model) + treeview.set_size_request(5, 200) - hbox = Gtk::HBox.new(false, 10) + @hbox = Gtk::HBox.new(false, 10) # ScrolledWindow sw = Gtk::ScrolledWindow.new sw.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC) - hbox.pack_start(sw) + @hbox.pack_start(sw) sw.add(treeview) renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Select an item', renderer, 'text' => 0) + #column.fixed_width = 20 column.pack_start(renderer, false) treeview.append_column(column) - self.vbox.pack_start(hbox) + self.vbox.pack_start(@hbox, false, false, 0) + @label = Gtk::Label.new("test") + @frame = Gtk::Frame.new("frame") + @frame.set_size_request(300, 400) + @hbox.pack_end(@frame, true, true, 0) # Signal selection = treeview.selection @@ -58,11 +66,14 @@ class SkeletonOption < Gtk::Dialog def selection_changed(selection) iter = selection.selected - puts iter[0] + @frame.set_label(iter[0]) end end -class MsfOptions +class MsfParameters + ## + # Display the preference parameters + ## class Preferences < Msf::Ui::Gtk2::SkeletonOption def initialize menu = ["Exploits", "Payloads"] @@ -84,6 +95,32 @@ class MsfOptions def w_payloads end end + + + ## + # Display the databases parameters + ## + class Databases < Msf::Ui::Gtk2::SkeletonOption + def initialize + menu = ["AutoPOWN", "OPCODES"] + super("Databases", menu) + + show_all and run + destroy + end + + # + # Describe the autopown widget + # + def w_autopown + end + + # + # Describe the opcode widget opcodes + # + def w_opcode + end + end end end