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

def Nagstamon::nagstamonGUI::Settings::OK (   self,
  widget 
)

    when dialog gets closed the content of its widgets gets put into the appropriate
    values of the config object
    after this the config file gets saved.

Definition at line 1691 of file nagstamonGUI.py.

01691                         :
        """
            when dialog gets closed the content of its widgets gets put into the appropriate
            values of the config object
            after this the config file gets saved.
        """
        for i in ["input_entry_", "input_checkbutton_", "input_radiobutton_", "input_spinbutton_", "input_filechooser_"]:
            for j in self.glade.get_widget_prefix(i):
                # some hazard, every widget has other methods to get its content
                # so we try them all, one of them should work
                try:
                    self.conf.__dict__[j.get_name().split(i)[1]] = j.get_text()
                except:
                    try:
                        self.conf.__dict__[j.get_name().split(i)[1]] = j.get_active()
                    except:
                        try:
                            self.conf.__dict__[j.get_name().split(i)[1]] = int(j.get_value())
                        except:
                            try:
                                # filechooser
                                self.conf.__dict__[j.name.split(i)[1]] = j.get_filename()
                            except:
                                pass

        # close settings dialog 
        self.dialog.destroy()
        # close popwin
        # catch Exception at first run when there cannot exist a popwin
        try:
            self.output.popwin.hide_all()
        except:
            pass

        if int(self.conf.update_interval) == 0:
            self.conf.update_interval = 1
        
        # save settings
        self.conf.SaveConfig()

        # catch exceptions in case of misconfiguration
        try:
            # now it is not the first run anymore
            self.firstrun = False
            self.conf.unconfigured = False
            
            # create output visuals again because they might have changed (systray/free floating status bar)
            self.output.statusbar.StatusBar.destroy()    
            self.output.statusbar.SysTray.set_visible(False)       
            #del self.output.statusbar
            self.output.popwin.destroy()
            # re-initialize output with new settings
            self.output.__init__()
            
            # force refresh
            nagstamonActions.RefreshAllServers(servers=self.servers, output=self.output, conf=self.conf)
            
        except:
            pass

        
    def Cancel(self, widget):


Generated by  Doxygen 1.6.0   Back to index