Mercurial > libervia-backend
diff frontends/src/wix/main_window.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | 84a6e83157c2 |
line wrap: on
line diff
--- a/frontends/src/wix/main_window.py Fri Jan 18 17:55:27 2013 +0100 +++ b/frontends/src/wix/main_window.py Fri Jan 18 17:55:34 2013 +0100 @@ -48,10 +48,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 @@ #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 @@ 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 @@ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ def onExit(self, e): self.Close() - + def onAddContact(self, e): debug(_("Add contact request")) dlg = wx.TextEntryDialog( @@ -439,15 +439,15 @@ 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 @@ 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 @@ self.Show() self.Raise() e.Skip() - +