Logo Search packages:      
Sourcecode: nagstamon version File versions  Download package

def Nagstamon::nagstamonGUI::GUI::AcknowledgeDialogShow (   self,
  server,
  host,
  service = None 
)

    create and show acknowledge_dialog from glade file

Definition at line 386 of file nagstamonGUI.py.

00386                                                                :
        """
            create and show acknowledge_dialog from glade file
        """
            
        # set the glade file
        self.gladefile = self.Resources + "/acknowledge_dialog.glade"  
        self.acknowledge_xml = gtk.glade.XML(self.gladefile) 
        self.acknowledge_dialog = self.acknowledge_xml.get_widget("acknowledge_dialog")

        # connect with action
        # only OK needs to be connected - if this action gets canceled nothing happens
        # use signal_autoconnect to assign methods to handlers
        handlers_dict = { "button_ok_clicked" : self.Acknowledge }
        self.acknowledge_xml.signal_autoconnect(handlers_dict)
        
        # if service is None it must be a host
        if service == None:
            # set label for acknowledging a host
            self.acknowledge_xml.get_widget("input_label_host").set_text(host)
            self.acknowledge_xml.get_widget("label_service").hide()
            self.acknowledge_xml.get_widget("input_label_service").hide()
            self.acknowledge_dialog.set_title("Acknowledge host")
        else: 
            # set label for acknowledging a service on host
            self.acknowledge_xml.get_widget("input_label_host").set_text(host)
            self.acknowledge_xml.get_widget("input_label_service").set_text(service)
            self.acknowledge_dialog.set_title("Acknowledge service")
        
        # default flags of Nagios acknowledgement
        self.acknowledge_xml.get_widget("input_checkbutton_sticky_acknowledgement").set_active(True)
        self.acknowledge_xml.get_widget("input_checkbutton_send_notification").set_active(True)
        self.acknowledge_xml.get_widget("input_checkbutton_persistent_comment").set_active(True)
        self.acknowledge_xml.get_widget("input_checkbutton_acknowledge_all_services").set_active(False)

        # default author + comment
        self.acknowledge_xml.get_widget("input_entry_author").set_text(self.username)
        self.acknowledge_xml.get_widget("input_entry_comment").set_text("acknowledged")
        # show dialog
        self.acknowledge_dialog.run()
        self.acknowledge_dialog.destroy()


    def Acknowledge(self, widget):


Generated by  Doxygen 1.6.0   Back to index