Account settings works properly; auto completion has been implemented and improved, TWBlue loads in a threaded mode

This commit is contained in:
2015-01-27 17:09:28 -06:00
parent 51957125c1
commit ff65b73232
21 changed files with 508 additions and 27 deletions

View File

@@ -87,6 +87,18 @@ class ignoredClients(wx.Panel):
sizer.Add(btnBox, 0, wx.ALL, 5)
self.SetSizer(sizer)
def append(self, client):
self.clients.Append(client)
def get_clients(self):
return self.clients.GetCount()
def get_client_id(self):
return self.clients.GetSelection()
def remove(self, id):
self.clients.Delete(id)
class sound(wx.Panel):
def __init__(self, parent, input_devices, output_devices, soundpacks):
wx.Panel.__init__(self, parent)
@@ -124,6 +136,9 @@ class sound(wx.Panel):
sizer.Add(soundBox, 0, wx.ALL, 5)
self.SetSizer(sizer)
def get(self, control):
return getattr(self, control).GetStringSelection()
class audioServicesPanel(wx.Panel):
def __init__(self, parent):
super(audioServicesPanel, self).__init__(parent)
@@ -143,6 +158,27 @@ class audioServicesPanel(wx.Panel):
mainSizer.Add(first_sizer, 0, wx.ALL, 5)
self.SetSizer(mainSizer)
def set_dropbox(self, active=True):
if active == True:
self.dropbox.SetLabel(_(u"Unlink your Dropbox account"))
else:
self.dropbox.SetLabel(_(u"Link your Dropbox account"))
def show_dialog(self):
wx.MessageDialog(self, _(u"The authorisation request will be shown on your browser. Copy the code tat Dropbox will provide and, in the text box that will appear on TW Blue, paste it. This code is necessary to continue. You only need to do it once."), _(u"Authorisation"), wx.OK).ShowModal()
def get_response(self):
dlg = wx.TextEntryDialog(self, _(u"Enter the code here."), _(u"Verification code"))
if dlg.ShowModal() == wx.ID_CANCEL:
return False
return dlg.GetValue()
def show_error(self):
wx.MessageDialog(self, _(u"Error during authorisation. Try again later."), _(u"Error!"), wx.ICON_ERROR).ShowModal()
def get_dropbox(self):
return self.dropbox.GetLabel()
class configurationDialog(baseDialog.BaseWXDialog):
def set_title(self, title):

View File

@@ -50,6 +50,11 @@ class textLimited(widgetUtils.BaseDialog):
def set_cursor_at_position(self, position):
self.text.SetInsertionPoint(position)
def get_position(self):
return self.text.GetInsertionPoint()
def popup_menu(self, menu):
self.PopupMenu(menu, self.text.GetPosition())
class tweet(textLimited):
def createControls(self, title, message, text):
@@ -64,6 +69,7 @@ class tweet(textLimited):
self.shortenButton.Disable()
self.unshortenButton.Disable()
self.translateButton = wx.Button(self.panel, -1, _(u"Translate message"), size=wx.DefaultSize)
self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users"))
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
self.okButton.SetDefault()
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
@@ -78,6 +84,7 @@ class tweet(textLimited):
self.buttonsBox2.Add(self.translateButton, 0, wx.ALL, 5)
self.mainBox.Add(self.buttonsBox2, 0, wx.ALL, 5)
self.ok_cancelSizer = wx.BoxSizer(wx.HORIZONTAL)
self.ok_cancelSizer.Add(self.autocompletionButton, 0, wx.ALL, 5)
self.ok_cancelSizer.Add(self.okButton, 0, wx.ALL, 5)
self.ok_cancelSizer.Add(cancelButton, 0, wx.ALL, 5)
self.mainBox.Add(self.ok_cancelSizer)