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); }
void GaduProtocol::configureServices() { auto accountData = GaduAccountData{account()}; CurrentChatStateService->setSendTypingNotifications(accountData.sendTypingNotification()); switch (statusTypeManager()->statusTypeData(status().type()).typeGroup()) { case StatusTypeGroup::Offline: CurrentChatImageService->setReceiveImages(false); break; case StatusTypeGroup::Invisible: CurrentChatImageService->setReceiveImages(accountData.receiveImagesDuringInvisibility()); break; default: CurrentChatImageService->setReceiveImages(true); break; } }
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); }