Refactor files in src/dialogs to new Qt Slot/Signal syntax (#5846)

* Refactor to use new signal/slot syntax in src/dialogs

* add todo comment

* fix build failure

* fix build failure
This commit is contained in:
RickyRister 2025-04-17 20:30:26 -07:00 committed by GitHub
parent 653362567b
commit 2dc1b875d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 153 additions and 153 deletions

View file

@ -34,11 +34,12 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
btnRefreshServers->setToolTip(tr("Refresh the server list with known public servers")); btnRefreshServers->setToolTip(tr("Refresh the server list with known public servers"));
btnRefreshServers->setFixedWidth(30); btnRefreshServers->setFixedWidth(30);
connect(hps, SIGNAL(sigPublicServersDownloadedSuccessfully()), this, SLOT(rebuildComboBoxList())); connect(hps, &HandlePublicServers::sigPublicServersDownloadedSuccessfully, this, [this] { rebuildComboBoxList(); });
connect(hps, SIGNAL(sigPublicServersDownloadedUnsuccessfully(int)), this, SLOT(rebuildComboBoxList(int))); connect(hps, &HandlePublicServers::sigPublicServersDownloadedUnsuccessfully, this,
connect(btnRefreshServers, SIGNAL(released()), this, SLOT(downloadThePublicServers())); &DlgConnect::rebuildComboBoxList);
connect(btnRefreshServers, &QPushButton::released, this, &DlgConnect::downloadThePublicServers);
connect(this, SIGNAL(sigPublicServersDownloaded()), this, SLOT(rebuildComboBoxList())); connect(this, &DlgConnect::sigPublicServersDownloaded, this, [this] { rebuildComboBoxList(); });
preRebuildComboBoxList(); preRebuildComboBoxList();
newHostButton = new QRadioButton(tr("New Host"), this); newHostButton = new QRadioButton(tr("New Host"), this);
@ -102,17 +103,17 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
btnForgotPassword->setIcon(QPixmap("theme:icons/forgot_password")); btnForgotPassword->setIcon(QPixmap("theme:icons/forgot_password"));
btnForgotPassword->setToolTip(tr("Reset Password")); btnForgotPassword->setToolTip(tr("Reset Password"));
btnForgotPassword->setFixedWidth(30); btnForgotPassword->setFixedWidth(30);
connect(btnForgotPassword, SIGNAL(released()), this, SLOT(actForgotPassword())); connect(btnForgotPassword, &QPushButton::released, this, &DlgConnect::actForgotPassword);
forgotPasswordLabel = new QLabel(tr("Forgot password?")); forgotPasswordLabel = new QLabel(tr("Forgot password?"));
forgotPasswordLabel->setBuddy(btnForgotPassword); forgotPasswordLabel->setBuddy(btnForgotPassword);
btnConnect = new QPushButton(tr("&Connect")); btnConnect = new QPushButton(tr("&Connect"));
connect(btnConnect, SIGNAL(released()), this, SLOT(actOk())); connect(btnConnect, &QPushButton::released, this, &DlgConnect::actOk);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel); auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel);
buttonBox->addButton(btnConnect, QDialogButtonBox::AcceptRole); buttonBox->addButton(btnConnect, QDialogButtonBox::AcceptRole);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgConnect::reject);
newHolderLayout = new QHBoxLayout; newHolderLayout = new QHBoxLayout;
newHolderLayout->addWidget(previousHosts); newHolderLayout->addWidget(previousHosts);
@ -171,12 +172,12 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
setFixedHeight(sizeHint().height()); setFixedHeight(sizeHint().height());
setMinimumWidth(300); setMinimumWidth(300);
connect(previousHostButton, SIGNAL(toggled(bool)), this, SLOT(previousHostSelected(bool))); connect(previousHostButton, &QRadioButton::toggled, this, &DlgConnect::previousHostSelected);
connect(newHostButton, SIGNAL(toggled(bool)), this, SLOT(newHostSelected(bool))); connect(newHostButton, &QRadioButton::toggled, this, &DlgConnect::newHostSelected);
previousHostButton->setChecked(true); previousHostButton->setChecked(true);
connect(previousHosts, SIGNAL(currentTextChanged(const QString &)), this, SLOT(updateDisplayInfo(const QString &))); connect(previousHosts, &QComboBox::currentTextChanged, this, &DlgConnect::updateDisplayInfo);
playernameEdit->setFocus(); playernameEdit->setFocus();
} }

View file

@ -117,7 +117,7 @@ void DlgCreateGame::sharedCtor()
grid->addWidget(rememberGameSettings, 3, 0); grid->addWidget(rememberGameSettings, 3, 0);
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgCreateGame::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);
@ -158,8 +158,8 @@ DlgCreateGame::DlgCreateGame(TabRoom *_room, const QMap<int, QString> &_gameType
clearButton = new QPushButton(tr("&Clear")); clearButton = new QPushButton(tr("&Clear"));
buttonBox->addButton(QDialogButtonBox::Cancel); buttonBox->addButton(QDialogButtonBox::Cancel);
buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole); buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOK())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgCreateGame::actOK);
connect(clearButton, SIGNAL(clicked()), this, SLOT(actReset())); connect(clearButton, &QPushButton::clicked, this, &DlgCreateGame::actReset);
setWindowTitle(tr("Create game")); setWindowTitle(tr("Create game"));
} }
@ -204,7 +204,7 @@ DlgCreateGame::DlgCreateGame(const ServerInfo_Game &gameInfo, const QMap<int, QS
gameTypeCheckBox->setChecked(types.contains(gameTypeIterator.key())); gameTypeCheckBox->setChecked(types.contains(gameTypeIterator.key()));
} }
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgCreateGame::accept);
setWindowTitle(tr("Game information")); setWindowTitle(tr("Game information"));
} }
@ -279,7 +279,7 @@ void DlgCreateGame::actOK()
SettingsCache::instance().setGameTypes(_gameTypes); SettingsCache::instance().setGameTypes(_gameTypes);
} }
PendingCommand *pend = room->prepareRoomCommand(cmd); PendingCommand *pend = room->prepareRoomCommand(cmd);
connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(checkResponse(Response))); connect(pend, &PendingCommand::finished, this, &DlgCreateGame::checkResponse);
room->sendRoomCommand(pend); room->sendRoomCommand(pend);
buttonBox->setEnabled(false); buttonBox->setEnabled(false);

View file

@ -36,7 +36,7 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
nameEdit->setFocus(); nameEdit->setFocus();
}); });
connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateSearch(const QString &))); connect(nameEdit, &QLineEdit::textChanged, this, &DlgCreateToken::updateSearch);
nameLabel->setBuddy(nameEdit); nameLabel->setBuddy(nameEdit);
colorLabel = new QLabel(tr("C&olor:")); colorLabel = new QLabel(tr("C&olor:"));
@ -82,9 +82,9 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
cardDatabaseDisplayModel->setSourceModel(cardDatabaseModel); cardDatabaseDisplayModel->setSourceModel(cardDatabaseModel);
chooseTokenFromAllRadioButton = new QRadioButton(tr("Show &all tokens")); chooseTokenFromAllRadioButton = new QRadioButton(tr("Show &all tokens"));
connect(chooseTokenFromAllRadioButton, SIGNAL(toggled(bool)), this, SLOT(actChooseTokenFromAll(bool))); connect(chooseTokenFromAllRadioButton, &QRadioButton::toggled, this, &DlgCreateToken::actChooseTokenFromAll);
chooseTokenFromDeckRadioButton = new QRadioButton(tr("Show tokens from this &deck")); chooseTokenFromDeckRadioButton = new QRadioButton(tr("Show tokens from this &deck"));
connect(chooseTokenFromDeckRadioButton, SIGNAL(toggled(bool)), this, SLOT(actChooseTokenFromDeck(bool))); connect(chooseTokenFromDeckRadioButton, &QRadioButton::toggled, this, &DlgCreateToken::actChooseTokenFromDeck);
QByteArray deckHeaderState = SettingsCache::instance().layouts().getDeckEditorDbHeaderState(); QByteArray deckHeaderState = SettingsCache::instance().layouts().getDeckEditorDbHeaderState();
chooseTokenView = new QTreeView; chooseTokenView = new QTreeView;
@ -104,9 +104,9 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
chooseTokenView->header()->hideSection(1); // Sets chooseTokenView->header()->hideSection(1); // Sets
chooseTokenView->header()->hideSection(2); // Mana Cost chooseTokenView->header()->hideSection(2); // Mana Cost
chooseTokenView->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); // Color(s) chooseTokenView->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); // Color(s)
connect(chooseTokenView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, connect(chooseTokenView->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
SLOT(tokenSelectionChanged(QModelIndex, QModelIndex))); &DlgCreateToken::tokenSelectionChanged);
connect(chooseTokenView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(actOk())); connect(chooseTokenView, &QTreeView::doubleClicked, this, &DlgCreateToken::actOk);
if (predefinedTokens.isEmpty()) { if (predefinedTokens.isEmpty()) {
chooseTokenFromAllRadioButton->setChecked(true); chooseTokenFromAllRadioButton->setChecked(true);
@ -135,8 +135,8 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
hbox->setColumnStretch(1, 1); hbox->setColumnStretch(1, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgCreateToken::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(actReject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgCreateToken::actReject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(hbox); mainLayout->addLayout(hbox);

View file

@ -22,7 +22,7 @@ DlgEditAvatar::DlgEditAvatar(QWidget *parent) : QDialog(parent), image()
textLabel = new QLabel(tr("To change your avatar, choose a new image.\nTo remove your current avatar, confirm " textLabel = new QLabel(tr("To change your avatar, choose a new image.\nTo remove your current avatar, confirm "
"without choosing a new image.")); "without choosing a new image."));
browseButton = new QPushButton(tr("Browse...")); browseButton = new QPushButton(tr("Browse..."));
connect(browseButton, SIGNAL(clicked()), this, SLOT(actBrowse())); connect(browseButton, &QPushButton::clicked, this, &DlgEditAvatar::actBrowse);
QGridLayout *grid = new QGridLayout; QGridLayout *grid = new QGridLayout;
grid->addWidget(imageLabel, 0, 0, 1, 2); grid->addWidget(imageLabel, 0, 0, 1, 2);
@ -30,8 +30,8 @@ DlgEditAvatar::DlgEditAvatar(QWidget *parent) : QDialog(parent), image()
grid->addWidget(browseButton, 1, 1); grid->addWidget(browseButton, 1, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEditAvatar::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEditAvatar::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -44,8 +44,8 @@ DlgEditPassword::DlgEditPassword(QWidget *parent) : QDialog(parent)
grid->addWidget(newPasswordEdit2, 2, 1); grid->addWidget(newPasswordEdit2, 2, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEditPassword::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEditPassword::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -40,19 +40,19 @@ DlgEditTokens::DlgEditTokens(QWidget *parent) : QDialog(parent), currentCard(nul
colorEdit->addItem(tr("multicolor"), QChar('m')); colorEdit->addItem(tr("multicolor"), QChar('m'));
colorEdit->addItem(tr("colorless"), QChar()); colorEdit->addItem(tr("colorless"), QChar());
colorLabel->setBuddy(colorEdit); colorLabel->setBuddy(colorEdit);
connect(colorEdit, SIGNAL(currentIndexChanged(int)), this, SLOT(colorChanged(int))); connect(colorEdit, qOverload<int>(&QComboBox::currentIndexChanged), this, &DlgEditTokens::colorChanged);
ptLabel = new QLabel(tr("&P/T:")); ptLabel = new QLabel(tr("&P/T:"));
ptEdit = new QLineEdit; ptEdit = new QLineEdit;
ptEdit->setMaxLength(MAX_NAME_LENGTH); ptEdit->setMaxLength(MAX_NAME_LENGTH);
ptLabel->setBuddy(ptEdit); ptLabel->setBuddy(ptEdit);
connect(ptEdit, SIGNAL(textChanged(QString)), this, SLOT(ptChanged(QString))); connect(ptEdit, &QLineEdit::textChanged, this, &DlgEditTokens::ptChanged);
annotationLabel = new QLabel(tr("&Annotation:")); annotationLabel = new QLabel(tr("&Annotation:"));
annotationEdit = new QLineEdit; annotationEdit = new QLineEdit;
annotationEdit->setMaxLength(MAX_NAME_LENGTH); annotationEdit->setMaxLength(MAX_NAME_LENGTH);
annotationLabel->setBuddy(annotationEdit); annotationLabel->setBuddy(annotationEdit);
connect(annotationEdit, SIGNAL(textChanged(QString)), this, SLOT(annotationChanged(QString))); connect(annotationEdit, &QLineEdit::textChanged, this, &DlgEditTokens::annotationChanged);
auto *grid = new QGridLayout; auto *grid = new QGridLayout;
grid->addWidget(nameLabel, 0, 0); grid->addWidget(nameLabel, 0, 0);
@ -87,15 +87,15 @@ DlgEditTokens::DlgEditTokens(QWidget *parent) : QDialog(parent), currentCard(nul
chooseTokenView->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); chooseTokenView->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
chooseTokenView->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); chooseTokenView->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
connect(chooseTokenView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, connect(chooseTokenView->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
SLOT(tokenSelectionChanged(QModelIndex, QModelIndex))); &DlgEditTokens::tokenSelectionChanged);
QAction *aAddToken = new QAction(tr("Add token"), this); QAction *aAddToken = new QAction(tr("Add token"), this);
aAddToken->setIcon(QPixmap("theme:icons/increment")); aAddToken->setIcon(QPixmap("theme:icons/increment"));
connect(aAddToken, SIGNAL(triggered()), this, SLOT(actAddToken())); connect(aAddToken, &QAction::triggered, this, &DlgEditTokens::actAddToken);
QAction *aRemoveToken = new QAction(tr("Remove token"), this); QAction *aRemoveToken = new QAction(tr("Remove token"), this);
aRemoveToken->setIcon(QPixmap("theme:icons/decrement")); aRemoveToken->setIcon(QPixmap("theme:icons/decrement"));
connect(aRemoveToken, SIGNAL(triggered()), this, SLOT(actRemoveToken())); connect(aRemoveToken, &QAction::triggered, this, &DlgEditTokens::actRemoveToken);
auto *databaseToolBar = new QToolBar; auto *databaseToolBar = new QToolBar;
databaseToolBar->addAction(aAddToken); databaseToolBar->addAction(aAddToken);
@ -110,8 +110,8 @@ DlgEditTokens::DlgEditTokens(QWidget *parent) : QDialog(parent), currentCard(nul
hbox->addWidget(tokenDataGroupBox); hbox->addWidget(tokenDataGroupBox);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEditTokens::accept);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEditTokens::reject);
auto *mainLayout = new QVBoxLayout; auto *mainLayout = new QVBoxLayout;
mainLayout->addLayout(hbox); mainLayout->addLayout(hbox);

View file

@ -48,8 +48,8 @@ DlgEditUser::DlgEditUser(QWidget *parent, QString email, QString country, QStrin
grid->addWidget(realnameEdit, 3, 1); grid->addWidget(realnameEdit, 3, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEditUser::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEditUser::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -117,7 +117,8 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
showOnlyIfSpectatorsCanWatch = new QCheckBox(tr("Show games only if &spectators can watch")); showOnlyIfSpectatorsCanWatch = new QCheckBox(tr("Show games only if &spectators can watch"));
showOnlyIfSpectatorsCanWatch->setChecked(gamesProxyModel->getShowOnlyIfSpectatorsCanWatch()); showOnlyIfSpectatorsCanWatch->setChecked(gamesProxyModel->getShowOnlyIfSpectatorsCanWatch());
connect(showOnlyIfSpectatorsCanWatch, SIGNAL(toggled(bool)), this, SLOT(toggleSpectatorCheckboxEnabledness(bool))); connect(showOnlyIfSpectatorsCanWatch, &QCheckBox::toggled, this,
&DlgFilterGames::toggleSpectatorCheckboxEnabledness);
showSpectatorPasswordProtected = new QCheckBox(tr("Show spectator password p&rotected games")); showSpectatorPasswordProtected = new QCheckBox(tr("Show spectator password p&rotected games"));
showSpectatorPasswordProtected->setChecked(gamesProxyModel->getShowSpectatorPasswordProtected()); showSpectatorPasswordProtected->setChecked(gamesProxyModel->getShowSpectatorPasswordProtected());
@ -158,8 +159,8 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
hbox->addLayout(rightColumn); hbox->addLayout(rightColumn);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgFilterGames::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgFilterGames::reject);
auto *mainLayout = new QVBoxLayout; auto *mainLayout = new QVBoxLayout;
mainLayout->addLayout(hbox); mainLayout->addLayout(hbox);

View file

@ -78,8 +78,8 @@ DlgForgotPasswordChallenge::DlgForgotPasswordChallenge(QWidget *parent) : QDialo
grid->addWidget(emailEdit, 4, 1); grid->addWidget(emailEdit, 4, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgForgotPasswordChallenge::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgForgotPasswordChallenge::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -55,8 +55,8 @@ DlgForgotPasswordRequest::DlgForgotPasswordRequest(QWidget *parent) : QDialog(pa
grid->addWidget(playernameEdit, 3, 1); grid->addWidget(playernameEdit, 3, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgForgotPasswordRequest::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgForgotPasswordRequest::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -93,8 +93,8 @@ DlgForgotPasswordReset::DlgForgotPasswordReset(QWidget *parent) : QDialog(parent
grid->addWidget(newpasswordverifyEdit, 6, 1); grid->addWidget(newpasswordverifyEdit, 6, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgForgotPasswordReset::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgForgotPasswordReset::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -15,8 +15,8 @@ DlgLoadRemoteDeck::DlgLoadRemoteDeck(AbstractClient *_client, QWidget *parent) :
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgLoadRemoteDeck::accept);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgLoadRemoteDeck::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(dirView); mainLayout->addWidget(dirView);
@ -28,8 +28,8 @@ DlgLoadRemoteDeck::DlgLoadRemoteDeck(AbstractClient *_client, QWidget *parent) :
setMinimumWidth(sizeHint().width()); setMinimumWidth(sizeHint().width());
resize(400, 600); resize(400, 600);
connect(dirView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, connect(dirView->selectionModel(), &QItemSelectionModel::currentChanged, this,
SLOT(currentItemChanged(const QModelIndex &, const QModelIndex &))); &DlgLoadRemoteDeck::currentItemChanged);
} }
void DlgLoadRemoteDeck::currentItemChanged(const QModelIndex &current, const QModelIndex & /*previous*/) void DlgLoadRemoteDeck::currentItemChanged(const QModelIndex &current, const QModelIndex & /*previous*/)

View file

@ -39,28 +39,28 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
aTop->setIcon(QPixmap("theme:icons/arrow_top_green")); aTop->setIcon(QPixmap("theme:icons/arrow_top_green"));
aTop->setToolTip(tr("Move selected set to the top")); aTop->setToolTip(tr("Move selected set to the top"));
aTop->setEnabled(false); aTop->setEnabled(false);
connect(aTop, SIGNAL(triggered()), this, SLOT(actTop())); connect(aTop, &QAction::triggered, this, &WndSets::actTop);
setsEditToolBar->addAction(aTop); setsEditToolBar->addAction(aTop);
aUp = new QAction(QString(), this); aUp = new QAction(QString(), this);
aUp->setIcon(QPixmap("theme:icons/arrow_up_green")); aUp->setIcon(QPixmap("theme:icons/arrow_up_green"));
aUp->setToolTip(tr("Move selected set up")); aUp->setToolTip(tr("Move selected set up"));
aUp->setEnabled(false); aUp->setEnabled(false);
connect(aUp, SIGNAL(triggered()), this, SLOT(actUp())); connect(aUp, &QAction::triggered, this, &WndSets::actUp);
setsEditToolBar->addAction(aUp); setsEditToolBar->addAction(aUp);
aDown = new QAction(QString(), this); aDown = new QAction(QString(), this);
aDown->setIcon(QPixmap("theme:icons/arrow_down_green")); aDown->setIcon(QPixmap("theme:icons/arrow_down_green"));
aDown->setToolTip(tr("Move selected set down")); aDown->setToolTip(tr("Move selected set down"));
aDown->setEnabled(false); aDown->setEnabled(false);
connect(aDown, SIGNAL(triggered()), this, SLOT(actDown())); connect(aDown, &QAction::triggered, this, &WndSets::actDown);
setsEditToolBar->addAction(aDown); setsEditToolBar->addAction(aDown);
aBottom = new QAction(QString(), this); aBottom = new QAction(QString(), this);
aBottom->setIcon(QPixmap("theme:icons/arrow_bottom_green")); aBottom->setIcon(QPixmap("theme:icons/arrow_bottom_green"));
aBottom->setToolTip(tr("Move selected set to the bottom")); aBottom->setToolTip(tr("Move selected set to the bottom"));
aBottom->setEnabled(false); aBottom->setEnabled(false);
connect(aBottom, SIGNAL(triggered()), this, SLOT(actBottom())); connect(aBottom, &QAction::triggered, this, &WndSets::actBottom);
setsEditToolBar->addAction(aBottom); setsEditToolBar->addAction(aBottom);
// search field // search field
@ -74,7 +74,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
defaultSortButton = new QPushButton(tr("Default order")); defaultSortButton = new QPushButton(tr("Default order"));
defaultSortButton->setToolTip(tr("Restore original art priority order")); defaultSortButton->setToolTip(tr("Restore original art priority order"));
connect(defaultSortButton, SIGNAL(clicked()), this, SLOT(actRestoreOriginalOrder())); connect(defaultSortButton, &QPushButton::clicked, this, &WndSets::actRestoreOriginalOrder);
filterBox = new QHBoxLayout; filterBox = new QHBoxLayout;
filterBox->addWidget(searchField); filterBox->addWidget(searchField);
@ -106,7 +106,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
view->setColumnHidden(SetsModel::PriorityCol, true); view->setColumnHidden(SetsModel::PriorityCol, true);
view->setRootIsDecorated(false); view->setRootIsDecorated(false);
connect(view->header(), SIGNAL(sectionClicked(int)), this, SLOT(actSort(int))); connect(view->header(), &QHeaderView::sectionClicked, this, &WndSets::actSort);
// bottom buttons // bottom buttons
enableAllButton = new QPushButton(tr("Enable all sets")); enableAllButton = new QPushButton(tr("Enable all sets"));
@ -114,20 +114,15 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
enableSomeButton = new QPushButton(tr("Enable selected set(s)")); enableSomeButton = new QPushButton(tr("Enable selected set(s)"));
disableSomeButton = new QPushButton(tr("Disable selected set(s)")); disableSomeButton = new QPushButton(tr("Disable selected set(s)"));
connect(enableAllButton, SIGNAL(clicked()), this, SLOT(actEnableAll())); connect(enableAllButton, &QPushButton::clicked, this, &WndSets::actEnableAll);
connect(disableAllButton, SIGNAL(clicked()), this, SLOT(actDisableAll())); connect(disableAllButton, &QPushButton::clicked, this, &WndSets::actDisableAll);
connect(enableSomeButton, SIGNAL(clicked()), this, SLOT(actEnableSome())); connect(enableSomeButton, &QPushButton::clicked, this, &WndSets::actEnableSome);
connect(disableSomeButton, SIGNAL(clicked()), this, SLOT(actDisableSome())); connect(disableSomeButton, &QPushButton::clicked, this, &WndSets::actDisableSome);
connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, connect(view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &WndSets::actToggleButtons);
SLOT(actToggleButtons(const QItemSelection &, const QItemSelection &))); connect(searchField, &LineEditUnfocusable::textChanged, displayModel,
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) qOverload<const QString &>(&SetsDisplayModel::setFilterRegularExpression));
connect(searchField, SIGNAL(textChanged(const QString &)), displayModel, connect(view->header(), &QHeaderView::sortIndicatorChanged, this, &WndSets::actDisableSortButtons);
SLOT(setFilterRegularExpression(const QString &))); connect(searchField, &LineEditUnfocusable::textChanged, this, &WndSets::actDisableResetButton);
#else
connect(searchField, SIGNAL(textChanged(const QString &)), displayModel, SLOT(setFilterRegExp(const QString &)));
#endif
connect(view->header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this, SLOT(actDisableSortButtons(int)));
connect(searchField, SIGNAL(textChanged(const QString &)), this, SLOT(actDisableResetButton(const QString &)));
labNotes = new QLabel; labNotes = new QLabel;
labNotes->setWordWrap(true); labNotes->setWordWrap(true);
@ -158,7 +153,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
sortWarningButton->setText(tr("Use the current sorting as the set priority instead")); sortWarningButton->setText(tr("Use the current sorting as the set priority instead"));
sortWarningButton->setToolTip(tr("Sorts the set priority using the same column")); sortWarningButton->setToolTip(tr("Sorts the set priority using the same column"));
sortWarningButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); sortWarningButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(sortWarningButton, SIGNAL(released()), this, SLOT(actIgnoreWarning())); connect(sortWarningButton, &QPushButton::released, this, &WndSets::actIgnoreWarning);
sortWarningLayout->addWidget(sortWarningButton, 1, 0); sortWarningLayout->addWidget(sortWarningButton, 1, 0);
sortWarning->setLayout(sortWarningLayout); sortWarning->setLayout(sortWarningLayout);
sortWarning->setVisible(false); sortWarning->setVisible(false);
@ -170,8 +165,8 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
connect(includeRebalancedCardsCheckBox, &QAbstractButton::toggled, this, &WndSets::includeRebalancedCardsChanged); connect(includeRebalancedCardsCheckBox, &QAbstractButton::toggled, this, &WndSets::includeRebalancedCardsChanged);
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actSave())); connect(buttonBox, &QDialogButtonBox::accepted, this, &WndSets::actSave);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(actRestore())); connect(buttonBox, &QDialogButtonBox::rejected, this, &WndSets::actRestore);
mainLayout = new QGridLayout; mainLayout = new QGridLayout;
mainLayout->addLayout(filterBox, 0, 1, 1, 2); mainLayout->addLayout(filterBox, 0, 1, 1, 2);

View file

@ -343,8 +343,8 @@ DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
grid->addWidget(realnameEdit, 10, 1); grid->addWidget(realnameEdit, 10, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgRegister::actOk);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgRegister::reject);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid); mainLayout->addLayout(grid);

View file

@ -74,13 +74,14 @@ GeneralSettingsPage::GeneralSettingsPage()
advertiseTranslationPageLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse); advertiseTranslationPageLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse);
advertiseTranslationPageLabel.setOpenExternalLinks(true); advertiseTranslationPageLabel.setOpenExternalLinks(true);
connect(&languageBox, SIGNAL(currentIndexChanged(int)), this, SLOT(languageBoxChanged(int))); connect(&languageBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
&GeneralSettingsPage::languageBoxChanged);
connect(&startupUpdateCheckCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings, connect(&startupUpdateCheckCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings,
&SettingsCache::setCheckUpdatesOnStartup); &SettingsCache::setCheckUpdatesOnStartup);
connect(&updateNotificationCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings, &SettingsCache::setNotifyAboutUpdate); connect(&updateNotificationCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings, &SettingsCache::setNotifyAboutUpdate);
connect(&newVersionOracleCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings, connect(&newVersionOracleCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings,
&SettingsCache::setNotifyAboutNewVersion); &SettingsCache::setNotifyAboutNewVersion);
connect(&showTipsOnStartup, SIGNAL(clicked(bool)), &settings, SLOT(setShowTipsOnStartup(bool))); connect(&showTipsOnStartup, &QCheckBox::clicked, &settings, &SettingsCache::setShowTipsOnStartup);
auto *personalGrid = new QGridLayout; auto *personalGrid = new QGridLayout;
personalGrid->addWidget(&languageLabel, 0, 0); personalGrid->addWidget(&languageLabel, 0, 0);
@ -99,37 +100,38 @@ GeneralSettingsPage::GeneralSettingsPage()
deckPathEdit = new QLineEdit(settings.getDeckPath()); deckPathEdit = new QLineEdit(settings.getDeckPath());
deckPathEdit->setReadOnly(true); deckPathEdit->setReadOnly(true);
QPushButton *deckPathButton = new QPushButton("..."); QPushButton *deckPathButton = new QPushButton("...");
connect(deckPathButton, SIGNAL(clicked()), this, SLOT(deckPathButtonClicked())); connect(deckPathButton, &QPushButton::clicked, this, &GeneralSettingsPage::deckPathButtonClicked);
filtersPathEdit = new QLineEdit(settings.getFiltersPath()); filtersPathEdit = new QLineEdit(settings.getFiltersPath());
filtersPathEdit->setReadOnly(true); filtersPathEdit->setReadOnly(true);
QPushButton *filtersPathButton = new QPushButton("..."); QPushButton *filtersPathButton = new QPushButton("...");
connect(filtersPathButton, SIGNAL(clicked()), this, SLOT(filtersPathButtonClicked())); connect(filtersPathButton, &QPushButton::clicked, this, &GeneralSettingsPage::filtersPathButtonClicked);
replaysPathEdit = new QLineEdit(settings.getReplaysPath()); replaysPathEdit = new QLineEdit(settings.getReplaysPath());
replaysPathEdit->setReadOnly(true); replaysPathEdit->setReadOnly(true);
QPushButton *replaysPathButton = new QPushButton("..."); QPushButton *replaysPathButton = new QPushButton("...");
connect(replaysPathButton, SIGNAL(clicked()), this, SLOT(replaysPathButtonClicked())); connect(replaysPathButton, &QPushButton::clicked, this, &GeneralSettingsPage::replaysPathButtonClicked);
picsPathEdit = new QLineEdit(settings.getPicsPath()); picsPathEdit = new QLineEdit(settings.getPicsPath());
picsPathEdit->setReadOnly(true); picsPathEdit->setReadOnly(true);
QPushButton *picsPathButton = new QPushButton("..."); QPushButton *picsPathButton = new QPushButton("...");
connect(picsPathButton, SIGNAL(clicked()), this, SLOT(picsPathButtonClicked())); connect(picsPathButton, &QPushButton::clicked, this, &GeneralSettingsPage::picsPathButtonClicked);
cardDatabasePathEdit = new QLineEdit(settings.getCardDatabasePath()); cardDatabasePathEdit = new QLineEdit(settings.getCardDatabasePath());
cardDatabasePathEdit->setReadOnly(true); cardDatabasePathEdit->setReadOnly(true);
QPushButton *cardDatabasePathButton = new QPushButton("..."); QPushButton *cardDatabasePathButton = new QPushButton("...");
connect(cardDatabasePathButton, SIGNAL(clicked()), this, SLOT(cardDatabasePathButtonClicked())); connect(cardDatabasePathButton, &QPushButton::clicked, this, &GeneralSettingsPage::cardDatabasePathButtonClicked);
customCardDatabasePathEdit = new QLineEdit(settings.getCustomCardDatabasePath()); customCardDatabasePathEdit = new QLineEdit(settings.getCustomCardDatabasePath());
customCardDatabasePathEdit->setReadOnly(true); customCardDatabasePathEdit->setReadOnly(true);
QPushButton *customCardDatabasePathButton = new QPushButton("..."); QPushButton *customCardDatabasePathButton = new QPushButton("...");
connect(customCardDatabasePathButton, SIGNAL(clicked()), this, SLOT(customCardDatabaseButtonClicked())); connect(customCardDatabasePathButton, &QPushButton::clicked, this,
&GeneralSettingsPage::customCardDatabaseButtonClicked);
tokenDatabasePathEdit = new QLineEdit(settings.getTokenDatabasePath()); tokenDatabasePathEdit = new QLineEdit(settings.getTokenDatabasePath());
tokenDatabasePathEdit->setReadOnly(true); tokenDatabasePathEdit->setReadOnly(true);
QPushButton *tokenDatabasePathButton = new QPushButton("..."); QPushButton *tokenDatabasePathButton = new QPushButton("...");
connect(tokenDatabasePathButton, SIGNAL(clicked()), this, SLOT(tokenDatabasePathButtonClicked())); connect(tokenDatabasePathButton, &QPushButton::clicked, this, &GeneralSettingsPage::tokenDatabasePathButtonClicked);
// Required init here to avoid crashing on Portable builds // Required init here to avoid crashing on Portable builds
resetAllPathsButton = new QPushButton; resetAllPathsButton = new QPushButton;
@ -151,7 +153,7 @@ GeneralSettingsPage::GeneralSettingsPage()
customCardDatabasePathButton->setVisible(false); customCardDatabasePathButton->setVisible(false);
tokenDatabasePathButton->setVisible(false); tokenDatabasePathButton->setVisible(false);
} else { } else {
connect(resetAllPathsButton, SIGNAL(clicked()), this, SLOT(resetAllPathsClicked())); connect(resetAllPathsButton, &QPushButton::clicked, this, &GeneralSettingsPage::resetAllPathsClicked);
allPathsResetLabel = new QLabel(tr("All paths have been reset")); allPathsResetLabel = new QLabel(tr("All paths have been reset"));
allPathsResetLabel->setVisible(false); allPathsResetLabel->setVisible(false);
} }
@ -193,8 +195,8 @@ GeneralSettingsPage::GeneralSettingsPage()
GeneralSettingsPage::retranslateUi(); GeneralSettingsPage::retranslateUi();
// connect the ReleaseChannel combo box only after the entries are inserted in retranslateUi // connect the ReleaseChannel combo box only after the entries are inserted in retranslateUi
connect(&updateReleaseChannelBox, SIGNAL(currentIndexChanged(int)), &settings, connect(&updateReleaseChannelBox, qOverload<int>(&QComboBox::currentIndexChanged), &settings,
SLOT(setUpdateReleaseChannelIndex(int))); &SettingsCache::setUpdateReleaseChannelIndex);
updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannelIndex()); updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannelIndex());
setLayout(mainLayout); setLayout(mainLayout);
@ -364,8 +366,8 @@ AppearanceSettingsPage::AppearanceSettingsPage()
themeBox.setCurrentIndex(i); themeBox.setCurrentIndex(i);
} }
connect(&themeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(themeBoxChanged(int))); connect(&themeBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &AppearanceSettingsPage::themeBoxChanged);
connect(&openThemeButton, SIGNAL(clicked()), this, SLOT(openThemeLocation())); connect(&openThemeButton, &QPushButton::clicked, this, &AppearanceSettingsPage::openThemeLocation);
auto *themeGrid = new QGridLayout; auto *themeGrid = new QGridLayout;
themeGrid->addWidget(&themeLabel, 0, 0); themeGrid->addWidget(&themeLabel, 0, 0);
@ -409,8 +411,8 @@ AppearanceSettingsPage::AppearanceSettingsPage()
verticalCardOverlapPercentBox.setValue(settings.getStackCardOverlapPercent()); verticalCardOverlapPercentBox.setValue(settings.getStackCardOverlapPercent());
verticalCardOverlapPercentBox.setRange(0, 80); verticalCardOverlapPercentBox.setRange(0, 80);
connect(&verticalCardOverlapPercentBox, SIGNAL(valueChanged(int)), &settings, connect(&verticalCardOverlapPercentBox, qOverload<int>(&QSpinBox::valueChanged), &settings,
SLOT(setStackCardOverlapPercent(int))); &SettingsCache::setStackCardOverlapPercent);
cardViewInitialRowsMaxBox.setRange(1, 999); cardViewInitialRowsMaxBox.setRange(1, 999);
cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().getCardViewInitialRowsMax()); cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().getCardViewInitialRowsMax());
@ -460,11 +462,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
minPlayersForMultiColumnLayoutEdit.setMinimum(2); minPlayersForMultiColumnLayoutEdit.setMinimum(2);
minPlayersForMultiColumnLayoutEdit.setValue(settings.getMinPlayersForMultiColumnLayout()); minPlayersForMultiColumnLayoutEdit.setValue(settings.getMinPlayersForMultiColumnLayout());
connect(&minPlayersForMultiColumnLayoutEdit, SIGNAL(valueChanged(int)), &settings, connect(&minPlayersForMultiColumnLayoutEdit, qOverload<int>(&QSpinBox::valueChanged), &settings,
SLOT(setMinPlayersForMultiColumnLayout(int))); &SettingsCache::setMinPlayersForMultiColumnLayout);
minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit); minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit);
connect(&maxFontSizeForCardsEdit, SIGNAL(valueChanged(int)), &settings, SLOT(setMaxFontSize(int))); connect(&maxFontSizeForCardsEdit, qOverload<int>(&QSpinBox::valueChanged), &settings,
&SettingsCache::setMaxFontSize);
maxFontSizeForCardsEdit.setValue(settings.getMaxFontSize()); maxFontSizeForCardsEdit.setValue(settings.getMaxFontSize());
maxFontSizeForCardsLabel.setBuddy(&maxFontSizeForCardsEdit); maxFontSizeForCardsLabel.setBuddy(&maxFontSizeForCardsEdit);
maxFontSizeForCardsEdit.setMinimum(9); maxFontSizeForCardsEdit.setMinimum(9);
@ -778,8 +781,9 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
urlLinkLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse); urlLinkLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse);
urlLinkLabel.setOpenExternalLinks(true); urlLinkLabel.setOpenExternalLinks(true);
connect(&clearDownloadedPicsButton, SIGNAL(clicked()), this, SLOT(clearDownloadedPicsButtonClicked())); connect(&clearDownloadedPicsButton, &QPushButton::clicked, this,
connect(&resetDownloadURLs, SIGNAL(clicked()), this, SLOT(resetDownloadedURLsButtonClicked())); &DeckEditorSettingsPage::clearDownloadedPicsButtonClicked);
connect(&resetDownloadURLs, &QPushButton::clicked, this, &DeckEditorSettingsPage::resetDownloadedURLsButtonClicked);
auto *lpGeneralGrid = new QGridLayout; auto *lpGeneralGrid = new QGridLayout;
auto *lpSpoilerGrid = new QGridLayout; auto *lpSpoilerGrid = new QGridLayout;
@ -789,11 +793,11 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
mpSpoilerSavePathLineEdit = new QLineEdit(SettingsCache::instance().getSpoilerCardDatabasePath()); mpSpoilerSavePathLineEdit = new QLineEdit(SettingsCache::instance().getSpoilerCardDatabasePath());
mpSpoilerSavePathLineEdit->setReadOnly(true); mpSpoilerSavePathLineEdit->setReadOnly(true);
mpSpoilerPathButton = new QPushButton("..."); mpSpoilerPathButton = new QPushButton("...");
connect(mpSpoilerPathButton, SIGNAL(clicked()), this, SLOT(spoilerPathButtonClicked())); connect(mpSpoilerPathButton, &QPushButton::clicked, this, &DeckEditorSettingsPage::spoilerPathButtonClicked);
updateNowButton = new QPushButton; updateNowButton = new QPushButton;
updateNowButton->setFixedWidth(150); updateNowButton->setFixedWidth(150);
connect(updateNowButton, SIGNAL(clicked()), this, SLOT(updateSpoilers())); connect(updateNowButton, &QPushButton::clicked, this, &DeckEditorSettingsPage::updateSpoilers);
// Update the GUI depending on if the box is ticked or not // Update the GUI depending on if the box is ticked or not
setSpoilersEnabled(mcDownloadSpoilersCheckBox.isChecked()); setSpoilersEnabled(mcDownloadSpoilersCheckBox.isChecked());
@ -803,22 +807,21 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
urlList->setAlternatingRowColors(true); urlList->setAlternatingRowColors(true);
urlList->setDragEnabled(true); urlList->setDragEnabled(true);
urlList->setDragDropMode(QAbstractItemView::InternalMove); urlList->setDragDropMode(QAbstractItemView::InternalMove);
connect(urlList->model(), SIGNAL(rowsMoved(const QModelIndex, int, int, const QModelIndex, int)), this, connect(urlList->model(), &QAbstractItemModel::rowsMoved, this, &DeckEditorSettingsPage::urlListChanged);
SLOT(urlListChanged(const QModelIndex, int, int, const QModelIndex, int)));
urlList->addItems(SettingsCache::instance().downloads().getAllURLs()); urlList->addItems(SettingsCache::instance().downloads().getAllURLs());
aAdd = new QAction(this); aAdd = new QAction(this);
aAdd->setIcon(QPixmap("theme:icons/increment")); aAdd->setIcon(QPixmap("theme:icons/increment"));
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAddURL())); connect(aAdd, &QAction::triggered, this, &DeckEditorSettingsPage::actAddURL);
aEdit = new QAction(this); aEdit = new QAction(this);
aEdit->setIcon(QPixmap("theme:icons/pencil")); aEdit->setIcon(QPixmap("theme:icons/pencil"));
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEditURL())); connect(aEdit, &QAction::triggered, this, &DeckEditorSettingsPage::actEditURL);
aRemove = new QAction(this); aRemove = new QAction(this);
aRemove->setIcon(QPixmap("theme:icons/decrement")); aRemove->setIcon(QPixmap("theme:icons/decrement"));
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemoveURL())); connect(aRemove, &QAction::triggered, this, &DeckEditorSettingsPage::actRemoveURL);
auto *urlToolBar = new QToolBar; auto *urlToolBar = new QToolBar;
urlToolBar->setOrientation(Qt::Vertical); urlToolBar->setOrientation(Qt::Vertical);
@ -885,14 +888,15 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
lpSpoilerGrid->addWidget(&infoOnSpoilersLabel, 3, 0, 1, 3, Qt::AlignTop); lpSpoilerGrid->addWidget(&infoOnSpoilersLabel, 3, 0, 1, 3, Qt::AlignTop);
// On a change to the checkbox, hide/un-hide the other fields // On a change to the checkbox, hide/un-hide the other fields
connect(&mcDownloadSpoilersCheckBox, SIGNAL(toggled(bool)), &SettingsCache::instance(), connect(&mcDownloadSpoilersCheckBox, &QCheckBox::toggled, &SettingsCache::instance(),
SLOT(setDownloadSpoilerStatus(bool))); &SettingsCache::setDownloadSpoilerStatus);
connect(&mcDownloadSpoilersCheckBox, SIGNAL(toggled(bool)), this, SLOT(setSpoilersEnabled(bool))); connect(&mcDownloadSpoilersCheckBox, &QCheckBox::toggled, this, &DeckEditorSettingsPage::setSpoilersEnabled);
connect(&pixmapCacheEdit, SIGNAL(valueChanged(int)), &SettingsCache::instance(), SLOT(setPixmapCacheSize(int))); connect(&pixmapCacheEdit, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance(),
connect(&networkCacheEdit, SIGNAL(valueChanged(int)), &SettingsCache::instance(), &SettingsCache::setPixmapCacheSize);
SLOT(setNetworkCacheSizeInMB(int))); connect(&networkCacheEdit, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance(),
connect(&networkRedirectCacheTtlEdit, SIGNAL(valueChanged(int)), &SettingsCache::instance(), &SettingsCache::setNetworkCacheSizeInMB);
SLOT(setNetworkRedirectCacheTtl(int))); connect(&networkRedirectCacheTtlEdit, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance(),
&SettingsCache::setNetworkRedirectCacheTtl);
mpGeneralGroupBox = new QGroupBox; mpGeneralGroupBox = new QGroupBox;
mpGeneralGroupBox->setLayout(lpGeneralGrid); mpGeneralGroupBox->setLayout(lpGeneralGrid);
@ -1014,8 +1018,8 @@ void DeckEditorSettingsPage::updateSpoilers()
// Create a new SBU that will act as if the client was just reloaded // Create a new SBU that will act as if the client was just reloaded
auto *sbu = new SpoilerBackgroundUpdater(); auto *sbu = new SpoilerBackgroundUpdater();
connect(sbu, SIGNAL(spoilerCheckerDone()), this, SLOT(unlockSettings())); connect(sbu, &SpoilerBackgroundUpdater::spoilerCheckerDone, this, &DeckEditorSettingsPage::unlockSettings);
connect(sbu, SIGNAL(spoilersUpdatedSuccessfully()), this, SLOT(unlockSettings())); connect(sbu, &SpoilerBackgroundUpdater::spoilersUpdatedSuccessfully, this, &DeckEditorSettingsPage::unlockSettings);
} }
void DeckEditorSettingsPage::unlockSettings() void DeckEditorSettingsPage::unlockSettings()
@ -1121,7 +1125,7 @@ MessagesSettingsPage::MessagesSettingsPage()
mentionColor = new QLineEdit(); mentionColor = new QLineEdit();
mentionColor->setText(SettingsCache::instance().getChatMentionColor()); mentionColor->setText(SettingsCache::instance().getChatMentionColor());
updateMentionPreview(); updateMentionPreview();
connect(mentionColor, SIGNAL(textChanged(QString)), this, SLOT(updateColor(QString))); connect(mentionColor, &QLineEdit::textChanged, this, &MessagesSettingsPage::updateColor);
messagePopups.setChecked(SettingsCache::instance().getShowMessagePopup()); messagePopups.setChecked(SettingsCache::instance().getShowMessagePopup());
connect(&messagePopups, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(), connect(&messagePopups, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
@ -1136,8 +1140,7 @@ MessagesSettingsPage::MessagesSettingsPage()
customAlertString = new QLineEdit(); customAlertString = new QLineEdit();
customAlertString->setText(SettingsCache::instance().getHighlightWords()); customAlertString->setText(SettingsCache::instance().getHighlightWords());
connect(customAlertString, SIGNAL(textChanged(QString)), &SettingsCache::instance(), connect(customAlertString, &QLineEdit::textChanged, &SettingsCache::instance(), &SettingsCache::setHighlightWords);
SLOT(setHighlightWords(QString)));
auto *chatGrid = new QGridLayout; auto *chatGrid = new QGridLayout;
chatGrid->addWidget(&chatMentionCheckBox, 0, 0); chatGrid->addWidget(&chatMentionCheckBox, 0, 0);
@ -1156,7 +1159,7 @@ MessagesSettingsPage::MessagesSettingsPage()
highlightColor = new QLineEdit(); highlightColor = new QLineEdit();
highlightColor->setText(SettingsCache::instance().getChatHighlightColor()); highlightColor->setText(SettingsCache::instance().getChatHighlightColor());
updateHighlightPreview(); updateHighlightPreview();
connect(highlightColor, SIGNAL(textChanged(QString)), this, SLOT(updateHighlightColor(QString))); connect(highlightColor, &QLineEdit::textChanged, this, &MessagesSettingsPage::updateHighlightColor);
auto *highlightNotice = new QGridLayout; auto *highlightNotice = new QGridLayout;
highlightNotice->addWidget(highlightColor, 0, 2); highlightNotice->addWidget(highlightColor, 0, 2);
@ -1175,15 +1178,15 @@ MessagesSettingsPage::MessagesSettingsPage()
aAdd = new QAction(this); aAdd = new QAction(this);
aAdd->setIcon(QPixmap("theme:icons/increment")); aAdd->setIcon(QPixmap("theme:icons/increment"));
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAdd())); connect(aAdd, &QAction::triggered, this, &MessagesSettingsPage::actAdd);
aEdit = new QAction(this); aEdit = new QAction(this);
aEdit->setIcon(QPixmap("theme:icons/pencil")); aEdit->setIcon(QPixmap("theme:icons/pencil"));
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEdit())); connect(aEdit, &QAction::triggered, this, &MessagesSettingsPage::actEdit);
aRemove = new QAction(this); aRemove = new QAction(this);
aRemove->setIcon(QPixmap("theme:icons/decrement")); aRemove->setIcon(QPixmap("theme:icons/decrement"));
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemove())); connect(aRemove, &QAction::triggered, this, &MessagesSettingsPage::actRemove);
auto *messageToolBar = new QToolBar; auto *messageToolBar = new QToolBar;
messageToolBar->setOrientation(Qt::Vertical); messageToolBar->setOrientation(Qt::Vertical);
@ -1349,24 +1352,25 @@ SoundSettingsPage::SoundSettingsPage()
themeBox.setCurrentIndex(i); themeBox.setCurrentIndex(i);
} }
connect(&themeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(themeBoxChanged(int))); connect(&themeBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &SoundSettingsPage::themeBoxChanged);
connect(&soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(testSound())); connect(&soundTestButton, &QPushButton::clicked, soundEngine, &SoundEngine::testSound);
masterVolumeSlider = new QSlider(Qt::Horizontal); masterVolumeSlider = new QSlider(Qt::Horizontal);
masterVolumeSlider->setMinimum(0); masterVolumeSlider->setMinimum(0);
masterVolumeSlider->setMaximum(100); masterVolumeSlider->setMaximum(100);
masterVolumeSlider->setValue(SettingsCache::instance().getMasterVolume()); masterVolumeSlider->setValue(SettingsCache::instance().getMasterVolume());
masterVolumeSlider->setToolTip(QString::number(SettingsCache::instance().getMasterVolume())); masterVolumeSlider->setToolTip(QString::number(SettingsCache::instance().getMasterVolume()));
connect(&SettingsCache::instance(), SIGNAL(masterVolumeChanged(int)), this, SLOT(masterVolumeChanged(int))); connect(&SettingsCache::instance(), &SettingsCache::masterVolumeChanged, this,
connect(masterVolumeSlider, SIGNAL(sliderReleased()), soundEngine, SLOT(testSound())); &SoundSettingsPage::masterVolumeChanged);
connect(masterVolumeSlider, SIGNAL(valueChanged(int)), &SettingsCache::instance(), SLOT(setMasterVolume(int))); connect(masterVolumeSlider, &QSlider::sliderReleased, soundEngine, &SoundEngine::testSound);
connect(masterVolumeSlider, &QSlider::valueChanged, &SettingsCache::instance(), &SettingsCache::setMasterVolume);
masterVolumeSpinBox = new QSpinBox(); masterVolumeSpinBox = new QSpinBox();
masterVolumeSpinBox->setMinimum(0); masterVolumeSpinBox->setMinimum(0);
masterVolumeSpinBox->setMaximum(100); masterVolumeSpinBox->setMaximum(100);
masterVolumeSpinBox->setValue(SettingsCache::instance().getMasterVolume()); masterVolumeSpinBox->setValue(SettingsCache::instance().getMasterVolume());
connect(masterVolumeSlider, SIGNAL(valueChanged(int)), masterVolumeSpinBox, SLOT(setValue(int))); connect(masterVolumeSlider, &QSlider::valueChanged, masterVolumeSpinBox, &QSpinBox::setValue);
connect(masterVolumeSpinBox, SIGNAL(valueChanged(int)), masterVolumeSlider, SLOT(setValue(int))); connect(masterVolumeSpinBox, qOverload<int>(&QSpinBox::valueChanged), masterVolumeSlider, &QSlider::setValue);
auto *soundGrid = new QGridLayout; auto *soundGrid = new QGridLayout;
soundGrid->addWidget(&soundEnabledCheckBox, 0, 0, 1, 3); soundGrid->addWidget(&soundEnabledCheckBox, 0, 0, 1, 3);
@ -1476,8 +1480,8 @@ ShortcutSettingsPage::ShortcutSettingsPage()
setLayout(_mainLayout); setLayout(_mainLayout);
connect(btnResetAll, SIGNAL(clicked()), this, SLOT(resetShortcuts())); connect(btnResetAll, &QPushButton::clicked, this, &ShortcutSettingsPage::resetShortcuts);
connect(btnClearAll, SIGNAL(clicked()), this, SLOT(clearShortcuts())); connect(btnClearAll, &QPushButton::clicked, this, &ShortcutSettingsPage::clearShortcuts);
connect(shortcutsTable, &ShortcutTreeView::currentItemChanged, this, &ShortcutSettingsPage::currentItemChanged); connect(shortcutsTable, &ShortcutTreeView::currentItemChanged, this, &ShortcutSettingsPage::currentItemChanged);
@ -1548,7 +1552,7 @@ DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent)
auto rec = QGuiApplication::primaryScreen()->availableGeometry(); auto rec = QGuiApplication::primaryScreen()->availableGeometry();
this->setMinimumSize(qMin(700, rec.width()), qMin(700, rec.height())); this->setMinimumSize(qMin(700, rec.width()), qMin(700, rec.height()));
connect(&SettingsCache::instance(), SIGNAL(langChanged()), this, SLOT(updateLanguage())); connect(&SettingsCache::instance(), &SettingsCache::langChanged, this, &DlgSettings::updateLanguage);
contentsWidget = new QListWidget; contentsWidget = new QListWidget;
contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setViewMode(QListView::IconMode);
@ -1575,7 +1579,7 @@ DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent)
vboxLayout->addWidget(pagesWidget); vboxLayout->addWidget(pagesWidget);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(close())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgSettings::close);
auto *mainLayout = new QVBoxLayout; auto *mainLayout = new QVBoxLayout;
mainLayout->addLayout(vboxLayout); mainLayout->addLayout(vboxLayout);
@ -1626,8 +1630,7 @@ void DlgSettings::createIcons()
shortcutsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); shortcutsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
shortcutsButton->setIcon(QPixmap("theme:config/shorcuts")); shortcutsButton->setIcon(QPixmap("theme:config/shorcuts"));
connect(contentsWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, connect(contentsWidget, &QListWidget::currentItemChanged, this, &DlgSettings::changePage);
SLOT(changePage(QListWidgetItem *, QListWidgetItem *)));
} }
void DlgSettings::changePage(QListWidgetItem *current, QListWidgetItem *previous) void DlgSettings::changePage(QListWidgetItem *current, QListWidgetItem *previous)

View file

@ -53,7 +53,7 @@ DlgTipOfTheDay::DlgTipOfTheDay(QWidget *parent) : QDialog(parent)
} }
} }
connect(this, SIGNAL(newTipRequested(int)), this, SLOT(updateTip(int))); connect(this, &DlgTipOfTheDay::newTipRequested, this, &DlgTipOfTheDay::updateTip);
newTipRequested(currentTip); newTipRequested(currentTip);
content = new QVBoxLayout; content = new QVBoxLayout;
@ -69,14 +69,14 @@ DlgTipOfTheDay::DlgTipOfTheDay(QWidget *parent) : QDialog(parent)
buttonBox->addButton(nextButton, QDialogButtonBox::ActionRole); buttonBox->addButton(nextButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(QDialogButtonBox::Ok); buttonBox->addButton(QDialogButtonBox::Ok);
buttonBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); buttonBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgTipOfTheDay::accept);
connect(nextButton, SIGNAL(clicked()), this, SLOT(nextClicked())); connect(nextButton, &QPushButton::clicked, this, &DlgTipOfTheDay::nextClicked);
connect(previousButton, SIGNAL(clicked()), this, SLOT(previousClicked())); connect(previousButton, &QPushButton::clicked, this, &DlgTipOfTheDay::previousClicked);
showTipsOnStartupCheck = new QCheckBox("Show tips on startup"); showTipsOnStartupCheck = new QCheckBox("Show tips on startup");
showTipsOnStartupCheck->setChecked(SettingsCache::instance().getShowTipsOnStartup()); showTipsOnStartupCheck->setChecked(SettingsCache::instance().getShowTipsOnStartup());
connect(showTipsOnStartupCheck, SIGNAL(clicked(bool)), &SettingsCache::instance(), connect(showTipsOnStartupCheck, &QCheckBox::clicked, &SettingsCache::instance(),
SLOT(setShowTipsOnStartup(bool))); &SettingsCache::setShowTipsOnStartup);
buttonBar = new QHBoxLayout(); buttonBar = new QHBoxLayout();
buttonBar->addWidget(showTipsOnStartupCheck); buttonBar->addWidget(showTipsOnStartupCheck);
buttonBar->addWidget(tipNumber); buttonBar->addWidget(tipNumber);

View file

@ -41,10 +41,11 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
enableUpdateButton(false); // Unless we know there's an update available, you can't install enableUpdateButton(false); // Unless we know there's an update available, you can't install
buttonBox->addButton(ok, QDialogButtonBox::AcceptRole); buttonBox->addButton(ok, QDialogButtonBox::AcceptRole);
connect(gotoDownload, SIGNAL(clicked()), this, SLOT(gotoDownloadPage())); connect(gotoDownload, &QPushButton::clicked, this, &DlgUpdate::gotoDownloadPage);
connect(manualDownload, SIGNAL(clicked()), this, SLOT(downloadUpdate())); // TODO: make reinstall button actually do something when clicked
connect(stopDownload, SIGNAL(clicked()), this, SLOT(cancelDownload())); // connect(manualDownload, &QPushButton::clicked, this, &DlgUpdate::downloadUpdate);
connect(ok, SIGNAL(clicked()), this, SLOT(closeDialog())); connect(stopDownload, &QPushButton::clicked, this, &DlgUpdate::cancelDownload);
connect(ok, &QPushButton::clicked, this, &DlgUpdate::closeDialog);
auto *parentLayout = new QVBoxLayout(this); auto *parentLayout = new QVBoxLayout(this);
parentLayout->addWidget(descriptionLabel); parentLayout->addWidget(descriptionLabel);
@ -68,9 +69,9 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
// Initialize the checker and downloader class // Initialize the checker and downloader class
uDownloader = new UpdateDownloader(this); uDownloader = new UpdateDownloader(this);
connect(uDownloader, SIGNAL(downloadSuccessful(QUrl)), this, SLOT(downloadSuccessful(QUrl))); connect(uDownloader, &UpdateDownloader::downloadSuccessful, this, &DlgUpdate::downloadSuccessful);
connect(uDownloader, SIGNAL(progressMade(qint64, qint64)), this, SLOT(downloadProgressMade(qint64, qint64))); connect(uDownloader, &UpdateDownloader::progressMade, this, &DlgUpdate::downloadProgressMade);
connect(uDownloader, SIGNAL(error(QString)), this, SLOT(downloadError(QString))); connect(uDownloader, &UpdateDownloader::error, this, &DlgUpdate::downloadError);
// Check for updates // Check for updates
beginUpdateCheck(); beginUpdateCheck();
@ -108,9 +109,8 @@ void DlgUpdate::beginUpdateCheck()
setLabel(tr("Checking for updates...")); setLabel(tr("Checking for updates..."));
auto checker = new ClientUpdateChecker(this); auto checker = new ClientUpdateChecker(this);
connect(checker, SIGNAL(finishedCheck(bool, bool, Release *)), this, connect(checker, &ClientUpdateChecker::finishedCheck, this, &DlgUpdate::finishedUpdateCheck);
SLOT(finishedUpdateCheck(bool, bool, Release *))); connect(checker, &ClientUpdateChecker::error, this, &DlgUpdate::updateCheckError);
connect(checker, SIGNAL(error(QString)), this, SLOT(updateCheckError(QString)));
checker->check(); checker->check();
} }

View file

@ -18,7 +18,7 @@ DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
coClearLog = new QCheckBox; coClearLog = new QCheckBox;
coClearLog->setText(tr("Clear log when closing")); coClearLog->setText(tr("Clear log when closing"));
coClearLog->setChecked(SettingsCache::instance().servers().getClearDebugLogStatus(false)); coClearLog->setChecked(SettingsCache::instance().servers().getClearDebugLogStatus(false));
connect(coClearLog, SIGNAL(toggled(bool)), this, SLOT(actCheckBoxChanged(bool))); connect(coClearLog, &QCheckBox::toggled, this, &DlgViewLog::actCheckBoxChanged);
mainLayout->addWidget(coClearLog); mainLayout->addWidget(coClearLog);
setLayout(mainLayout); setLayout(mainLayout);
@ -27,7 +27,7 @@ DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
resize(800, 500); resize(800, 500);
loadInitialLogBuffer(); loadInitialLogBuffer();
connect(&Logger::getInstance(), SIGNAL(logEntryAdded(QString)), this, SLOT(logEntryAdded(QString))); connect(&Logger::getInstance(), &Logger::logEntryAdded, this, &DlgViewLog::logEntryAdded);
} }
void DlgViewLog::actCheckBoxChanged(bool abNewValue) void DlgViewLog::actCheckBoxChanged(bool abNewValue)