Example #1
0
	void AccountsManager::InitiateAccountAddition ()
	{
		const auto acc = std::make_shared<Account> (ProgressMgr_);

		acc->OpenConfigDialog ([acc, this]
				{
					if (acc->IsNull ())
						return;

					AddAccountImpl (acc);

					saveAccounts ();
				});
	}
Example #2
0
	void Core::LoadAccounts ()
	{
		QSettings settings (QCoreApplication::organizationName (),
				QCoreApplication::applicationName () + "_Snails_Accounts");
		Q_FOREACH (const QVariant& var, settings.value ("Accounts").toList ())
		{
			Account_ptr acc (new Account);
			try
			{
				acc->Deserialize (var.toByteArray ());
			}
			catch (const std::exception& e)
			{
				qWarning () << Q_FUNC_INFO
						<< "unable to deserialize account, sorry :("
						<< e.what ();
				continue;
			}
			AddAccountImpl (acc);
		}
	}
Example #3
0
	void AccountsManager::LoadAccounts ()
	{
		QSettings settings (QCoreApplication::organizationName (),
				QCoreApplication::applicationName () + "_Snails_Accounts");
		for (const auto& var : settings.value ("Accounts").toList ())
		{
			const auto acc = std::make_shared<Account> (ProgressMgr_);
			try
			{
				acc->Deserialize (var.toByteArray ());
			}
			catch (const std::exception& e)
			{
				qWarning () << Q_FUNC_INFO
						<< "unable to deserialize account, sorry :("
						<< e.what ();
				continue;
			}
			AddAccountImpl (acc);
		}
	}
Example #4
0
	void Core::AddAccount (Account_ptr account)
	{
		AddAccountImpl (account);

		saveAccounts ();
	}
Example #5
0
	void AccountsManager::AddAccount (Account_ptr account)
	{
		AddAccountImpl (account);

		saveAccounts ();
	}