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

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

    create and show downtime_dialog from glade file

Definition at line 465 of file nagstamonGUI.py.

00465                                                             :
        """
            create and show downtime_dialog from glade file
        """
            
        # set the glade file
        self.gladefile = self.Resources + "/downtime_dialog.glade"  
        self.downtime_xml = gtk.glade.XML(self.gladefile) 
        self.downtime_dialog = self.downtime_xml.get_widget("downtime_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.Downtime }
        self.downtime_xml.signal_autoconnect(handlers_dict)
        
        # if service is None it must be a host
        if service == None:
            # set label for acknowledging a host
            self.downtime_xml.get_widget("input_label_host").set_text(host)
            self.downtime_xml.get_widget("label_service").hide()
            self.downtime_xml.get_widget("input_label_service").hide()
            self.downtime_dialog.set_title("Downtime for host")
        else: 
            # set label for acknowledging a service on host
            self.downtime_xml.get_widget("input_label_host").set_text(host)
            self.downtime_xml.get_widget("input_label_service").set_text(service)
            self.downtime_dialog.set_title("Downtime for service")
       
        # get start_time and end_time externally from nagstamonActions.Downtime_get_start_end() for not mixing GUI and actions too much
        start_time, end_time = nagstamonActions.Downtime_get_start_end(server=self.popwin.miserable_server, host=host)
            
        # default author + comment
        self.downtime_xml.get_widget("input_entry_author").set_text(self.username)
        self.downtime_xml.get_widget("input_entry_comment").set_text("scheduled downtime")
        # start and end time
        self.downtime_xml.get_widget("input_entry_start_time").set_text(start_time)
        self.downtime_xml.get_widget("input_entry_end_time").set_text(end_time)
        # flexible downtime duration
        self.downtime_xml.get_widget("input_spinbutton_duration_hours").set_value(2)
        self.downtime_xml.get_widget("input_spinbutton_duration_minutes").set_value(0)

        # show dialog
        self.downtime_dialog.run()
        self.downtime_dialog.destroy()


    def Downtime(self, widget):


Generated by  Doxygen 1.6.0   Back to index