def __init__(self, controller, switchboard): '''Constructor''' gobject.GObject.__init__(self) self.callbackIdList = [] self.P2PSignals = {} self.ui = None self.switchboard = None self.setSwitchboard(switchboard) msn = switchboard.msn self.controller = controller self.parser = controller.unifiedParser self.config = controller.config self.title = "" self.hasMessageWaiting = False self.lastMessageMail = '' # the mail of the user who sent the last message self.isCurrent = False # if True this is the tab that has the focus self.closed = False self.textBuffer = gtk.TextBuffer() self.autoreplySent = False # if true we allready sent the autoreply message self.inputText = '' self.theme = controller.theme self.parentConversationWindow = None self.enabledEncrypt = False self.encoderDecoder = None # do this for automagic reconnection if user comes online # and there's no avail switchboard self.userMail = self.switchboard.firstUser self.userOldStatus = remoteStatus = self.controller.contacts.\ get_status(self.userMail) # update self.userOldStatus in self.onUserAttrChanged msn.connect('user-attr-changed', self.onUserAttrChanged) msn.connect('custom-emoticon-transfered', self.onCustomEmoticonTransfered) #TODO: from now on this signals will be emitted by conversation window or conversationUI controller.connect('color-changed', self.onColorChanged) controller.connect('font-changed', self.onFontChanged) self.ui = ConversationUI.ConversationUI(self.controller, self) self.customEmoticons = CustomEmoticons() self.parser = self.controller.unifiedParser self.sendOffline = False self.lastSpeaker = '' self.user = switchboard.user self.transfers = [] self.accept_or_not = False self.myWebcam = None if self.config.user['sendKeepalive']: # 8000: this magic value has been told by # his majesty dequis himself # if you don't like it, stfu and gtfo gobject.timeout_add(8000, self.sendKeepalive)
def __init__(self, world): UIBase.__init__(self, world) #add frame border (temp!!!!!) self.border = DirectFrame(image=("./LEGameAssets/Textures/border.png"), frameColor=(0, 0, 0, 0), image_scale=(1, 1, 1), image_pos=(0, 0, 0), frameSize=(-1, 1, -1, 1), pos=(0, 0, 0)) self.border.setTransparency(1) self.border.reparentTo(render2d) self.journalUI = JournalUI(world) self.conversationUI = ConversationUI(world) self.lifebarUI = LifebarUI(world) self.offensiveSpellUI = OffensiveSpellUI(world) self.modifierSporeUI = ModifierSporeUI(world) self.defensiveSpellUI = DefensiveSpellUI(world) taskMgr.add(self.update, "updateUI") # change the conversationUI position self.world.accept('u', self.conversationUI.repositionUp) self.world.accept('j', self.conversationUI.repositionDown) # health bars self.healthBars = {}