Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 736:6246eb6d64a0
frontends: define the constants with classes and inheritance instance of using __builtin__
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 23 Nov 2013 10:21:40 +0100 |
parents | 56aa0e98c92e |
children | 378af36155c2 |
comparison
equal
deleted
inserted
replaced
735:682933ca304c | 736:6246eb6d64a0 |
---|---|
30 from sat_frontends.primitivus.gateways import GatewaysManager | 30 from sat_frontends.primitivus.gateways import GatewaysManager |
31 from sat_frontends.primitivus.xmlui import XMLUI | 31 from sat_frontends.primitivus.xmlui import XMLUI |
32 from sat_frontends.primitivus.progress import Progress | 32 from sat_frontends.primitivus.progress import Progress |
33 from sat_frontends.primitivus.notify import Notify | 33 from sat_frontends.primitivus.notify import Notify |
34 from sat_frontends.tools.misc import InputHistory | 34 from sat_frontends.tools.misc import InputHistory |
35 import sat_frontends.primitivus.constants | 35 from sat_frontends.primitivus.constants import Const |
36 import logging | 36 import logging |
37 from logging import debug, info, error | 37 from logging import debug, info, error |
38 from sat.tools.jid import JID | 38 from sat.tools.jid import JID |
39 from os.path import join | 39 from os.path import join |
40 | 40 |
149 def __init__(self): | 149 def __init__(self): |
150 QuickApp.__init__(self) | 150 QuickApp.__init__(self) |
151 | 151 |
152 ## main loop setup ## | 152 ## main loop setup ## |
153 self.main_widget = ProfileManager(self) | 153 self.main_widget = ProfileManager(self) |
154 self.loop = urwid.MainLoop(self.main_widget, const_PALETTE, event_loop=urwid.GLibEventLoop(), input_filter=self.inputFilter, unhandled_input=self.keyHandler) | 154 self.loop = urwid.MainLoop(self.main_widget, const.PALETTE, event_loop=urwid.GLibEventLoop(), input_filter=self.inputFilter, unhandled_input=self.keyHandler) |
155 | 155 |
156 ##misc setup## | 156 ##misc setup## |
157 self.chat_wins = ChatList(self) | 157 self.chat_wins = ChatList(self) |
158 self.notBar = sat_widgets.NotificationBar() | 158 self.notBar = sat_widgets.NotificationBar() |
159 urwid.connect_signal(self.notBar, 'change', self.onNotification) | 159 urwid.connect_signal(self.notBar, 'change', self.onNotification) |
588 else: | 588 else: |
589 pop_up_widget = sat_widgets.ConfirmDialog(_("Are you sure you want to delete the contact [%s] ?" % contact), yes_cb=self.onRemoveContact, no_cb=self.removePopUp) | 589 pop_up_widget = sat_widgets.ConfirmDialog(_("Are you sure you want to delete the contact [%s] ?" % contact), yes_cb=self.onRemoveContact, no_cb=self.removePopUp) |
590 self.showPopUp(pop_up_widget) | 590 self.showPopUp(pop_up_widget) |
591 | 591 |
592 def onAboutRequest(self, menu): | 592 def onAboutRequest(self, menu): |
593 self.showPopUp(sat_widgets.Alert(_("About"), const_APP_NAME + " v" + self.bridge.getVersion(), ok_cb=self.removePopUp)) | 593 self.showPopUp(sat_widgets.Alert(_("About"), const.APP_NAME + " v" + self.bridge.getVersion(), ok_cb=self.removePopUp)) |
594 | 594 |
595 #MISC CALLBACKS# | 595 #MISC CALLBACKS# |
596 | 596 |
597 def onGatewaysFound(self, data): | 597 def onGatewaysFound(self, data): |
598 """Called when SàT has found the server gateways""" | 598 """Called when SàT has found the server gateways""" |