Class Ui::Qt4::DradisWindow
In: ui/qt/window.rb
Parent: Qt::MainWindow

DradisWindow creates an interface window on top of MainWindow Qt elements. DradisWindow defines connections between the elements of the interface. It also defines a set of operations connected to the input and actions performed by the user.

MainWindow can be seen as the structure of the building while DradisWindow provides the funcionality to the different rooms and levels.

Methods

new  

Attributes

controller  [W] 

Public Class methods

Create the window, instantiate the widgets, connect signals and slots. Start the timer that will query the server for updates. The refresh period is defined in the config file.

[Source]

# File ui/qt/window.rb, line 396
      def initialize(parent=nil)
        super #call Qt::Widget constructor
        @base=Ui::Qt4::MainWindow.new
        @base.setupUi self #this is where the widget construction happens
    
        @timer_updates = Qt::Timer.new( self )
        connect( @timer_updates, SIGNAL( 'timeout()' ), SLOT( 'timeout_updates()' ) )
    
        connect @base.actionQuit, SIGNAL('triggered()'), $qApp, SLOT('quit()')
        connect @base.commandLine, SIGNAL('returnPressed()'), self, SLOT('console_new_command()')
        
        connect @base.treeLeft, SIGNAL('itemClicked(QTreeWidgetItem*,int)'), self, SLOT('item_clicked(QTreeWidgetItem*,int)')
        connect @base.textRight, SIGNAL('addNote(QString*, int)'), self, SLOT('add_note(QString*,int)')
        connect @base.textRight, SIGNAL('editNote(QString*, int, int)'), self, SLOT('edit_note(QString*,int,int)')

        if Qt::SystemTrayIcon.isSystemTrayAvailable
          connect(@base.trayIcon, SIGNAL('activated(QSystemTrayIcon::ActivationReason)'),
          self, SLOT('iconActivated(QSystemTrayIcon::ActivationReason)'))
        end       
    
        @timer_updates.start( $config.get_option(:ui_refresh).to_i )
        #@updateontick = false
    
        #TODO: @base.treeLeft.installEventFilter(self)
        #@base.commandLine.installEventFilter(self)
    
        @base.treeLeft.setHeaderLabels(['hosts'])
        @par = true
        @last_commands = []
        #@revision = 0
        
      end

[Validate]