mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-20 15:17:41 +00:00
Merge branch 'dev' of https://github.com/telegramdesktop/tdesktop into dev
This commit is contained in:
commit
0ed64e7b51
@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||
"lng_profile_shared_links" = "{count:_not_used_|# shared link|# shared links} »";
|
||||
"lng_profile_shared_links_header" = "Shared links overview";
|
||||
"lng_profile_copy_phone" = "Copy phone number";
|
||||
"lng_profile_copy_fullname" = "Copy name";
|
||||
|
||||
"lng_channel_add_admins" = "New administrator";
|
||||
"lng_channel_add_members" = "Add members";
|
||||
|
@ -1509,10 +1509,13 @@ void ProfileInner::contextMenuEvent(QContextMenuEvent *e) {
|
||||
_menu->deleteLater();
|
||||
_menu = 0;
|
||||
}
|
||||
if (!_phoneText.isEmpty() || (_peerUser && !_peerUser->username.isEmpty())) {
|
||||
if (!_phoneText.isEmpty() || _peerUser) {
|
||||
QRect info(_left + st::profilePhotoSize + st::profilePhoneLeft, st::profilePadding.top(), _width - st::profilePhotoSize - st::profilePhoneLeft, st::profilePhotoSize);
|
||||
if (info.contains(mapFromGlobal(e->globalPos()))) {
|
||||
_menu = new PopupMenu();
|
||||
if (_peerUser) {
|
||||
_menu->addAction(lang(lng_profile_copy_fullname), this, SLOT(onCopyFullName()))->setEnabled(true);
|
||||
}
|
||||
if (!_phoneText.isEmpty()) {
|
||||
_menu->addAction(lang(lng_profile_copy_phone), this, SLOT(onCopyPhone()))->setEnabled(true);
|
||||
}
|
||||
@ -1532,6 +1535,11 @@ void ProfileInner::onMenuDestroy(QObject *obj) {
|
||||
}
|
||||
}
|
||||
|
||||
void ProfileInner::onCopyFullName() {
|
||||
if (!_peerUser) return;
|
||||
QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName));
|
||||
}
|
||||
|
||||
void ProfileInner::onCopyPhone() {
|
||||
QApplication::clipboard()->setText(_phoneText);
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ public slots:
|
||||
void onMediaLinks();
|
||||
|
||||
void onMenuDestroy(QObject *obj);
|
||||
void onCopyFullName();
|
||||
void onCopyPhone();
|
||||
void onCopyUsername();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user