beautify code

git-svn-id: file:///home/svn/framework3/trunk@4903 4d416f70-5f16-0410-b530-b9f4589650da
unstable
fab 2007-05-12 16:10:22 +00:00
parent 018f069b0a
commit 244abb6ae0
17 changed files with 2760 additions and 2761 deletions

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
class MyAbout
class MyAbout
include Msf::Ui::Gtk2::MyControls
Gtk::AboutDialog.set_email_hook {|about, link|
puts "Mail to #{link}"
@ -23,8 +23,8 @@ class MyAbout
@about.run
@about.destroy
end
end
end
end
end
end
end
end

View File

@ -1,11 +1,11 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class help us to wait the next release of ruby-libglade2 package
##
class GladeXML < GladeXML
##
# This class help us to wait the next release of ruby-libglade2 package
##
class GladeXML < GladeXML
def connect(source, target, signal, handler, data, after = false)
@handler_proc ||= Proc.new{}
handler = canonical_handler(handler)
@ -50,14 +50,14 @@ class GladeXML < GladeXML
parent = parent.parent
end
end
end
end
##
# This class help us to retreive all glade widgets and place them in your user instance
# like @windows, @widget, ...
##
##
# This class help us to retreive all glade widgets and place them in your user instance
# like @windows, @widget, ...
##
class MyGlade
class MyGlade
include Msf::Ui::Gtk2::MyControls
def initialize(root)
@ -73,12 +73,12 @@ class MyGlade
end
end
end
end
end
##
# This is the main class
##
class MyApp < MyGlade
##
# This is the main class
##
class MyApp < MyGlade
include Msf::Ui::Gtk2::MyControls
@ -262,8 +262,8 @@ class MyApp < MyGlade
framework.stats.num_auxiliary.to_s + " auxiliary"
)
end
end
end
end
end
end
end
end

View File

@ -1,12 +1,12 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class perform a wizard
##
class Assistant < Gtk::Window
##
# This class perform a wizard
##
class Assistant < Gtk::Window
include Msf::Ui::Gtk2::MyControls
@ -251,8 +251,8 @@ class Assistant < Gtk::Window
return frame_label
end
end
end
end
end
end
end
end

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
class Console
class Console
require 'rex/io/bidirectional_pipe'
ID_SESSION, PEER, PAYLOAD, O_SESSION, O_BUFFER = *(0..5).to_a
@ -141,17 +141,16 @@ class Console
print @session.run_cmd("help")
end
end
end
end
class GtkConsolePipe < Rex::IO::BidirectionalPipe
class GtkConsolePipe < Rex::IO::BidirectionalPipe
def prompting?
false
end
end
end
end
end
end
end
end

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
module MyControls
module MyControls
#
# Included class methods
@ -32,8 +32,8 @@ module MyControls
# TODO: Add control here
end
end
end
end
end
end
end

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
class SkeletonAlert < Gtk::Dialog
class SkeletonAlert < Gtk::Dialog
def initialize(parent, title, stock_icon, buttons, message=nil)
super("", parent, Gtk::Dialog::DESTROY_WITH_PARENT, *buttons)
@ -37,9 +37,9 @@ class SkeletonAlert < Gtk::Dialog
vbox.pack_start(label)
end
end
end
end
class SkeletonView < Gtk::Dialog
class SkeletonView < Gtk::Dialog
def initialize(title, buffer)
super(title, $gtk2driver.main, Gtk::Dialog::Flags::MODAL,
[ Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE ])
@ -54,12 +54,12 @@ class SkeletonView < Gtk::Dialog
self.vbox.pack_start(scrolled_window, true, true, 5)
scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
end
end
end
##
# Class and subclass for all MsfDialog
##
class MsfDialog
##
# Class and subclass for all MsfDialog
##
class MsfDialog
##
# Class for the payload rendering
@ -127,8 +127,8 @@ class MsfDialog
destroy
end
end
end
end
end
end
end
end
end

View File

@ -19,15 +19,15 @@ require 'msf/ui/gtk2/opcode'
require 'msf/ui/gtk2/framework_event_manager'
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
###
#
# This class implements a user interface driver on a gtk2 interface.
#
###
class Driver < Msf::Ui::Driver
###
#
# This class implements a user interface driver on a gtk2 interface.
#
###
class Driver < Msf::Ui::Driver
attr_accessor :session_tree, :module_tree, :job_tree, :log_text, :module_model
attr_accessor :module_completion, :main, :tips
@ -152,7 +152,7 @@ class Driver < Msf::Ui::Driver
#
attr_reader :framework
protected
protected
attr_writer :framework # :nodoc:
attr_accessor :opts # :nodoc:
@ -166,8 +166,8 @@ protected
Msf::Logging.enable_log_source(LogSource, level)
end
end
end
end
end
end
end
end

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
class MyJobTree < MyGlade
class MyJobTree < MyGlade
PIX, TIME, NAME, OBJECT, RHOST, REFNAME = *(0..6).to_a
include Msf::Ui::Gtk2::MyControls
@ -174,8 +174,8 @@ class MyJobTree < MyGlade
@model.remove(found) if found
end
end
end
end
end
end
end
end

View File

@ -1,11 +1,11 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class describe the modules treeview
##
class MyModuleTree < MyGlade
##
# This class describe the modules treeview
##
class MyModuleTree < MyGlade
@@completion = []
@ -284,8 +284,8 @@ class MyModuleTree < MyGlade
@treeview1.expand_all
end
end
end
end
end
end
end
end

View File

@ -1,8 +1,8 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
class MySessionTree
class MySessionTree
ID_SESSION, PEER, PAYLOAD, O_SESSION, O_BUFFER = *(0..5).to_a
include Msf::Ui::Gtk2::MyControls
@ -189,8 +189,8 @@ class MySessionTree
@model.remove(found) if found
end
end # class MySessionTree
end # class MySessionTree
end
end
end
end
end

View File

@ -1,13 +1,13 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
###
#
# Handles events of various types that are sent from the framework.
#
###
module FrameworkEventManager
###
#
# Handles events of various types that are sent from the framework.
#
###
module FrameworkEventManager
include Msf::SessionEvent
@ -56,8 +56,8 @@ module FrameworkEventManager
end
end
end
end
end
end
end
end

View File

@ -1,19 +1,19 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
require 'rex/exploitation/opcodedb'
require 'rex/exploitation/opcodedb'
require 'rexml/document'
require 'rexml/document'
##
# Gtk2 Interface for msfopcode
##
##
# Gtk2 Interface for msfopcode
##
#
# Skeleton for opcodes stuff
#
class SkeletonOpcode < Gtk::Dialog
#
# Skeleton for opcodes stuff
#
class SkeletonOpcode < Gtk::Dialog
include Msf::Ui::Gtk2::MyControls
@ -42,12 +42,12 @@ class SkeletonOpcode < Gtk::Dialog
@stuff = Gtk::VBox.new(false, 10)
self.vbox.pack_start(@stuff, true, true, 0)
end
end
end
#
# Gtk2 Interface for Metasploit Opcodes database
#
class MsfOpcode
#
# Gtk2 Interface for Metasploit Opcodes database
#
class MsfOpcode
# Create the opcode client instance
$client = Rex::Exploitation::OpcodeDb::Client.new
@ -410,8 +410,8 @@ class MsfOpcode
end
end
end
end
end
end
end
end
end

View File

@ -1,13 +1,13 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# Skeleton class for all parameters stuff
# title = Options title (menu)
# items = Array
##
class SkeletonOption < Gtk::Dialog
##
# Skeleton class for all parameters stuff
# title = Options title (menu)
# items = Array
##
class SkeletonOption < Gtk::Dialog
attr_accessor :frame
@ -99,9 +99,9 @@ class SkeletonOption < Gtk::Dialog
[Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL]
)
end
end
end
class MsfParameters
class MsfParameters
##
# Display the preference parameters
##
@ -279,8 +279,8 @@ class MsfParameters
end
end
end
end
end
end
end
end
end
end

View File

@ -1,11 +1,11 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class describe all search stuff into the module treeview
##
class ModuleSearch
##
# This class describe all search stuff into the module treeview
##
class ModuleSearch
include Msf::Ui::Gtk2::MyControls
RUNNING, CLEAR = *(0..2).to_a
@ -119,8 +119,8 @@ class ModuleSearch
completion.model = model
completion.text_column = 0
end
end
end
end
end
end
end
end

View File

@ -1,12 +1,12 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class perform some tooltips for TreeView widget
# This class is a port of Daniel J. Popowich coded in Python to ruby-gtk2 style
##
class TreeViewTooltips < Gtk::Window
##
# This class perform some tooltips for TreeView widget
# This class is a port of Daniel J. Popowich coded in Python to ruby-gtk2 style
##
class TreeViewTooltips < Gtk::Window
def initialize
super(Gtk::Window::POPUP)
@ -194,8 +194,8 @@ class TreeViewTooltips < Gtk::Window
# save this cell
@save = cell
end
end
end
end
end
end
end
end

View File

@ -1,13 +1,13 @@
module Msf
module Ui
module Gtk2
module Ui
module Gtk2
##
# This class describe all tags and behaviour for module view rendering
# To initialize, a Gtk::TextBuffer must be passed in argument
# TODO: Add a pixmap for platform
#
class MyModuleView
##
# This class describe all tags and behaviour for module view rendering
# To initialize, a Gtk::TextBuffer must be passed in argument
# TODO: Add a pixmap for platform
#
class MyModuleView
def initialize(buffer)
@buffer = buffer
@buffer.create_tag("_",
@ -64,8 +64,8 @@ class MyModuleView
end
@buffer.insert_with_tags(start, desc, 'description')
end
end
end
end
end
end
end
end