/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QPushButton>
+#include "mainpage.h"
+
#include <QImage>
#include <QLabel>
#include <QLayout>
#include <QPainter>
+#include <QPushButton>
-#include "mainpage.h"
-#include "coreconnectdlg.h"
#include "client.h"
+#include "coreconnectdlg.h"
+#include "icon.h"
-MainPage::MainPage(QWidget *parent) : QWidget(parent)
+MainPage::MainPage(QWidget* parent)
+ : QWidget(parent)
{
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto* layout = new QVBoxLayout(this);
layout->setAlignment(Qt::AlignCenter);
- QLabel *label = new QLabel(this);
+ QLabel* label = new QLabel(this);
label->setPixmap(QPixmap(":/pics/quassel-logo.png"));
layout->addWidget(label);
if (Quassel::runMode() != Quassel::Monolithic) {
- _connectButton = new QPushButton(QIcon::fromTheme("network-connect"), tr("Connect to Core..."));
+ _connectButton = new QPushButton(icon::get("network-connect"), tr("Connect to Core..."));
_connectButton->setEnabled(Client::coreConnection()->state() == CoreConnection::Disconnected);
- connect(Client::coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), this, SLOT(coreConnectionStateChanged()));
- connect(_connectButton, SIGNAL(clicked(bool)), this, SLOT(showCoreConnectionDlg()));
+ connect(Client::coreConnection(), &CoreConnection::stateChanged, this, &MainPage::coreConnectionStateChanged);
+ connect(_connectButton, &QAbstractButton::clicked, this, &MainPage::showCoreConnectionDlg);
layout->addWidget(_connectButton);
}
}
{
if (Client::coreConnection()->state() == CoreConnection::Disconnected) {
_connectButton->setEnabled(true);
- } else {
+ }
+ else {
_connectButton->setDisabled(true);
}
}