Exemple #1
0
 def save(self):
     global settings
     tmp_settings = copy.copy(settings)
     for name, item in self.items.items():
         if item.get_can_config() and item.name and item.widget:
             tmp_settings[name] = item.get()
     rslt = tmp_settings.get_error()
     if not rslt:
         settings = copy.copy(tmp_settings)
         settings.save()
         self.on_save_cb()
         return True
     else:
         args, (error, controls) = rslt
         from pyipmsg.dialogs.message import ConfigValidationErrorDialog
         dlg = ConfigValidationErrorDialog(self.dlg, (','.join(args), error))
         dlg.show()
         dlg.run()
         dlg.destroy()
         return False
Exemple #2
0
 def on_handle(w, *args):
     model.set(itr, 7, icons.Menu.get_pixbuf('block'))
     settings['block_list'].append(contact_id)
     settings.save()
     ipmsg.update_block_list()
Exemple #3
0
 def on_handle(w, *args):
     model.set(itr, 7, None)
     settings['block_list'] = [ip for ip in settings['block_list'] if ip != contact_id]
     settings.save()
     ipmsg.update_block_list()
Exemple #4
0
 def on_save_cb():
     ipmsg.update_block_list()
     ipmsg.update_status()
     ipmsg.rebind_log(settings['log_file_path'])
     settings['group_list'] = []
     settings.save()