Remove trailing whitespaces.
This commit is contained in:
parent
310e2cc347
commit
27b3592e16
1 changed files with 899 additions and 899 deletions
|
|
@ -48,10 +48,10 @@ idFIND_GATEWAYS = range(10)
|
|||
|
||||
class ChatList(QuickChatList):
|
||||
"""This class manage the list of chat windows"""
|
||||
|
||||
|
||||
def createChat(self, target):
|
||||
return Chat(target, self.host)
|
||||
|
||||
|
||||
class MainWindow(wx.Frame, QuickApp):
|
||||
"""main app window"""
|
||||
|
||||
|
|
@ -62,13 +62,13 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
#sizer
|
||||
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.SetSizer(self.sizer)
|
||||
|
||||
|
||||
#Frame elements
|
||||
self.contact_list = ContactList(self, self)
|
||||
self.contact_list.registerActivatedCB(self.onContactActivated)
|
||||
self.contact_list.Hide()
|
||||
self.sizer.Add(self.contact_list, 1, flag=wx.EXPAND)
|
||||
|
||||
|
||||
self.chat_wins=ChatList(self)
|
||||
self.CreateStatusBar()
|
||||
|
||||
|
|
@ -80,12 +80,12 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
self.tools.AddSeparator()
|
||||
self.statusTxt=wx.TextCtrl(self.tools, -1, style = wx.TE_PROCESS_ENTER)
|
||||
self.tools.AddControl(self.statusTxt)
|
||||
self.Bind(wx.EVT_COMBOBOX, self.onStatusChange, self.statusBox)
|
||||
self.Bind(wx.EVT_COMBOBOX, self.onStatusChange, self.statusBox)
|
||||
self.Bind(wx.EVT_TEXT_ENTER, self.onStatusChange, self.statusTxt)
|
||||
self.tools.Disable()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#tray icon
|
||||
ticon = wx.Icon(os.path.join(self.media_dir, 'icons/crystal/tray_icon.xpm'), wx.BITMAP_TYPE_XPM)
|
||||
self.tray_icon = wx.TaskBarIcon()
|
||||
|
|
@ -95,16 +95,16 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
|
||||
#events
|
||||
self.Bind(wx.EVT_CLOSE, self.onClose, self)
|
||||
|
||||
|
||||
#menus
|
||||
self.createMenus()
|
||||
for i in range(self.menuBar.GetMenuCount()):
|
||||
self.menuBar.EnableTop(i, False)
|
||||
|
||||
|
||||
#profile panel
|
||||
self.profile_pan = ProfileManager(self)
|
||||
self.profile_pan = ProfileManager(self)
|
||||
self.sizer.Add(self.profile_pan, 1, flag=wx.EXPAND)
|
||||
|
||||
|
||||
self.postInit()
|
||||
|
||||
self.Show()
|
||||
|
|
@ -195,7 +195,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
popup.SetPosition((x,0))
|
||||
popup.Show()
|
||||
wx.CallLater(5000,popup.Destroy)
|
||||
|
||||
|
||||
def showDialog(self, message, title="", type="info", answer_cb = None, answer_data = None):
|
||||
if type == 'info':
|
||||
flags = wx.OK | wx.ICON_INFORMATION
|
||||
|
|
@ -212,7 +212,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
if answer_cb:
|
||||
data = [answer_data] if answer_data else []
|
||||
answer_cb(True if (answer == wx.ID_YES or answer == wx.ID_OK) else False, *data)
|
||||
|
||||
|
||||
def setStatusOnline(self, online=True):
|
||||
"""enable/disable controls, must be called when local user online status change"""
|
||||
if online:
|
||||
|
|
@ -241,12 +241,12 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
if filename:
|
||||
answer_data["dest_path"] = filename
|
||||
self.bridge.confirmationAnswer(confirmation_id, True, answer_data, profile)
|
||||
self.waitProgress(confirmation_id, _("File Transfer"), _("Copying %s") % os.path.basename(filename), profile)
|
||||
self.waitProgress(confirmation_id, _("File Transfer"), _("Copying %s") % os.path.basename(filename), profile)
|
||||
else:
|
||||
answer = wx.ID_NO
|
||||
if answer==wx.ID_NO:
|
||||
self.bridge.confirmationAnswer(confirmation_id, False, answer_data, profile)
|
||||
|
||||
|
||||
dlg.Destroy()
|
||||
|
||||
elif confirmation_type == "YES/NO":
|
||||
|
|
@ -323,21 +323,21 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
if not self.pbar:
|
||||
#first answer, we must construct the bar
|
||||
self.pbar = wx.ProgressDialog(title, message, float(data['size']), None,
|
||||
wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME)
|
||||
wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME)
|
||||
self.pbar.finish_value = float(data['size'])
|
||||
|
||||
|
||||
self.pbar.Update(int(data['position']))
|
||||
elif self.pbar:
|
||||
self.pbar.Update(self.pbar.finish_value)
|
||||
return
|
||||
|
||||
wx.CallLater(10, self.progressCB, progress_id, title, message, profile)
|
||||
|
||||
|
||||
def waitProgress (self, progress_id, title, message, profile):
|
||||
self.pbar = None
|
||||
wx.CallLater(10, self.progressCB, progress_id, title, message, profile)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### events ###
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
|
||||
def onExit(self, e):
|
||||
self.Close()
|
||||
|
||||
|
||||
def onAddContact(self, e):
|
||||
debug(_("Add contact request"))
|
||||
dlg = wx.TextEntryDialog(
|
||||
|
|
@ -439,15 +439,15 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
return
|
||||
_id = self.bridge.getCard(target.short, profile_key=self.profile)
|
||||
_id = self.bridge.getCard(target.short, profile_key=self.profile)
|
||||
self.current_action_ids.add(_id)
|
||||
self.current_action_ids_cb[_id] = self.onProfileReceived
|
||||
|
||||
|
||||
def onProfileReceived(self, data):
|
||||
"""Called when a profile is received"""
|
||||
debug (_('Profile received: [%s]') % data)
|
||||
profile=Profile(self, data)
|
||||
|
||||
|
||||
def onJoinRoom(self, e):
|
||||
warning('FIXME: temporary menu, must be improved')
|
||||
#TODO: a proper MUC room joining dialog with nickname etc
|
||||
|
|
@ -473,7 +473,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
target = data['__private__']['target']
|
||||
del data['__private__']
|
||||
gatewayManager = GatewaysManager(self, data, server=target)
|
||||
|
||||
|
||||
def onClose(self, e):
|
||||
QuickApp.onExit(self)
|
||||
info(_("Exiting..."))
|
||||
|
|
@ -489,4 +489,4 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
self.Show()
|
||||
self.Raise()
|
||||
e.Skip()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue