Exemplo n.º 1
0
void LoginForm::onLinkClick( wxCommandEvent& event )
{
	if ( event.GetId() == m_linkNewAccount->GetId() )
	{
		onNewAccount();
	}
	else if ( event.GetId() == m_linkLostPassword->GetId() )
	{
		PasswordReminder wxPassReminderForm( this );

		m_pNewAccount = &wxPassReminderForm;
		wxPassReminderForm.ShowModal();
		m_pNewAccount = nullptr;
	}
	else if ( event.GetId() == m_linkOffline->GetId() )
	{
		if ( GetParent() )
		{
			Show( false );

			MainApp* temp = dynamic_cast<MainApp*>(GetParent());
			if ( temp )
				temp->offlineMode();
		}
	}
}
{
    Q_UNUSED(op);

    mAccSet = mAM->validAccounts();

    foreach (Tp::AccountPtr account, mAccSet->accounts())
        if (!account->cmName().count(QRegExp("ring|mmscm")))
        {
            connect(account->becomeReady(),
                    SIGNAL(finished(Tp::PendingOperation*)),
                    SLOT(onAccountReady(Tp::PendingOperation*)));
        }

    connect(mAM.data(),
            SIGNAL(newAccount(Tp::AccountPtr)),
            SLOT(onNewAccount(Tp::AccountPtr)));
}

void MWidgetAvialability::onNewAccount(Tp::AccountPtr newaccount)
{
    connect(newaccount->becomeReady(),
            SIGNAL(finished(Tp::PendingOperation*)),
            SLOT(onAccountReady(Tp::PendingOperation*)));
}

void MWidgetAvialability::onAccountReady(Tp::PendingOperation *op)
{
    Tp::AccountPtr account = Tp::AccountPtr::staticCast(op->object());
    AccountWrapper *wrapper = new AccountWrapper(this, account);
    m_mainLayout->addItem(wrapper);