Exemplo n.º 1
0
void IrcConnectionWizard::identityReady(IdentityId id)
{
    disconnect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
    NetworkPage *networkPage = static_cast<NetworkPage *>(_networkPage);
    NetworkInfo networkInfo = networkPage->networkInfo();
    QStringList channels = networkPage->channelList();
    networkInfo.identity = id;
    connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(networkReady(NetworkId)));
    Client::createNetwork(networkInfo, channels);
}
Exemplo n.º 2
0
void IrcConnectionWizard::finishClicked()
{
    CertIdentity *identity = static_cast<IdentityPage *>(_identityPage)->identity();
    if (identity->id().isValid()) {
        Client::updateIdentity(identity->id(), identity->toVariantMap());
        identityReady(identity->id());
    }
    else {
        connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
        Client::createIdentity(*identity);
    }
}
  foreach(int mib, QTextCodec::availableMibs()) {
    QByteArray codec = QTextCodec::codecForMib(mib)->name();
    ui.sendEncoding->addItem(codec);
    ui.recvEncoding->addItem(codec);
    ui.serverEncoding->addItem(codec);
  }
  ui.sendEncoding->model()->sort(0);
  ui.recvEncoding->model()->sort(0);
  ui.serverEncoding->model()->sort(0);
  currentId = 0;
  setEnabled(Client::isConnected());  // need a core connection!
  setWidgetStates();
  connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
  connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientNetworkAdded(NetworkId)));
  connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientNetworkRemoved(NetworkId)));
  connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(clientIdentityAdded(IdentityId)));
  connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientIdentityRemoved(IdentityId)));

  connect(ui.identityList, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
  //connect(ui.randomServer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
  connect(ui.performEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged()));
  connect(ui.autoIdentify, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
  connect(ui.autoIdentifyService, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged()));
  connect(ui.autoIdentifyPassword, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged()));
  connect(ui.sasl, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
  connect(ui.saslAccount, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged()));
  connect(ui.saslPassword, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged()));
  connect(ui.useCustomEncodings, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
  connect(ui.sendEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
  connect(ui.recvEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
  connect(ui.serverEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));