示例#1
0
void GaduEditAccountWidget::dataChanged()
{
	ConfigurationValueState widgetsState = stateNotifier()->state();

	auto accountData = GaduAccountData{account()};

	if (account().accountIdentity() == Identities->currentIdentity()
		&& account().id() == AccountId->text()
		&& account().rememberPassword() == RememberPassword->isChecked()
		&& account().password() == AccountPassword->text()
		&& account().privateStatus() == ShowStatusToEveryone->isChecked()
		&& account().useDefaultProxy() == ProxyCombo->isDefaultProxySelected()
		&& account().proxy() == ProxyCombo->currentProxy()
		&& accountData.receiveImagesDuringInvisibility() == ReceiveImagesDuringInvisibility->isChecked()

		&& accountData.chatImageSizeWarning() == ChatImageSizeWarning->isChecked()

		&& m_configuration->deprecatedApi()->readBoolEntry("Network", "isDefServers", true) == useDefaultServers->isChecked()
		&& m_configuration->deprecatedApi()->readEntry("Network", "Server") == ipAddresses->text()
		&& accountData.sendTypingNotification() == SendTypingNotification->isChecked()
		&& accountData.receiveSpam() != ReceiveSpam->isChecked()
		&& !gpiw->isModified())
	{
		simpleStateNotifier()->setState(StateNotChanged);
		return;
	}

	bool sameIdExists = m_accountManager->byId(account().protocolName(), AccountId->text())
			&& m_accountManager->byId(account().protocolName(), AccountId->text()) != account();

	if (AccountId->text().isEmpty() || sameIdExists || StateChangedDataInvalid == widgetsState)
		simpleStateNotifier()->setState(StateChangedDataInvalid);
	else
		simpleStateNotifier()->setState(StateChangedDataValid);
}
示例#2
0
void GaduProtocol::setStatusFlags()
{
    if (!GaduSession)
        return;

    auto data = GaduAccountData{account()};

    int statusFlags = GG_STATUS_FLAG_UNKNOWN;
    if (!data.receiveSpam())
        statusFlags = statusFlags | GG_STATUS_FLAG_SPAM;

    gg_change_status_flags(GaduSession, GG_STATUS_FLAG_UNKNOWN | statusFlags);
}
示例#3
0
void GaduEditAccountWidget::loadAccountData()
{
	Identities->setCurrentIdentity(account().accountIdentity());
	AccountId->setText(account().id());
	RememberPassword->setChecked(account().rememberPassword());
	AccountPassword->setText(account().password());
	ShowStatusToEveryone->setChecked(account().privateStatus());
	if (account().useDefaultProxy())
		ProxyCombo->selectDefaultProxy();
	else
		ProxyCombo->setCurrentProxy(account().proxy());

	auto accountData = GaduAccountData{account()};
	ReceiveImagesDuringInvisibility->setChecked(accountData.receiveImagesDuringInvisibility());;
	ChatImageSizeWarning->setChecked(accountData.chatImageSizeWarning());
	SendTypingNotification->setChecked(accountData.sendTypingNotification());
	ReceiveSpam->setChecked(!accountData.receiveSpam());

	useDefaultServers->setChecked(m_configuration->deprecatedApi()->readBoolEntry("Network", "isDefServers", true));
	ipAddresses->setText(m_configuration->deprecatedApi()->readEntry("Network", "Server"));

	simpleStateNotifier()->setState(StateNotChanged);
}