/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <QVBoxLayout>
IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags)
- : QWizard(parent, flags),
- _introductionPage(0),
- _identityPage(0),
- _networkPage(0)
+ : QWizard(parent, flags)
{
_introductionPage = createIntroductionPage(this);
_identityPage = new IdentityPage(this);
setOptions(options() | (QWizard::WizardOptions)(QWizard::NoDefaultButton | QWizard::CancelButtonOnLeft));
setOption(QWizard::NoCancelButton, false);
- connect(button(QWizard::FinishButton), SIGNAL(clicked()), this, SLOT(finishClicked()));
+ connect(button(QWizard::FinishButton), &QAbstractButton::clicked, this, &IrcConnectionWizard::finishClicked);
setButtonText(QWizard::FinishButton, tr("Save && Connect"));
}
QWizardPage *IrcConnectionWizard::createIntroductionPage(QWidget *parent)
{
- QWizardPage *page = new QWizardPage(parent);
+ auto *page = new QWizardPage(parent);
page->setTitle(QObject::tr("Welcome to Quassel IRC"));
QLabel *label = new QLabel(QObject::tr("This wizard will help you to set up your default identity and your IRC network connection.<br>"
"This only covers basic settings. You can cancel this wizard any time and use the settings dialog for more detailed changes."), page);
label->setWordWrap(true);
- QVBoxLayout *layout = new QVBoxLayout;
+ auto *layout = new QVBoxLayout;
layout->addWidget(label);
page->setLayout(layout);
return page;
identityReady(identity->id());
}
else {
- connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
+ connect(Client::instance(), &Client::identityCreated, this, &IrcConnectionWizard::identityReady);
Client::createIdentity(*identity);
}
}
void IrcConnectionWizard::identityReady(IdentityId id)
{
- disconnect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
- NetworkPage *networkPage = static_cast<NetworkPage *>(_networkPage);
+ disconnect(Client::instance(), &Client::identityCreated, this, &IrcConnectionWizard::identityReady);
+ auto *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)));
+ connect(Client::instance(), &Client::networkCreated, this, &IrcConnectionWizard::networkReady);
Client::createNetwork(networkInfo, channels);
}
void IrcConnectionWizard::networkReady(NetworkId id)
{
- disconnect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(networkReady(NetworkId)));
+ disconnect(Client::instance(), &Client::networkCreated, this, &IrcConnectionWizard::networkReady);
const Network *net = Client::network(id);
Q_ASSERT(net);
net->requestConnect();
// Identity Page
IdentityPage::IdentityPage(QWidget *parent)
: QWizardPage(parent),
- _identityEditWidget(new IdentityEditWidget(this)),
- _identity(0)
+ _identityEditWidget(new IdentityEditWidget(this))
{
setTitle(tr("Setup Identity"));
_identityEditWidget->displayIdentity(_identity);
_identityEditWidget->showAdvanced(false);
- QVBoxLayout *layout = new QVBoxLayout;
+ auto *layout = new QVBoxLayout;
layout->addWidget(_identityEditWidget);
setLayout(layout);
}
setTitle(tr("Setup Network Connection"));
- QVBoxLayout *layout = new QVBoxLayout;
+ auto *layout = new QVBoxLayout;
layout->addWidget(_networkEditor);
setLayout(layout);
}