コード例 #1
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def __on_toggled_cb(self, bool):
        email = str(self.ui.comboAccount.currentText())
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        sender = self.sender()
        #just like wlm :)
        if sender == self.ui.checkRememberMe:
            accv.save = bool
            if not bool:
                self.ui.checkRememberPass.setChecked(False)
                self.ui.checkSignInAuto.setChecked(False)
        elif sender == self.ui.checkRememberPass:
            accv.save_password = bool
            if bool:
                self.ui.checkRememberMe.setChecked(True)
            else:
                self.ui.checkSignInAuto.setChecked(False)
        elif sender == self.ui.checkSignInAuto:
            accv.autologin = bool
            if bool:
                self.ui.checkRememberMe.setChecked(True)
                self.ui.checkRememberPass.setChecked(True)
コード例 #2
0
ファイル: login.py プロジェクト: fcox/amsn2
    def signin(self):

        if self.user.get_active_text() == "":
            self.user.grab_focus()
            return
        elif self.password.get_text() == "":
            self.password.grab_focus()
            return

        email = self.user.get_active_text()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView()
            accv.email = email

        accv.password = self.password.get_text()
        status = self.statusCombo.get_active()
        for key in self.status_values:
            if self.status_values[key] == status:
                break
        accv.presence = key

        self._amsn_core.signinToAccount(self, accv)
        self.timer = gobject.timeout_add(40, self.__animation)
コード例 #3
0
ファイル: login.py プロジェクト: PabloCastellano/amsn2
    def __on_toggled_cb(self, bool):
        email = str(self.ui.comboAccount.currentText())
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        sender = self.sender().objectName()
        #just like wlm :)
        if sender == "checkRememberMe":
            if bool == True:
                accv.save = True
            else:
                if self.ui.checkRememberPass.isChecked():
                    self.ui.checkRememberPass.setChecked(False)
                if self.ui.checkSignInAuto.isChecked():
                    self.ui.checkSignInAuto.setChecked(False)
        elif sender == "checkRememberPass":
            if bool == True:
                accv.save_password = True
                if self.ui.checkRememberMe.isChecked() == False:
                    self.ui.checkRememberMe.setChecked(True)
            else:
                if self.ui.checkSignInAuto.isChecked():
                    self.ui.checkSignInAuto.setChecked(False)
        elif sender == "checkSignInAuto":
            if bool == True:
                accv.autologin = True
                if self.ui.checkRememberMe.isChecked() == False:
                    self.ui.checkRememberMe.setChecked(True)
                if self.ui.checkRememberPass.isChecked() == False:
                    self.ui.checkRememberPass.setChecked(True)
コード例 #4
0
ファイル: login.py プロジェクト: blueSpirit/amsn2
    def __on_toggled_cb(self, bool):
        email = str(self.ui.comboAccount.currentText())
        accv = self._ui_manager.get_accountview_from_email(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        sender = self.sender()
        #just like wlm :)
        if sender == self.ui.checkRememberMe:
            accv.save = bool
            if not bool:
                self.ui.checkRememberPass.setChecked(False)
                self.ui.checkSignInAuto.setChecked(False)
        elif sender == self.ui.checkRememberPass:
            accv.save_password = bool
            if bool:
                self.ui.checkRememberMe.setChecked(True)
            else:
                self.ui.checkSignInAuto.setChecked(False)
        elif sender == self.ui.checkSignInAuto:
            accv.autologin = bool
            if bool:
                self.ui.checkRememberMe.setChecked(True)
                self.ui.checkRememberPass.setChecked(True)
コード例 #5
0
    def loadAccount(self, email):
        accview = None
        accdir = self.getAccountDir(email)
        accpath = os.path.join(accdir, "account.xml")
        accfile = file(accpath, "r")
        root_tree = ElementTree(file=accfile)
        accfile.close()
        account = root_tree.getroot()
        if account.tag == "aMSNAccount":
            accview = AccountView()
            #email
            emailElmt = account.find("email")
            if emailElmt is None:
                return None
            accview.email = emailElmt.text
            #nick
            nickElmt = account.find("nick")
            if nickElmt is None:
                return None
            if nickElmt.text:
                accview.nick.appendText(nickElmt.text)
            #TODO: parse...
            #psm
            psmElmt = account.find("psm")
            if psmElmt is None:
                return None
            if psmElmt.text:
                accview.psm.appendText(psmElmt.text)
            #presence
            presenceElmt = account.find("presence")
            if presenceElmt is None:
                return None
            accview.presence = presenceElmt.text
            #password
            passwordElmt = account.find("password")
            if passwordElmt is None:
                accview.password = None
            else:
                accview.password = passwordElmt.text
            #save_password
            savePassElmt = account.find("save_password")
            if savePassElmt.text == "False":
                accview.save_password = False
            else:
                accview.save_password = True
            #autoconnect
            saveAutoConnect = account.find("autoconnect")
            if saveAutoConnect.text == "False":
                accview.autologin = False
            else:
                accview.autologin = True
            #TODO: use backend & all
            #dp
            dpElmt = account.find("dp")
            #TODO

            #TODO: preferred_ui ?

            accview.save = True
        return accview
コード例 #6
0
    def loadAccount(self, email):
        accview = None
        self.createAccountFileTree(email)
        accpath = os.path.join(self.account_dir, "account.xml")
        accfile = file(accpath, "r")
        root_tree = ElementTree(file=accfile)
        accfile.close()
        account = root_tree.getroot()
        if account.tag == "aMSNAccount":
            #email
            emailElmt = account.find("email")
            if emailElmt is None:
                return None
            accview = AccountView(self._core, emailElmt.text)
            #nick
            nickElmt = account.find("nick")
            if nickElmt is None:
                return None
            if nickElmt.text:
                accview.nick.appendText(nickElmt.text)
            #TODO: parse...
            #psm
            psmElmt = account.find("psm")
            if psmElmt is None:
                return None
            if psmElmt.text:
                accview.psm.appendText(psmElmt.text)
            #presence
            presenceElmt = account.find("presence")
            if presenceElmt is None:
                return None
            accview.presence = presenceElmt.text
            #password
            passwordElmt = account.find("password")
            if passwordElmt is None:
                accview.password = None
            else:
                accview.password = passwordElmt.text
            #save_password
            savePassElmt = account.find("save_password")
            if savePassElmt.text == "False":
                accview.save_password = False
            else:
                accview.save_password = True
            #autoconnect
            saveAutoConnect = account.find("autoconnect")
            if saveAutoConnect.text == "False":
                accview.autologin = False
            else:
                accview.autologin = True
            #TODO: use backend & all
            #dp
            dpElmt = account.find("dp")
            #TODO

            #TODO: preferred_ui ?

            accview.save = True

        return accview
コード例 #7
0
ファイル: login.py プロジェクト: fcox/amsn2
    def __switch_to_account(self, email):

        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView()
            accv.email = email

        self.ui.comboAccount.setItemText(0, accv.email)

        if accv.password:
            self.ui.linePassword.clear()
            self.ui.linePassword.insert(accv.password)
コード例 #8
0
ファイル: login.py プロジェクト: fcox/amsn2
    def signin(self):
        self.loginThrobber = LoginThrobber(self)
        self._parent.fadeIn(self.loginThrobber)

        email = self.ui.comboAccount.currentText()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView()
            accv.email = email

        accv.password = self.ui.linePassword.text().toLatin1().data()

        self._amsn_core.signinToAccount(self, accv)
コード例 #9
0
ファイル: login.py プロジェクト: javieradrianr/amsn2
    def signin(self):
        self.loginThrobber = LoginThrobber(self)
        self._parent.fadeIn(self.loginThrobber)

        email = self.ui.comboAccount.currentText()
        accv = self.getAccountViewFromEmail(str(email))

        if accv is None:
            accv = AccountView()
            accv.email = str(email)

        accv.password = self.ui.linePassword.text().toLatin1().data()
        accv.presence = self.status_dict[str(self.ui.comboStatus.currentText())]

        self._amsn_core.signinToAccount(self, accv)
コード例 #10
0
ファイル: login.py プロジェクト: jperezq/amsn2
    def __switch_to_account(self, email):
        print "Switching to account", email

        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core)
            accv.email = email

        self.user.get_children()[0].set_text(accv.email)
        if accv.password:
            self.password.set_text(accv.password)

        self.rememberMe.set_active(accv.save)
        self.rememberPass.set_active(accv.save_password)
        self.autoLogin.set_active(accv.autologin)
コード例 #11
0
ファイル: login.py プロジェクト: Kjir/amsn2
    def __on_toggled_cb(self, source):

        email = self.user.get_active_text()
        accv = self._ui_manager.get_accountview_from_email(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        if source is self.rememberMe:
            accv.save = source.get_active()
            self.rememberPass.set_sensitive(source.get_active())
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.rememberPass:
            accv.save_password = source.get_active()
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.autoLogin:
            accv.autologin = source.get_active()
コード例 #12
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def __on_toggled_cb(self, source):

        email = self.user.get_active_text()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        if source is self.rememberMe:
            accv.save = source.get_active()
            self.rememberPass.set_sensitive(source.get_active())
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.rememberPass:
            accv.save_password = source.get_active()
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.autoLogin:
            accv.autologin = source.get_active()
コード例 #13
0
ファイル: login.py プロジェクト: pipator/amsn2
    def __switch_to_account(self, email):
        logger.info("Switching to account %s", email)

        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core)
            accv.email = email

        self.user.get_children()[0].set_text(accv.email)
        if accv.password:
            self.password.set_text(accv.password)

        self.statusCombo.set_active(self.status_values[accv.presence])

        self.rememberMe.set_active(accv.save)
        self.rememberPass.set_active(accv.save_password)
        self.autoLogin.set_active(accv.autologin)
コード例 #14
0
ファイル: login.py プロジェクト: fcox/amsn2
    def __on_toggled_cb(self, source):

        email = self.user.get_active_text()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView()
            accv.email = email

        if source is self.rememberMe:
            accv.save = source.get_active()
            self.rememberPass.set_sensitive(source.get_active())
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.rememberPass:
            accv.save_password = source.get_active()
            self.autoLogin.set_sensitive(source.get_active())
        elif source is self.autoLogin:
            accv.autologin = source.get_active()
コード例 #15
0
ファイル: login.py プロジェクト: Kjir/amsn2
    def __get_account(self):
        if self.user.get_active_text() == "":
            self.user.grab_focus()
            return
        elif self.password.get_text() == "":
            self.password.grab_focus()
            return

        email = self.user.get_active_text()
        accv = self._ui_manager.get_accountview_from_email(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        accv.password = self.password.get_text()
        iter = self.statusCombo.get_active_iter()
        model = self.statusCombo.get_model()
        status = model.get_value(iter, 2)
        accv.presence = status

        accv.save = self.rememberMe.get_active()
        accv.save_password = self.rememberPass.get_active()
        accv.autologin = self.autoLogin.get_active()

        return accv
コード例 #16
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def __switch_to_account(self, email):

        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        self.ui.comboAccount.setItemText(0, accv.email)

        if accv.password:
            self.ui.linePassword.clear()
            self.ui.linePassword.insert(accv.password)

        self.ui.checkRememberMe.setChecked(accv.save)
        self.ui.checkRememberPass.setChecked(accv.save_password)
        self.ui.checkSignInAuto.setChecked(accv.autologin)
コード例 #17
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def __switch_to_account(self, email):
        logger.info("Switching to account %s", email)

        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        self.user.get_children()[0].set_text(accv.email)
        if accv.password:
            self.password.set_text(accv.password)

        self.statusCombo.set_active(self.status_values[accv.presence])

        self.rememberMe.set_active(accv.save)
        self.rememberPass.set_active(accv.save_password)
        self.autoLogin.set_active(accv.autologin)
コード例 #18
0
ファイル: login.py プロジェクト: blueSpirit/amsn2
    def __login_clicked(self):
        email = str(self.ui.comboAccount.currentText())
        accv = self._ui_manager.get_accountview_from_email(email)

        if accv is None:
            accv = AccountView(self._amsn_core, str(email))

        accv.password = self.ui.linePassword.text().toLatin1().data()
        accv.presence = self.status_dict[str(self.ui.comboStatus.currentText())]

        accv.save = self.ui.checkRememberMe.isChecked()
        accv.save_password = self.ui.checkRememberPass.isChecked()
        accv.autologin = self.ui.checkSignInAuto.isChecked()

        self._amsn_core.signin_to_account(self, accv)
コード例 #19
0
ファイル: login.py プロジェクト: jperezq/amsn2
    def signin(self):

        if self.user.get_active_text() == "":
            self.user.grab_focus()
            return
        elif self.password.get_text() == "":
            self.password.grab_focus()
            return

        email = self.user.get_active_text()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core)
            accv.email = email

        accv.password = self.password.get_text()
        status = self.statusCombo.get_active()
        for key in self.status_values:
            if self.status_values[key] == status:
                break
        accv.presence = key

        accv.save = self.rememberMe.get_active()
        accv.save_password = self.rememberPass.get_active()
        accv.autologin = self.autoLogin.get_active()

        for box in self.input_boxes:
            self.remove(box)

        self.login = True
        self.status.show()
        pgAlign = self.pgbar.get_parent()
        pgAlign.show()
        self.pgbar.show()
        self.pack_start(pgAlign, False, False)
        self.pack_start(self.status, False, False)
        self.login_button.set_label(gtk.STOCK_DISCONNECT)
        self.reorder_child(self.fixed_boxes[1], -1)
        self.set_child_packing(self.fixed_boxes[1], True, False, 0, gtk.PACK_START)

        self._amsn_core.signinToAccount(self, accv)
        self.timer = gobject.timeout_add(40, self.__animation)
コード例 #20
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def signin(self):
        self.loginThrobber = LoginThrobber(self)
        self._parent.fadeIn(self.loginThrobber)

        email = self.ui.comboAccount.currentText()
        accv = self.getAccountViewFromEmail(str(email))

        if accv is None:
            accv = AccountView(self._amsn_core, str(email))

        accv.password = self.ui.linePassword.text().toLatin1().data()
        accv.presence = self.status_dict[str(
            self.ui.comboStatus.currentText())]

        accv.save = self.ui.checkRememberMe.isChecked()
        accv.save_password = self.ui.checkRememberPass.isChecked()
        accv.autologin = self.ui.checkSignInAuto.isChecked()

        self._amsn_core.signinToAccount(self, accv)
コード例 #21
0
ファイル: login.py プロジェクト: Pythone/amsn2
    def signin(self):

        if self.user.get_active_text() == "":
            self.user.grab_focus()
            return
        elif self.password.get_text() == "":
            self.password.grab_focus()
            return

        email = self.user.get_active_text()
        accv = self.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, email)

        accv.password = self.password.get_text()
        iter = self.statusCombo.get_active_iter()
        model = self.statusCombo.get_model()
        status = model.get_value(iter, 2)
        accv.presence = status

        accv.save = self.rememberMe.get_active()
        accv.save_password = self.rememberPass.get_active()
        accv.autologin = self.autoLogin.get_active()

        for box in self.input_boxes:
            self.remove(box)

        self.login = True
        self.status.show()
        pgAlign = self.pgbar.get_parent()
        pgAlign.show()
        self.pgbar.show()
        self.pack_start(pgAlign, False, False)
        self.pack_start(self.status, False, False)
        self.login_button.set_label(gtk.STOCK_DISCONNECT)
        self.reorder_child(self.fixed_boxes[1], -1)
        self.set_child_packing(self.fixed_boxes[1], True, False, 0,
                               gtk.PACK_START)

        self._amsn_core.signinToAccount(self, accv)
        self.timer = gobject.timeout_add(40, self.__animation)
コード例 #22
0
ファイル: login.py プロジェクト: LinuxNIT/amsn2
    def signin(self):
        self.loginThrobber = LoginThrobber(self)
        self._parent.fadeIn(self.loginThrobber)

        email = self.ui.comboAccount.currentText()
        accv = self._ui_manager.getAccountViewFromEmail(email)

        if accv is None:
            accv = AccountView(self._amsn_core, str(email))

        accv.password = self.ui.linePassword.text().toLatin1().data()
        accv.presence = self.status_dict[str(self.ui.comboStatus.currentText())]

        accv.save = self.ui.checkRememberMe.isChecked()
        accv.save_password = self.ui.checkRememberPass.isChecked()
        accv.autologin = self.ui.checkSignInAuto.isChecked()

        self._amsn_core.signinToAccount(self, accv)