void ConfigWizardSetUpAccountPage::initializePage()
{
    ProtocolFactory *pf = field("choose-network.protocol-factory").value<ProtocolFactory *>();
    if (!pf)
        return;

    if (field("choose-network.new").toBool())
        AccountWidget = pf->newCreateAccountWidget(false, this);
    else if (field("choose-network.existing").toBool())
        AccountWidget = pf->newAddAccountWidget(false, this);

    if (AccountWidget)
    {
        formLayout()->addRow(QString(), AccountWidget.data());

        if (AccountWidget.data()->stateNotifier())
            connect(
                AccountWidget.data()->stateNotifier(), SIGNAL(stateChanged(ConfigurationValueState)), this,
                SIGNAL(completeChanged()));
        // NOTE: This signal is declared by AccountCreateWidget and AccountCreateWidget
        // but not by ModalConfigurationWidget. It will work correctly with Qt meta-object system, though.
        connect(AccountWidget.data(), SIGNAL(accountCreated(Account)), this, SLOT(accountCreated(Account)));
        // Same as above, window() is QWizard.
        connect(AccountWidget.data(), SIGNAL(destroyed()), window(), SLOT(back()));
    }
}
AccountsModelPrivate::AccountsModelPrivate(AccountsModel *model)
 : m_manager(new Accounts::Manager(this))
 , q(model)
{
    m_accIdList = m_manager->accountList();
    m_accIdList.append(0); //For the dummy account Create

    connect(m_manager, SIGNAL(accountCreated(Accounts::AccountId)), 
            q, SLOT(accountCreated(Accounts::AccountId)));
    connect(m_manager, SIGNAL(accountRemoved(Accounts::AccountId)), 
            q, SLOT(accountRemoved(Accounts::AccountId)));
}
Esempio n. 3
0
void JabberAddAccountWidget::apply()
{
    auto jabberAccount = m_accountStorage->create("jabber");

    jabberAccount.setId(Username->text() + '@' + Domain->currentText());
    jabberAccount.setPassword(AccountPassword->text());
    jabberAccount.setHasPassword(!AccountPassword->text().isEmpty());
    jabberAccount.setRememberPassword(RememberPassword->isChecked());
    // bad code: order of calls is important here
    // we have to set identity after password
    // so in cache of identity status container it already knows password and can do status change without asking user
    // for it
    jabberAccount.setAccountIdentity(Identity->currentIdentity());

    auto accountData = JabberAccountData{jabberAccount};
    accountData.setResource("Kadu");
    accountData.setPriority(5);

    bool isGoogleAppsAccount = m_isGmail && !Domain->currentText().contains("gmail");
    // Google Apps account sometimes needs custom host/port settings to work
    if (isGoogleAppsAccount)
    {
        accountData.setUseCustomHostPort(true);
        accountData.setCustomHost("talk.google.com");
        accountData.setCustomPort(5222);
    }

    resetGui();

    emit accountCreated(jabberAccount);
}
TransferEnginePrivate::TransferEnginePrivate(TransferEngine *parent):
    m_notificationsEnabled(true),
    m_settings(CONFIG_PATH, QSettings::IniFormat),
    q_ptr(parent)
{
    m_fileWatcherTimer = new QTimer(this);
    m_fileWatcherTimer->setSingleShot(true);
    connect(m_fileWatcherTimer, SIGNAL(timeout()), this, SLOT(enabledPluginsCheck()));

    m_fileWatcher = new QFileSystemWatcher(this);
    m_fileWatcher->addPath(SHARE_PLUGINS_PATH);
    connect(m_fileWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(pluginDirChanged()));

    m_accountManager = new Accounts::Manager("sharing", this);
    connect(m_accountManager, SIGNAL(accountCreated(Accounts::AccountId)), this, SLOT(enabledPluginsCheck()));
    connect(m_accountManager, SIGNAL(accountRemoved(Accounts::AccountId)), this, SLOT(enabledPluginsCheck()));
    connect(m_accountManager, SIGNAL(accountUpdated(Accounts::AccountId)), this, SLOT(enabledPluginsCheck()));

    // Exit safely stuff if we recieve certain signal or there are no active transfers
    Q_Q(TransferEngine);
    connect(TransferEngineSignalHandler::instance(), SIGNAL(exitSafely()), this, SLOT(exitSafely()));
    connect(q, SIGNAL(statusChanged(int,int)), this, SLOT(exitSafely()));

    // Monitor expired transfers and cleanup them if required
    m_activityMonitor = new ClientActivityMonitor(this);
    connect(m_activityMonitor, SIGNAL(transfersExpired(QList<int>)), this, SLOT(cleanupExpiredTransfers(QList<int>)));
}
Esempio n. 5
0
void JabberAddAccountWidget::apply()
{
	Account jabberAccount = Account::create("jabber");

	jabberAccount.setId(Username->text() + '@' + Domain->currentText());
	jabberAccount.setPassword(AccountPassword->text());
	jabberAccount.setHasPassword(!AccountPassword->text().isEmpty());
	jabberAccount.setRememberPassword(RememberPassword->isChecked());
	// bad code: order of calls is important here
	// we have to set identity after password
	// so in cache of identity status container it already knows password and can do status change without asking user for it
	jabberAccount.setAccountIdentity(Identity->currentIdentity());

	JabberAccountDetails *details = dynamic_cast<JabberAccountDetails *>(jabberAccount.details());
	if (details)
	{
		details->setState(StorableObject::StateNew);
		details->setResource("Kadu");
		details->setPriority(5);

		bool isGoogleAppsAccount = Factory->name() == "gmail/google talk" && !Domain->currentText().contains("gmail");
		// Google Apps account sometimes needs custom host/port settings to work
		if (isGoogleAppsAccount)
		{
			details->setUseCustomHostPort(true);
			details->setCustomHost("talk.google.com");
			details->setCustomPort(5222);
		}
	}

	resetGui();

	emit accountCreated(jabberAccount);
}
void TlenCreateAccountWidget::addThisAccount()
{
	Account *tlenAccount = TlenProtocolFactory::instance()->newAccount();
	tlenAccount->setName(AccountName->text());
	tlenAccount->setId(AccountId->text());
	tlenAccount->setPassword(AccountPassword->text());
	tlenAccount->setRememberPassword(RememberPassword->isChecked());

	emit accountCreated(tlenAccount);
}
Esempio n. 7
0
IrcAccount *IrcProtocol::getAccount(const QString &id, bool create)
{
	IrcAccount *account = d->accounts_hash->value(id).data();
	if (!account && create) {
		account = new IrcAccount(id);
		d->accounts_hash->insert(id, account);
		emit accountCreated(account);
	}
	return account;
}
Esempio n. 8
0
AccountAddWidget * YourAccounts::getAccountAddWidget(ProtocolFactory *protocol)
{
	if (!protocol)
		return 0;

	if (!AddWidgets.contains(protocol))
	{
		AccountAddWidget *widget = protocol->newAddAccountWidget(true, CreateAddStack);
		Q_ASSERT(widget);

		AddWidgets.insert(protocol, widget);
		connect(widget, SIGNAL(accountCreated(Account)), this, SLOT(accountCreated(Account)));
		CreateAddStack->addWidget(widget);

		return widget;
	}

	return AddWidgets.value(protocol);
}
Esempio n. 9
0
IrcAccount *IrcProtocol::getAccount(const QString &id, bool create, bool do_not_emit)
{
	IrcAccount *account = d->accounts_hash.value(id).data();
	if (!account && create) {
		account = new IrcAccount(id);
		d->accounts_hash.insert(id, account);

		// Note: see issue #386 on github for explanation.
		// TODO FIXME: that's just not cool
		if(!do_not_emit)
			emit accountCreated(account);
	}
	return account;
}
Esempio n. 10
0
void TlenAddAccountWidget::addAccountButtonClicked()
{
	Account tlenAccount = Account::create();

	TlenAccountDetails *details = dynamic_cast<TlenAccountDetails *>(tlenAccount.details());
	if (details)
	{
		details->setState(StorableObject::StateNew);
	}

	tlenAccount.setProtocolName("tlen");
	tlenAccount.setId(AccountId->text());
	tlenAccount.setPassword(AccountPassword->text());
	tlenAccount.setHasPassword(!AccountPassword->text().isEmpty());
	tlenAccount.setRememberPassword(RememberPassword->isChecked());

	emit accountCreated(tlenAccount);
}
Esempio n. 11
0
void FacebookAddAccountWidget::apply()
{
    auto facebookAccount = m_accountStorage->create("facebook");

    facebookAccount.setId(m_username->text());
    facebookAccount.setPassword(m_password->text());
    facebookAccount.setHasPassword(!m_password->text().isEmpty());
    facebookAccount.setRememberPassword(m_rememberPassword->isChecked());
    // bad code: order of calls is important here
    // we have to set identity after password
    // so in cache of identity status container it already knows password and can do status change without asking user
    // for it
    facebookAccount.setAccountIdentity(m_identity->currentIdentity());

    resetGui();

    emit accountCreated(facebookAccount);
}
Esempio n. 12
0
void GaduAddAccountWidget::apply()
{
	Account gaduAccount = Account::create("gadu");

	gaduAccount.setId(AccountId->text());
	gaduAccount.setPassword(AccountPassword->text());
	gaduAccount.setHasPassword(!AccountPassword->text().isEmpty());
	gaduAccount.setRememberPassword(RememberPassword->isChecked());
	// bad code: order of calls is important here
	// we have to set identity after password
	// so in cache of identity status container it already knows password and can do status change without asking user for it
	gaduAccount.setAccountIdentity(Identity->currentIdentity());

	GaduAccountDetails *details = dynamic_cast<GaduAccountDetails *>(gaduAccount.details());
	if (details)
		details->setState(StorableObject::StateNew);

	resetGui();

	emit accountCreated(gaduAccount);
}
Esempio n. 13
0
AccountsDaemon::AccountsDaemon(QObject *parent, const QList<QVariant>&)
 : KDEDModule(parent)
{
    QMetaObject::invokeMethod(this, "startDaemon", Qt::QueuedConnection);
    connect(KAccounts::accountsManager(), SIGNAL(accountCreated(Accounts::AccountId)), SLOT(accountCreated(Accounts::AccountId)));
    connect(KAccounts::accountsManager(), SIGNAL(accountRemoved(Accounts::AccountId)), SLOT(accountRemoved(Accounts::AccountId)));

    QStringList pluginPaths;

    QStringList paths = QCoreApplication::libraryPaths();
    Q_FOREACH (const QString &libraryPath, paths) {
        QString path(libraryPath + QStringLiteral("/kaccounts/daemonplugins"));
        QDir dir(path);

        if (!dir.exists()) {
            continue;
        }

        QStringList dirEntries = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);

        Q_FOREACH(const QString &file, dirEntries) {
            pluginPaths.append(path + '/' + file);
        }
void JabberCreateAccountWidget::jidRegistered(const QString &jid, const QString &tlsDomain)
{
	if (jid.isEmpty())
		return;

	Account jabberAccount = Account::create();
	jabberAccount.setProtocolName("jabber");
	jabberAccount.setAccountIdentity(IdentityCombo->currentIdentity());
	jabberAccount.setId(jid);
	jabberAccount.setHasPassword(true);
	jabberAccount.setPassword(NewPassword->text());
	jabberAccount.setRememberPassword(RememberPassword->isChecked());

	JabberAccountDetails *details = dynamic_cast<JabberAccountDetails *>(jabberAccount.details());
	if (details)
	{
		details->setState(StorableObject::StateNew);
		details->setTlsOverrideDomain(tlsDomain);
	}

	resetGui();

	emit accountCreated(jabberAccount);
}
 void UserAccountCreationWidget::userAccountCreatedSuccessfully(QString login,
                                                                quint32 id)
 {
     QString password = _ui->newPasswordLineEdit->text();
     emit accountCreated(login, password, id);
 }
Esempio n. 16
0
void IrcProtocol::emitAccountCreated(IrcAccount *account) {
	emit accountCreated(account);
}