Ejemplo n.º 1
0
 def save_changes(self):
     settings = {}
     for tab in self.tabs:
         settings.update(getattr(tab, 'settings', {}))
     users = self.users_tab.user_data
     if settings['auth']:
         if not users:
             error_dialog(
                 self,
                 _('No users specified'),
                 _(
                     'You have turned on the setting to require passwords to access'
                     ' the content server, but you have not created any user accounts.'
                     ' Create at least one user account in the "User accounts" tab to proceed.'
                 ),
                 show=True
             )
             self.tabs_widget.setCurrentWidget(self.users_tab)
             return False
     if not self.custom_list_tab.commit():
         return False
     if not self.search_net_tab.commit():
         return False
     ConfigWidgetBase.commit(self)
     change_settings(**settings)
     UserManager().user_data = users
     return True
Ejemplo n.º 2
0
 def save_changes(self):
     settings = {}
     for tab in self.tabs:
         settings.update(getattr(tab, 'settings', {}))
     users = self.users_tab.user_data
     if settings['auth']:
         if not users:
             error_dialog(
                 self,
                 _('No users specified'),
                 _(
                     'You have turned on the setting to require passwords to access'
                     ' the content server, but you have not created any user accounts.'
                     ' Create at least one user account in the "User accounts" tab to proceed.'
                 ),
                 show=True
             )
             self.tabs_widget.setCurrentWidget(self.users_tab)
             return False
     if not self.custom_list_tab.commit():
         return False
     ConfigWidgetBase.commit(self)
     change_settings(**settings)
     UserManager().user_data = users
     return True
Ejemplo n.º 3
0
 def commit(self):
     p = self.set_port()
     if p is not None:
         from calibre.srv.opts import change_settings
         change_settings(port=p)