mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(profileform): Use new connect style
This commit is contained in:
parent
b41767d087
commit
78966c1f02
|
@ -92,9 +92,9 @@ ProfileForm::ProfileForm(QWidget* parent)
|
||||||
profilePicture->installEventFilter(this);
|
profilePicture->installEventFilter(this);
|
||||||
profilePicture->setAccessibleName("Profile avatar");
|
profilePicture->setAccessibleName("Profile avatar");
|
||||||
profilePicture->setAccessibleDescription("Set a profile avatar shown to all contacts");
|
profilePicture->setAccessibleDescription("Set a profile avatar shown to all contacts");
|
||||||
connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked()));
|
connect(profilePicture, &MaskablePixmapWidget::clicked, this, &ProfileForm::onAvatarClicked);
|
||||||
connect(profilePicture, SIGNAL(customContextMenuRequested(const QPoint&)), this,
|
connect(profilePicture, &MaskablePixmapWidget::customContextMenuRequested,
|
||||||
SLOT(showProfilePictureContextMenu(const QPoint&)));
|
this, &ProfileForm::showProfilePictureContextMenu);
|
||||||
QHBoxLayout* publicGrouplayout = qobject_cast<QHBoxLayout*>(bodyUI->publicGroup->layout());
|
QHBoxLayout* publicGrouplayout = qobject_cast<QHBoxLayout*>(bodyUI->publicGroup->layout());
|
||||||
publicGrouplayout->insertWidget(0, profilePicture);
|
publicGrouplayout->insertWidget(0, profilePicture);
|
||||||
publicGrouplayout->insertSpacing(1, 7);
|
publicGrouplayout->insertSpacing(1, 7);
|
||||||
|
@ -106,27 +106,30 @@ ProfileForm::ProfileForm(QWidget* parent)
|
||||||
hasCheck = false;
|
hasCheck = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
connect(bodyUI->toxIdLabel, &CroppingLabel::clicked, this, &ProfileForm::copyIdClicked);
|
||||||
connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
connect(toxId, &ClickableTE::clicked, this, &ProfileForm::copyIdClicked);
|
||||||
connect(core, &Core::idSet, this, &ProfileForm::setToxId);
|
connect(core, &Core::idSet, this, &ProfileForm::setToxId);
|
||||||
connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited()));
|
connect(bodyUI->userName, &QLineEdit::editingFinished, this, &ProfileForm::onUserNameEdited);
|
||||||
connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited()));
|
connect(bodyUI->statusMessage, &QLineEdit::editingFinished,
|
||||||
|
this, &ProfileForm::onStatusMessageEdited);
|
||||||
connect(bodyUI->renameButton, &QPushButton::clicked, this, &ProfileForm::onRenameClicked);
|
connect(bodyUI->renameButton, &QPushButton::clicked, this, &ProfileForm::onRenameClicked);
|
||||||
connect(bodyUI->exportButton, &QPushButton::clicked, this, &ProfileForm::onExportClicked);
|
connect(bodyUI->exportButton, &QPushButton::clicked, this, &ProfileForm::onExportClicked);
|
||||||
connect(bodyUI->deleteButton, &QPushButton::clicked, this, &ProfileForm::onDeleteClicked);
|
connect(bodyUI->deleteButton, &QPushButton::clicked, this, &ProfileForm::onDeleteClicked);
|
||||||
connect(bodyUI->logoutButton, &QPushButton::clicked, this, &ProfileForm::onLogoutClicked);
|
connect(bodyUI->logoutButton, &QPushButton::clicked, this, &ProfileForm::onLogoutClicked);
|
||||||
connect(bodyUI->deletePassButton, &QPushButton::clicked, this, &ProfileForm::onDeletePassClicked);
|
connect(bodyUI->deletePassButton, &QPushButton::clicked,
|
||||||
connect(bodyUI->changePassButton, &QPushButton::clicked, this, &ProfileForm::onChangePassClicked);
|
this, &ProfileForm::onDeletePassClicked);
|
||||||
connect(bodyUI->deletePassButton, &QPushButton::clicked, this,
|
connect(bodyUI->changePassButton, &QPushButton::clicked,
|
||||||
&ProfileForm::setPasswordButtonsText);
|
this, &ProfileForm::onChangePassClicked);
|
||||||
connect(bodyUI->changePassButton, &QPushButton::clicked, this,
|
connect(bodyUI->deletePassButton, &QPushButton::clicked,
|
||||||
&ProfileForm::setPasswordButtonsText);
|
this, &ProfileForm::setPasswordButtonsText);
|
||||||
|
connect(bodyUI->changePassButton, &QPushButton::clicked,
|
||||||
|
this, &ProfileForm::setPasswordButtonsText);
|
||||||
connect(bodyUI->saveQr, &QPushButton::clicked, this, &ProfileForm::onSaveQrClicked);
|
connect(bodyUI->saveQr, &QPushButton::clicked, this, &ProfileForm::onSaveQrClicked);
|
||||||
connect(bodyUI->copyQr, &QPushButton::clicked, this, &ProfileForm::onCopyQrClicked);
|
connect(bodyUI->copyQr, &QPushButton::clicked, this, &ProfileForm::onCopyQrClicked);
|
||||||
connect(bodyUI->toxmeRegisterButton, &QPushButton::clicked, this,
|
connect(bodyUI->toxmeRegisterButton, &QPushButton::clicked,
|
||||||
&ProfileForm::onRegisterButtonClicked);
|
this, &ProfileForm::onRegisterButtonClicked);
|
||||||
connect(bodyUI->toxmeUpdateButton, &QPushButton::clicked, this,
|
connect(bodyUI->toxmeUpdateButton, &QPushButton::clicked,
|
||||||
&ProfileForm::onRegisterButtonClicked);
|
this, &ProfileForm::onRegisterButtonClicked);
|
||||||
|
|
||||||
connect(core, &Core::usernameSet, this,
|
connect(core, &Core::usernameSet, this,
|
||||||
[=](const QString& val) { bodyUI->userName->setText(val); });
|
[=](const QString& val) { bodyUI->userName->setText(val); });
|
||||||
|
|
|
@ -62,10 +62,6 @@ public:
|
||||||
void show(ContentLayout* contentLayout);
|
void show(ContentLayout* contentLayout);
|
||||||
bool isShown() const;
|
bool isShown() const;
|
||||||
|
|
||||||
signals:
|
|
||||||
void userNameChanged(QString);
|
|
||||||
void statusMessageChanged(QString);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onSelfAvatarLoaded(const QPixmap& pic);
|
void onSelfAvatarLoaded(const QPixmap& pic);
|
||||||
void onLogoutClicked();
|
void onLogoutClicked();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user