void MRIMProtocol::RestoreAccounts () { QSettings settings (QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_Azoth_Vader_Accounts"); int size = settings.beginReadArray ("Accounts"); for (int i = 0; i < size; ++i) { settings.setArrayIndex (i); const QByteArray& data = settings.value ("SerializedData").toByteArray (); MRIMAccount *acc = MRIMAccount::Deserialize (data, this); if (!acc) { qWarning () << Q_FUNC_INFO << "undeserializable acount" << i; continue; } connect (acc, SIGNAL (accountSettingsChanged ()), this, SLOT (saveAccounts ())); Accounts_ << acc; emit accountAdded (acc); } settings.endArray (); }
void IrcAccount::FillSettings (IrcAccountConfigurationWidget *widget) { State lastState = IrcAccountState_; if (lastState != SOffline && (RealName_ != widget->GetRealName () || UserName_ != widget->GetUserName () || NickNames_ != widget->GetNickNames ())) { ChangeState (EntryStatus (SOffline, QString ())); } RealName_ = widget->GetRealName (); UserName_ = widget->GetUserName (); NickNames_ = widget->GetNickNames (); DefaultServer_ = widget->GetDefaultServer (); DefaultPort_ = widget->GetDefaultPort (); DefaultEncoding_ = widget->GetDefaultEncoding (); DefaultChannel_ = widget->GetDefaultChannel (); if (lastState != SOffline) ChangeState (EntryStatus (lastState, QString ())); emit accountSettingsChanged (); }
void IrcProtocol::RestoreAccounts () { QSettings settings (QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_Azoth_Acetamide_Accounts"); int size = settings.beginReadArray ("Accounts"); for (int i = 0; i < size; ++i) { settings.setArrayIndex (i); QByteArray data = settings.value ("SerializedData").toByteArray (); IrcAccount *acc = IrcAccount::Deserialize (data, this); if (!acc) { qWarning () << Q_FUNC_INFO << "unserializable acount" << i; continue; } connect (acc, SIGNAL (accountSettingsChanged ()), this, SLOT (saveAccounts ())); if (acc->GetAccountName () == "DefaultIrcAccount") Core::Instance ().SetDefaultIrcAcoount (acc); else Accounts_ << acc; emit accountAdded (acc); } }
void MSNAccount::handleGotOurFriendlyName (const QString& name) { if (OurFriendlyName_ == name) return; OurFriendlyName_ = name; emit accountSettingsChanged (); }
void LJAccount::FillSettings (LJAccountConfigurationWidget *widget) { Login_ = widget->GetLogin (); const QString& pass = widget->GetPassword (); if (!pass.isNull ()) Util::SavePassword (pass, "org.LeechCraft.Blogique.PassForAccount/" + GetAccountID (), &Core::Instance ()); emit accountSettingsChanged (); Validate (); }
void IrcProtocol::InitiateAccountRegistration () { QString name = QInputDialog::getText (0, "LeechCraft", tr ("Enter new account name")); if (name.isEmpty ()) return; IrcAccount *account = new IrcAccount (name, this); account->OpenConfigurationDialog (); connect (account, SIGNAL (accountSettingsChanged ()), this, SLOT (saveAccounts ())); Accounts_ << account; saveAccounts (); emit accountAdded (account); // account->ChangeState (EntryStatus (SOnline, QString ())); }
void MSNAccount::RenameAccount (const QString& name) { Name_ = name; emit accountRenamed (name); emit accountSettingsChanged (); }