core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
This commit is contained in:
parent
528ceb5f8b
commit
d158589881
1 changed files with 47 additions and 82 deletions
|
|
@ -21,10 +21,8 @@
|
|||
|
||||
from sat.core.i18n import _
|
||||
import wx
|
||||
import pdb
|
||||
from logging import debug, info, error
|
||||
from sat.tools.jid import JID
|
||||
import pdb
|
||||
|
||||
|
||||
class ProfileManager(wx.Panel):
|
||||
|
|
@ -99,9 +97,10 @@ class ProfileManager(wx.Panel):
|
|||
if name[0]=='@':
|
||||
wx.MessageDialog(self, _("A profile name can't start with a @"), _("Bad profile name"), wx.ICON_ERROR).ShowModal()
|
||||
else:
|
||||
profile = self.host.bridge.createProfile(name)
|
||||
self.__refillProfiles()
|
||||
self.profile_name.SetValue(name)
|
||||
def cb():
|
||||
self.__refillProfiles()
|
||||
self.profile_name.SetValue(name)
|
||||
self.host.bridge.asyncCreateProfile(name, callback=cb)
|
||||
dlg.Destroy()
|
||||
|
||||
def onDeleteProfile(self, event):
|
||||
|
|
@ -110,9 +109,10 @@ class ProfileManager(wx.Panel):
|
|||
return
|
||||
dlg = wx.MessageDialog(self, _("Are you sure to delete the profile [%s]") % name, _("Confirmation"), wx.ICON_QUESTION | wx.YES_NO)
|
||||
if dlg.ShowModal() == wx.ID_YES:
|
||||
self.host.bridge.deleteProfile(name)
|
||||
self.__refillProfiles()
|
||||
self.__setDefault()
|
||||
def cb():
|
||||
self.__refillProfiles()
|
||||
self.__setDefault()
|
||||
self.host.bridge.asyncDeleteProfile(name, callback=cb)
|
||||
dlg.Destroy()
|
||||
|
||||
def onProfileChange(self, event):
|
||||
|
|
|
|||
Loading…
Reference in a new issue