Logo Search packages:      
Sourcecode: audit version File versions

def main_window::MainWindow::_save (   self  )  [private]

Update self.config and save it.

Return True if saved successfully, False otherwise.

Definition at line 141 of file main_window.py.

00141                    :
        '''Update self.config and save it.

        Return True if saved successfully, False otherwise.'''
        if self.config == self.original_config: # See Config.__ne__
            return True
        dlg = SaveDialog(self.window)
        (res, apply_config) = dlg.run(self.config.rules)
        dlg.destroy()
        if not res:
            return False
        try:
            self.config.write()
        except IOError, e:
            util.modal_error_dialog(self.window, _('Error writing audit '
                                                   'configuration: %s') %
                                    e.strerror)
            return False
        self.config_saved = True
        self.original_config = copy.deepcopy(self.config)
        self._refresh_config_stats()
        if apply_config:
            try:
                self.config.apply()
            except IOError, e:
                # e.strerror is usually useless here
                util.modal_error_dialog(self.window, _('Error applying audit '
                                                       'configuration'))
                return True # _Saved_ successfully, even if not applied
        return True

    def _refresh_config_stats(self):


Generated by  Doxygen 1.6.0   Back to index