Settings block in the new profile implementation done.

New type of button (LeftOutlineButton) was added. _inviteLink moved
to private section in ChatData and ChannelData (with get-set methods).
This commit is contained in:
John Preston 2016-06-01 16:07:03 +03:00
parent 41c8df029a
commit 66a8aa86e1
26 changed files with 610 additions and 125 deletions

View File

@ -145,6 +145,29 @@ boxLabel: flatLabel(labelDefFlat) {
align: align(topleft);
}
defaultLeftOutlineButton: OutlineButton {
outlineWidth: 3px;
outlineFg: windowBg;
outlineFgOver: #3fb0e4;
textBg: windowBg;
textBgOver: #f2f7fa;
textFg: #1485c2;
textFgOver: #1485c2;
font: normalFont;
padding: margins(11px, 6px, 11px, 6px);
}
attentionLeftOutlineButton: OutlineButton(defaultLeftOutlineButton) {
outlineFgOver: #e43f3f;
textBgOver: #faf2f2;
textFg: #d15948;
textFgOver: #d15948;
}
defaultInputArea: InputArea {
textFg: black;
textMargins: margins(5px, 6px, 5px, 4px);

View File

@ -415,3 +415,18 @@ PeerAvatarButton {
size: pixels;
photoSize: pixels;
}
OutlineButton {
outlineWidth: pixels;
outlineFg: color;
outlineFgOver: color;
textBg: color;
textBgOver: color;
textFg: color;
textFgOver: color;
font: font;
padding: margins;
}

View File

@ -408,6 +408,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_profile_invite_link_section" = "Invite link";
"lng_profile_create_public_link" = "Create public link";
"lng_profile_edit_public_link" = "Edit public link";
"lng_profile_manage_admins" = "Manage administrators";
"lng_profile_participants_section" = "Members";
"lng_profile_info_section" = "Info";
"lng_profile_mobile_number" = "Mobile:";

View File

@ -215,9 +215,9 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt
} else {
chat->photoId = 0;
}
chat->invitationUrl = (f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString();
chat->setInviteLink((f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString());
App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
notifySettingReceived(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
} else if (peer->isChannel()) {
if (d.vfull_chat.type() != mtpc_channelFull) {
LOG(("MTP Error: bad type in gotChatFull for channel: %1").arg(d.vfull_chat.type()));
@ -286,7 +286,7 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt
channel->count = newCount;
}
channel->adminsCount = f.has_admins_count() ? f.vadmins_count.v : 0;
channel->invitationUrl = (f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString();
channel->setInviteLink((f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString());
if (History *h = App::historyLoaded(channel->id)) {
if (h->inboxReadBefore < f.vread_inbox_max_id.v + 1) {
h->setUnreadCount(channel->isMegagroup() ? f.vunread_count.v : f.vunread_important_count.v);
@ -303,7 +303,7 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt
}
channel->fullUpdated();
App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
notifySettingReceived(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
}
if (req) {
@ -334,7 +334,7 @@ void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestI
}
App::feedUserLinkDelayed(MTP_int(peerToUser(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link);
if (App::main()) {
App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings);
notifySettingReceived(MTP_inputNotifyPeer(peer->input), d.vnotify_settings);
}
if (d.has_bot_info()) {
@ -721,6 +721,86 @@ bool ApiWrap::channelAmInFail(ChannelData *channel, const RPCError &error) {
return true;
}
void ApiWrap::exportInviteLink(PeerData *peer) {
if (_exportInviteRequests.contains(peer)) {
return;
}
mtpRequestId request = 0;
if (auto chat = peer->asChat()) {
request = MTP::send(MTPmessages_ExportChatInvite(chat->inputChat), rpcDone(&ApiWrap::exportInviteDone, peer), rpcFail(&ApiWrap::exportInviteFail, peer));
} else if (auto channel = peer->asChannel()) {
request = MTP::send(MTPchannels_ExportInvite(channel->inputChannel), rpcDone(&ApiWrap::exportInviteDone, peer), rpcFail(&ApiWrap::exportInviteFail, peer));
}
if (request) {
_exportInviteRequests.insert(peer, request);
}
}
void ApiWrap::exportInviteDone(PeerData *peer, const MTPExportedChatInvite &result) {
_exportInviteRequests.remove(peer);
if (auto chat = peer->asChat()) {
chat->setInviteLink((result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString());
} else if (auto channel = peer->asChannel()) {
channel->setInviteLink((result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString());
}
Notify::peerUpdatedSendDelayed();
}
bool ApiWrap::exportInviteFail(PeerData *peer, const RPCError &error) {
if (MTP::isDefaultHandledError(error)) return false;
_exportInviteRequests.remove(peer);
return true;
}
void ApiWrap::requestNotifySetting(PeerData *peer) {
if (_notifySettingRequests.contains(peer)) return;
MTPInputNotifyPeer notifyPeer = MTP_inputNotifyPeer(peer->input);
auto requestId = MTP::send(MTPaccount_GetNotifySettings(notifyPeer), rpcDone(&ApiWrap::notifySettingDone, notifyPeer), rpcFail(&ApiWrap::notifySettingFail, peer));
_notifySettingRequests.insert(peer, requestId);
}
void ApiWrap::notifySettingDone(MTPInputNotifyPeer notifyPeer, const MTPPeerNotifySettings &result) {
if (auto requestedPeer = notifySettingReceived(notifyPeer, result)) {
_notifySettingRequests.remove(requestedPeer);
Notify::peerUpdatedSendDelayed();
}
}
PeerData *ApiWrap::notifySettingReceived(MTPInputNotifyPeer notifyPeer, const MTPPeerNotifySettings &settings) {
PeerData *requestedPeer = nullptr;
switch (notifyPeer.type()) {
case mtpc_inputNotifyAll: App::main()->applyNotifySetting(MTP_notifyAll(), settings); break;
case mtpc_inputNotifyUsers: App::main()->applyNotifySetting(MTP_notifyUsers(), settings); break;
case mtpc_inputNotifyChats: App::main()->applyNotifySetting(MTP_notifyChats(), settings); break;
case mtpc_inputNotifyPeer: {
auto &peer = notifyPeer.c_inputNotifyPeer().vpeer;
switch (peer.type()) {
case mtpc_inputPeerEmpty: App::main()->applyNotifySetting(MTP_notifyPeer(MTP_peerUser(MTP_int(0))), settings); break;
case mtpc_inputPeerSelf: requestedPeer = App::self(); break;
case mtpc_inputPeerUser: requestedPeer = App::user(peerFromUser(peer.c_inputPeerUser().vuser_id)); break;
case mtpc_inputPeerChat: requestedPeer = App::chat(peerFromChat(peer.c_inputPeerChat().vchat_id)); break;
case mtpc_inputPeerChannel: requestedPeer = App::channel(peerFromChannel(peer.c_inputPeerChannel().vchannel_id)); break;
}
if (requestedPeer) {
App::main()->applyNotifySetting(MTP_notifyPeer(peerToMTP(requestedPeer->id)), settings);
}
} break;
}
App::wnd()->notifySettingGot();
return requestedPeer;
}
bool ApiWrap::notifySettingFail(PeerData *peer, const RPCError &error) {
if (MTP::isDefaultHandledError(error)) return false;
notifySettingReceived(MTP_inputNotifyPeer(peer->input), MTP_peerNotifySettingsEmpty());
_notifySettingRequests.remove(peer);
Notify::peerUpdatedSendDelayed();
return true;
}
void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) {
_stickerSetRequests.remove(setId);

View File

@ -53,6 +53,9 @@ public:
void joinChannel(ChannelData *channel);
void leaveChannel(ChannelData *channel);
void exportInviteLink(PeerData *peer);
void requestNotifySetting(PeerData *peer);
~ApiWrap();
signals:
@ -130,4 +133,14 @@ private:
void channelAmInDone(ChannelData *channel, const MTPUpdates &updates);
bool channelAmInFail(ChannelData *channel, const RPCError &error);
QMap<PeerData*, mtpRequestId> _exportInviteRequests;
void exportInviteDone(PeerData *peer, const MTPExportedChatInvite &result);
bool exportInviteFail(PeerData *peer, const RPCError &error);
QMap<PeerData*, mtpRequestId> _notifySettingRequests;
void notifySettingDone(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings);
PeerData *notifySettingReceived(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings);
bool notifySettingFail(PeerData *peer, const RPCError &error);
};

View File

@ -544,7 +544,8 @@ bool GroupInfoBox::creationFail(const RPCError &error) {
void GroupInfoBox::exportDone(const MTPExportedChatInvite &result) {
_creationRequestId = 0;
if (result.type() == mtpc_chatInviteExported) {
_createdChannel->invitationUrl = qs(result.c_chatInviteExported().vlink);
_createdChannel->setInviteLink(qs(result.c_chatInviteExported().vlink));
Notify::peerUpdatedSendDelayed();
}
Ui::showLayer(new SetupChannelBox(_createdChannel));
}
@ -716,7 +717,7 @@ void SetupChannelBox::paintEvent(QPaintEvent *e) {
option.setWrapMode(QTextOption::WrapAnywhere);
p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont);
p.setPen(st::btnDefLink.color);
p.drawText(_invitationLink, _channel->invitationUrl, option);
p.drawText(_invitationLink, _channel->inviteLink(), option);
if (!_goodTextLink.isEmpty() && a_goodOpacity.current() > 0) {
p.setOpacity(a_goodOpacity.current());
p.setPen(st::setGoodColor);
@ -759,7 +760,7 @@ void SetupChannelBox::mouseMoveEvent(QMouseEvent *e) {
void SetupChannelBox::mousePressEvent(QMouseEvent *e) {
mouseMoveEvent(e);
if (_linkOver) {
Application::clipboard()->setText(_channel->invitationUrl);
Application::clipboard()->setText(_channel->inviteLink());
_goodTextLink = lang(lng_create_channel_link_copied);
a_goodOpacity = anim::fvalue(1, 0);
_a_goodFade.start();

View File

@ -224,7 +224,7 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) {
_addAdminRequestId = 0;
if (_addAdminBox) _addAdminBox->onClose();
if (error.type() == "USERS_TOO_MUCH") {
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_channel->inviteLink()), KeepOtherLayers);
} else if (error.type() == "ADMINS_TOO_MUCH") {
Ui::showLayer(new InformBox(lang(lng_channel_admins_too_much)), KeepOtherLayers);
} else if (error.type() == qstr("USER_RESTRICTED")) {
@ -728,7 +728,7 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) {
_checkedContacts.insert(peer, true);
++_selCount;
} else if (_channel && !_channel->isMegagroup()) {
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_channel->inviteLink()), KeepOtherLayers);
} else if (!_channel && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) {
Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers);
}
@ -2291,7 +2291,7 @@ void MembersBox::onScroll() {
void MembersBox::onAdd() {
if (_inner.filter() == MembersFilterRecent && _inner.channel()->count >= (_inner.channel()->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) {
Ui::showLayer(new MaxInviteBox(_inner.channel()->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_inner.channel()->inviteLink()), KeepOtherLayers);
return;
}
ContactsBox *box = new ContactsBox(_inner.channel(), _inner.filter(), _inner.already());

View File

@ -3866,7 +3866,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
if (_channel) {
updateNotifySettings();
if (_peer->notify == UnknownNotifySettings) {
App::wnd()->getNotifySetting(MTP_inputNotifyPeer(_peer->input));
App::api()->requestNotifySetting(_peer);
}
}

View File

@ -3419,13 +3419,13 @@ namespace Local {
} else if (peer->isChat()) {
ChatData *chat = peer->asChat();
// name + count + date + version + admin + forbidden + left + invitationUrl
result += Serialize::stringSize(chat->name) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + Serialize::stringSize(chat->invitationUrl);
// name + count + date + version + admin + forbidden + left + inviteLink
result += Serialize::stringSize(chat->name) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + Serialize::stringSize(chat->inviteLink());
} else if (peer->isChannel()) {
ChannelData *channel = peer->asChannel();
// name + access + date + version + forbidden + flags + invitationUrl
result += Serialize::stringSize(channel->name) + sizeof(quint64) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + Serialize::stringSize(channel->invitationUrl);
// name + access + date + version + forbidden + flags + inviteLink
result += Serialize::stringSize(channel->name) + sizeof(quint64) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + sizeof(qint32) + Serialize::stringSize(channel->inviteLink());
}
return result;
}
@ -3450,12 +3450,12 @@ namespace Local {
qint32 flagsData = (AppVersion >= 9012) ? chat->flags : (chat->haveLeft() ? 1 : 0);
stream << chat->name << qint32(chat->count) << qint32(chat->date) << qint32(chat->version) << qint32(chat->creator);
stream << qint32(chat->isForbidden ? 1 : 0) << qint32(flagsData) << chat->invitationUrl;
stream << qint32(chat->isForbidden ? 1 : 0) << qint32(flagsData) << chat->inviteLink();
} else if (peer->isChannel()) {
ChannelData *channel = peer->asChannel();
stream << channel->name << quint64(channel->access) << qint32(channel->date) << qint32(channel->version);
stream << qint32(channel->isForbidden ? 1 : 0) << qint32(channel->flags) << channel->invitationUrl;
stream << qint32(channel->isForbidden ? 1 : 0) << qint32(channel->flags) << channel->inviteLink();
}
}
@ -3515,9 +3515,9 @@ namespace Local {
} else if (result->isChat()) {
ChatData *chat = result->asChat();
QString name, invitationUrl;
QString name, inviteLink;
qint32 count, date, version, creator, forbidden, flagsData, flags;
from.stream >> name >> count >> date >> version >> creator >> forbidden >> flagsData >> invitationUrl;
from.stream >> name >> count >> date >> version >> creator >> forbidden >> flagsData >> inviteLink;
if (from.version >= 9012) {
flags = flagsData;
@ -3533,7 +3533,7 @@ namespace Local {
chat->creator = creator;
chat->isForbidden = (forbidden == 1);
chat->flags = MTPDchat::Flags(flags);
chat->invitationUrl = invitationUrl;
chat->setInviteLink(inviteLink);
chat->input = MTP_inputPeerChat(MTP_int(peerToChat(chat->id)));
chat->inputChat = MTP_int(peerToChat(chat->id));
@ -3543,10 +3543,10 @@ namespace Local {
} else if (result->isChannel()) {
ChannelData *channel = result->asChannel();
QString name, invitationUrl;
QString name, inviteLink;
quint64 access;
qint32 date, version, forbidden, flags;
from.stream >> name >> access >> date >> version >> forbidden >> flags >> invitationUrl;
from.stream >> name >> access >> date >> version >> forbidden >> flags >> inviteLink;
if (!wasLoaded) {
channel->setNameDelayed(name, QString());
@ -3555,7 +3555,7 @@ namespace Local {
channel->version = version;
channel->isForbidden = (forbidden == 1);
channel->flags = MTPDchannel::Flags(flags);
channel->invitationUrl = invitationUrl;
channel->setInviteLink(inviteLink);
channel->input = MTP_inputPeerChannel(MTP_int(peerToChannel(channel->id)), MTP_long(access));
channel->inputChannel = MTP_inputChannel(MTP_int(peerToChannel(channel->id)), MTP_long(access));

View File

@ -2096,9 +2096,6 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool bac
}
PeerData *MainWidget::ui_getPeerForMouseAction() {
if (_wideSection) {
//return _wideSection->ui_getPeerForMouseAction(); TODO
}
return _history->ui_getPeerForMouseAction();
}
@ -3595,37 +3592,13 @@ void MainWidget::applyNotifySetting(const MTPNotifyPeer &peer, const MTPPeerNoti
_history->updateNotifySettings();
}
_dialogs->updateNotifySettings(updatePeer);
//if (_profile && _profile->peer() == updatePeer) { TODO
// _profile->updateNotifySettings();
//}
Notify::PeerUpdate update(updatePeer);
update.flags |= Notify::PeerUpdateFlag::NotificationsEnabled;
Notify::peerUpdatedDelayed(update);
}
}
void MainWidget::gotNotifySetting(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings) {
switch (peer.type()) {
case mtpc_inputNotifyAll: applyNotifySetting(MTP_notifyAll(), settings); break;
case mtpc_inputNotifyUsers: applyNotifySetting(MTP_notifyUsers(), settings); break;
case mtpc_inputNotifyChats: applyNotifySetting(MTP_notifyChats(), settings); break;
case mtpc_inputNotifyPeer:
switch (peer.c_inputNotifyPeer().vpeer.type()) {
case mtpc_inputPeerEmpty: applyNotifySetting(MTP_notifyPeer(MTP_peerUser(MTP_int(0))), settings); break;
case mtpc_inputPeerSelf: applyNotifySetting(MTP_notifyPeer(MTP_peerUser(MTP_int(MTP::authedId()))), settings); break;
case mtpc_inputPeerUser: applyNotifySetting(MTP_notifyPeer(MTP_peerUser(peer.c_inputNotifyPeer().vpeer.c_inputPeerUser().vuser_id)), settings); break;
case mtpc_inputPeerChat: applyNotifySetting(MTP_notifyPeer(MTP_peerChat(peer.c_inputNotifyPeer().vpeer.c_inputPeerChat().vchat_id)), settings); break;
case mtpc_inputPeerChannel: applyNotifySetting(MTP_notifyPeer(MTP_peerChannel(peer.c_inputNotifyPeer().vpeer.c_inputPeerChannel().vchannel_id)), settings); break;
}
break;
}
App::wnd()->notifySettingGot();
}
bool MainWidget::failNotifySetting(MTPInputNotifyPeer peer, const RPCError &error) {
if (MTP::isDefaultHandledError(error)) return false;
gotNotifySetting(peer, MTP_peerNotifySettingsEmpty());
return true;
}
void MainWidget::updateNotifySetting(PeerData *peer, NotifySettingStatus notify, SilentNotifiesStatus silent) {
if (notify == NotifySettingDontChange && silent == SilentNotifiesDontChange) return;

View File

@ -186,8 +186,6 @@ public:
void startFull(const MTPVector<MTPUser> &users);
bool started();
void applyNotifySetting(const MTPNotifyPeer &peer, const MTPPeerNotifySettings &settings, History *history = 0);
void gotNotifySetting(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings);
bool failNotifySetting(MTPInputNotifyPeer peer, const RPCError &error);
void updateNotifySetting(PeerData *peer, NotifySettingStatus notify, SilentNotifiesStatus silent = SilentNotifiesDontChange);

View File

@ -38,6 +38,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "autoupdater.h"
#include "mediaview.h"
#include "localstorage.h"
#include "apiwrap.h"
ConnectingWidget::ConnectingWidget(QWidget *parent, const QString &text, const QString &reconnect) : QWidget(parent), _shadow(st::boxShadow), _reconnect(this, QString()) {
set(text, reconnect);
@ -613,10 +614,6 @@ void MainWindow::setupIntro(bool anim) {
}
}
void MainWindow::getNotifySetting(const MTPInputNotifyPeer &peer, uint32 msWait) {
MTP::send(MTPaccount_GetNotifySettings(peer), main->rpcDone(&MainWidget::gotNotifySetting, peer), main->rpcFail(&MainWidget::failNotifySetting, peer), 0, msWait);
}
void MainWindow::serviceNotification(const QString &msg, const MTPMessageMedia &media, bool force) {
History *h = (main && App::userLoaded(ServiceUserId)) ? App::history(ServiceUserId) : 0;
if (!h || (!force && h->isEmpty())) {
@ -1374,7 +1371,7 @@ void MainWindow::onClearFailed(int task, void *manager) {
}
void MainWindow::notifySchedule(History *history, HistoryItem *item) {
if (App::quitting() || !history->currentNotification() || !main) return;
if (App::quitting() || !history->currentNotification() || !App::api()) return;
PeerData *notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : 0;
@ -1394,7 +1391,7 @@ void MainWindow::notifySchedule(History *history, HistoryItem *item) {
return;
}
} else {
App::wnd()->getNotifySetting(MTP_inputNotifyPeer(notifyByFrom->input));
App::api()->requestNotifySetting(notifyByFrom);
}
} else {
history->popNotification(item);
@ -1403,9 +1400,9 @@ void MainWindow::notifySchedule(History *history, HistoryItem *item) {
}
} else {
if (notifyByFrom && notifyByFrom->notify == UnknownNotifySettings) {
App::wnd()->getNotifySetting(MTP_inputNotifyPeer(notifyByFrom->input), 10);
App::api()->requestNotifySetting(notifyByFrom);
}
App::wnd()->getNotifySetting(MTP_inputNotifyPeer(history->peer->input));
App::api()->requestNotifySetting(history->peer);
}
if (!item->notificationReady()) {
haveSetting = false;

View File

@ -156,7 +156,6 @@ public:
void checkAutoLockIn(int msec);
void setupIntro(bool anim);
void setupMain(bool anim, const MTPUser *user = 0);
void getNotifySetting(const MTPInputNotifyPeer &peer, uint32 msWait = 0);
void serviceNotification(const QString &msg, const MTPMessageMedia &media = MTP_messageMediaEmpty(), bool force = false);
void sendServiceHistoryRequest();
void showDelayedServiceMsgs();

View File

@ -34,6 +34,8 @@ enum class PeerUpdateFlag {
UsernameChanged = 0x00000002U,
PhotoChanged = 0x00000004U,
AboutChanged = 0x00000008U,
NotificationsEnabled = 0x00000010U,
InviteLinkChanged = 0x00000020U,
UserCanShareContact = 0x00010000U,
UserIsContact = 0x00020000U,

View File

@ -132,3 +132,4 @@ profileBlockOneLineTextPart: flatLabel(profileBlockTextPart) {
maxHeight: 20px;
}
profileBlockOneLineSkip: 9px;
profileBlockOneLineWidthMax: 240px;

View File

@ -22,19 +22,168 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "profile/profile_settings_widget.h"
#include "styles/style_profile.h"
#include "ui/buttons/left_outline_button.h"
#include "ui/flatcheckbox.h"
#include "boxes/confirmbox.h"
#include "boxes/contactsbox.h"
#include "observer_peer.h"
#include "mainwidget.h"
#include "apiwrap.h"
#include "lang.h"
#include "mainwindow.h" // tmp
namespace Profile {
SettingsWidget::SettingsWidget(QWidget *parent, PeerData *peer) : BlockWidget(parent, peer, lang(lng_profile_settings_section))
{
, _enableNotifications(this, lang(lng_profile_enable_notifications), true, st::defaultCheckbox) {
connect(_enableNotifications, SIGNAL(changed()), this, SLOT(onNotificationsChange()));
Notify::PeerUpdateFlags observeEvents = Notify::PeerUpdateFlag::NotificationsEnabled;
if (auto chat = peer->asChat()) {
if (chat->amCreator()) {
observeEvents |= Notify::PeerUpdateFlag::ChatCanEdit | Notify::PeerUpdateFlag::InviteLinkChanged;
}
} else if (auto channel = peer->asChannel()) {
if (channel->amCreator()) {
observeEvents |= Notify::PeerUpdateFlag::UsernameChanged | Notify::PeerUpdateFlag::InviteLinkChanged;
}
}
Notify::registerPeerObserver(observeEvents, this, &SettingsWidget::notifyPeerUpdated);
refreshButtons();
_enableNotifications->finishAnimations();
show();
}
void SettingsWidget::notifyPeerUpdated(const Notify::PeerUpdate &update) {
if (update.peer != peer()) {
return;
}
if (update.flags & Notify::PeerUpdateFlag::NotificationsEnabled) {
refreshEnableNotifications();
}
if (update.flags & (Notify::PeerUpdateFlag::ChatCanEdit | Notify::PeerUpdateFlag::UsernameChanged | Notify::PeerUpdateFlag::InviteLinkChanged)) {
refreshInviteLinkButton();
}
if (update.flags & (Notify::PeerUpdateFlag::ChatCanEdit)) {
refreshManageAdminsButton();
}
contentSizeUpdated();
}
int SettingsWidget::resizeGetHeight(int newWidth) {
int newHeight = contentTop();
int left = st::profileBlockTitlePosition.x();
_enableNotifications->moveToLeft(left, newHeight);
newHeight += _enableNotifications->height() + st::profileBlockOneLineSkip;
auto moveLink = [&newHeight, left, newWidth](Ui::LeftOutlineButton *button) {
if (!button) return;
int availableWidth = newWidth - left + st::defaultLeftOutlineButton.padding.left() - st::profileBlockMarginRight;
accumulate_min(availableWidth, st::profileBlockOneLineWidthMax);
button->resizeToWidth(availableWidth);
button->moveToLeft(left - st::defaultLeftOutlineButton.padding.left(), newHeight);
newHeight += button->height();
};
moveLink(_manageAdmins);
moveLink(_inviteLink);
newHeight += st::profileBlockMarginBottom;
return newHeight;
}
void SettingsWidget::refreshButtons() {
refreshEnableNotifications();
refreshManageAdminsButton();
refreshInviteLinkButton();
}
void SettingsWidget::refreshEnableNotifications() {
if (peer()->notify == UnknownNotifySettings) {
App::api()->requestNotifySetting(peer());
} else {
auto &notifySettings = peer()->notify;
bool enabled = (notifySettings == EmptyNotifySettings || notifySettings->mute < unixtime());
_enableNotifications->setChecked(enabled, Checkbox::NotifyAboutChange::DontNotify);
}
}
void SettingsWidget::refreshManageAdminsButton() {
auto hasManageAdmins = [this]() {
if (auto chat = peer()->asChat()) {
return (chat->amCreator() && chat->canEdit());
} else if (auto channel = peer()->asChannel()) {
return (channel->amCreator() && channel->isMegagroup());
}
return false;
};
_manageAdmins.destroy();
if (hasManageAdmins()) {
_manageAdmins = new Ui::LeftOutlineButton(this, lang(lng_profile_manage_admins));
_manageAdmins->show();
connect(_manageAdmins, SIGNAL(clicked()), this, SLOT(onManageAdmins()));
}
}
void SettingsWidget::refreshInviteLinkButton() {
auto getInviteLinkText = [this]() -> QString {
if (auto chat = peer()->asChat()) {
if (chat->amCreator() && chat->canEdit()) {
return lang(chat->inviteLink().isEmpty() ? lng_group_invite_create : lng_group_invite_create_new);
}
} else if (auto channel = peer()->asChannel()) {
if (channel->amCreator() && !channel->isPublic()) {
return lang(channel->inviteLink().isEmpty() ? lng_group_invite_create : lng_group_invite_create_new);
}
}
return QString();
};
auto inviteLinkText = getInviteLinkText();
if (!inviteLinkText.isEmpty()) {
_inviteLink = new Ui::LeftOutlineButton(this, inviteLinkText);
_inviteLink->show();
connect(_inviteLink, SIGNAL(clicked()), this, SLOT(onInviteLink()));
}
}
void SettingsWidget::onNotificationsChange() {
App::main()->updateNotifySetting(peer(), _enableNotifications->checked() ? NotifySettingSetNotify : NotifySettingSetMuted);
}
void SettingsWidget::onManageAdmins() {
if (auto chat = peer()->asChat()) {
Ui::showLayer(new ContactsBox(chat, MembersFilterAdmins));
} else if (auto channel = peer()->asChannel()) {
Ui::showLayer(new MembersBox(channel, MembersFilterAdmins));
}
}
void SettingsWidget::onInviteLink() {
auto getInviteLink = [this]() {
if (auto chat = peer()->asChat()) {
return chat->inviteLink();
} else if (auto channel = peer()->asChannel()) {
return channel->inviteLink();
}
return QString();
};
auto link = getInviteLink();
ConfirmBox *box = new ConfirmBox(lang(link.isEmpty() ? lng_group_invite_about : lng_group_invite_about_new));
connect(box, SIGNAL(confirmed()), this, SLOT(onInviteLinkSure()));
Ui::showLayer(box);
}
void SettingsWidget::onInviteLinkSure() {
Ui::hideLayer();
App::api()->exportInviteLink(peer());
}
} // namespace Profile

View File

@ -21,10 +21,23 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#pragma once
#include "profile/profile_block_widget.h"
#include "core/observer.h"
class Checkbox;
namespace Ui {
class LeftOutlineButton;
} // namespace Ui
namespace Notify {
struct PeerUpdate;
} // namespace Notify
namespace Profile {
class SettingsWidget : public BlockWidget {
class SettingsWidget : public BlockWidget, public Notify::Observer {
Q_OBJECT
public:
SettingsWidget(QWidget *parent, PeerData *peer);
@ -32,6 +45,28 @@ protected:
// Resizes content and counts natural widget height for the desired width.
int resizeGetHeight(int newWidth) override;
private slots:
void onNotificationsChange();
void onManageAdmins();
void onInviteLink();
void onInviteLinkSure();
private:
// Observed notifications.
void notifyPeerUpdated(const Notify::PeerUpdate &update);
void refreshButtons();
void refreshEnableNotifications();
void refreshManageAdminsButton();
void refreshInviteLinkButton();
ChildWidget<Checkbox> _enableNotifications;
// In groups: creator of non-deactivated groups can see this link.
// In channels: creator of supergroup can see this link.
ChildWidget<Ui::LeftOutlineButton> _manageAdmins = { nullptr };
ChildWidget<Ui::LeftOutlineButton> _inviteLink = { nullptr };
};
} // namespace Profile

View File

@ -469,7 +469,7 @@ void ProfileInner::onMediaLinks() {
void ProfileInner::onInvitationLink() {
if (!_peerChat && !_peerChannel) return;
QApplication::clipboard()->setText(_peerChat ? _peerChat->invitationUrl : (_peerChannel ? _peerChannel->invitationUrl : QString()));
// QApplication::clipboard()->setText(_peerChat ? _peerChat->invitationUrl : (_peerChannel ? _peerChannel->invitationUrl : QString()));
Ui::showLayer(new InformBox(lang(lng_group_invite_copied)));
}
@ -500,9 +500,9 @@ void ProfileInner::onAdmins() {
void ProfileInner::onCreateInvitationLink() {
if (!_peerChat && !_peerChannel) return;
ConfirmBox *box = new ConfirmBox(lang(((_peerChat && _peerChat->invitationUrl.isEmpty()) || (_peerChannel && _peerChannel->invitationUrl.isEmpty())) ? lng_group_invite_about : lng_group_invite_about_new));
connect(box, SIGNAL(confirmed()), this, SLOT(onCreateInvitationLinkSure()));
Ui::showLayer(box);
// ConfirmBox *box = new ConfirmBox(lang(((_peerChat && _peerChat->invitationUrl.isEmpty()) || (_peerChannel && _peerChannel->invitationUrl.isEmpty())) ? lng_group_invite_about : lng_group_invite_about_new));
// connect(box, SIGNAL(confirmed()), this, SLOT(onCreateInvitationLinkSure()));
// Ui::showLayer(box);
}
void ProfileInner::onCreateInvitationLinkSure() {
@ -518,9 +518,9 @@ void ProfileInner::chatInviteDone(const MTPExportedChatInvite &result) {
if (!_peerChat && !_peerChannel) return;
if (_peerChat) {
_peerChat->invitationUrl = (result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString();
// _peerChat->invitationUrl = (result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString();
} else {
_peerChannel->invitationUrl = (result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString();
// _peerChannel->invitationUrl = (result.type() == mtpc_chatInviteExported) ? qs(result.c_chatInviteExported().vlink) : QString();
}
updateInvitationLink();
showAll();
@ -932,12 +932,12 @@ void ProfileInner::paintEvent(QPaintEvent *e) {
// invite link stuff
if (_amCreator && ((_peerChat && _peerChat->canEdit()) || (_peerChannel && !_peerChannel->isPublic()))) {
if ((_peerChat && !_peerChat->invitationUrl.isEmpty()) || (_peerChannel && !_peerChannel->invitationUrl.isEmpty())) {
p.setPen(st::black);
p.setFont(st::linkFont);
p.drawText(_left, _invitationLink.y() + st::linkFont->ascent, lang(lng_group_invite_link));
top += _invitationLink.height() + st::setLittleSkip;
}
//if ((_peerChat && !_peerChat->invitationUrl.isEmpty()) || (_peerChannel && !_peerChannel->invitationUrl.isEmpty())) {
// p.setPen(st::black);
// p.setFont(st::linkFont);
// p.drawText(_left, _invitationLink.y() + st::linkFont->ascent, lang(lng_group_invite_link));
// top += _invitationLink.height() + st::setLittleSkip;
//}
top += _createInvitationLink.height() + st::setSectionSkip;
}
@ -1447,13 +1447,13 @@ void ProfileInner::resizeEvent(QResizeEvent *e) {
if (!_invitationText.isEmpty()) {
_invitationLink.setText(st::linkFont->elided(_invitationText, _width - _inviteLinkTextWidth));
}
if ((_peerChat && !_peerChat->invitationUrl.isEmpty()) || (_peerChannel && !_peerChannel->invitationUrl.isEmpty())) {
_invitationLink.move(_left + _inviteLinkTextWidth, top);
top += _invitationLink.height() + st::setLittleSkip;
_createInvitationLink.move(_left, top);
} else {
_createInvitationLink.move(_left, top);
}
//if ((_peerChat && !_peerChat->invitationUrl.isEmpty()) || (_peerChannel && !_peerChannel->invitationUrl.isEmpty())) {
// _invitationLink.move(_left + _inviteLinkTextWidth, top);
// top += _invitationLink.height() + st::setLittleSkip;
// _createInvitationLink.move(_left, top);
//} else {
// _createInvitationLink.move(_left, top);
//}
top += _createInvitationLink.height() + st::setSectionSkip;
}
@ -1709,11 +1709,11 @@ void ProfileInner::showAll() {
}
if (_amCreator) {
_createInvitationLink.show();
if (_peerChat->invitationUrl.isEmpty()) {
_invitationLink.hide();
} else {
_invitationLink.show();
}
//if (_peerChat->invitationUrl.isEmpty()) {
// _invitationLink.hide();
//} else {
// _invitationLink.show();
//}
} else {
_createInvitationLink.hide();
_invitationLink.hide();
@ -1756,11 +1756,11 @@ void ProfileInner::showAll() {
}
if (_amCreator && !_peerChannel->isPublic()) {
_createInvitationLink.show();
if (_peerChannel->invitationUrl.isEmpty()) {
_invitationLink.hide();
} else {
_invitationLink.show();
}
//if (_peerChannel->invitationUrl.isEmpty()) {
// _invitationLink.hide();
//} else {
// _invitationLink.show();
//}
} else {
_createInvitationLink.hide();
_invitationLink.hide();
@ -1809,17 +1809,17 @@ void ProfileInner::showAll() {
void ProfileInner::updateInvitationLink() {
if (!_peerChat && !_peerChannel) return;
if ((_peerChat && _peerChat->invitationUrl.isEmpty()) || (_peerChannel && _peerChannel->invitationUrl.isEmpty())) {
_createInvitationLink.setText(lang(lng_group_invite_create));
} else {
_createInvitationLink.setText(lang(lng_group_invite_create_new));
_invitationText = _peerChat ? _peerChat->invitationUrl : _peerChannel->invitationUrl;
if (_invitationText.startsWith(qstr("http://"), Qt::CaseInsensitive)) {
_invitationText = _invitationText.mid(7);
} else if (_invitationText.startsWith(qstr("https://"), Qt::CaseInsensitive)) {
_invitationText = _invitationText.mid(8);
}
}
//if ((_peerChat && _peerChat->invitationUrl.isEmpty()) || (_peerChannel && _peerChannel->invitationUrl.isEmpty())) {
// _createInvitationLink.setText(lang(lng_group_invite_create));
//} else {
// _createInvitationLink.setText(lang(lng_group_invite_create_new));
// _invitationText = _peerChat ? _peerChat->invitationUrl : _peerChannel->invitationUrl;
// if (_invitationText.startsWith(qstr("http://"), Qt::CaseInsensitive)) {
// _invitationText = _invitationText.mid(7);
// } else if (_invitationText.startsWith(qstr("https://"), Qt::CaseInsensitive)) {
// _invitationText = _invitationText.mid(8);
// }
//}
}
void ProfileInner::updatePinnedMessageVisibility() {

View File

@ -437,6 +437,16 @@ void ChatData::setNameDelayed(const QString &newName) {
updateNameDelayed(newName.isEmpty() ? name : newName, QString(), QString());
}
void ChatData::setInviteLink(const QString &newInviteLink) {
if (newInviteLink != _inviteLink) {
_inviteLink = newInviteLink;
Notify::PeerUpdate update(this);
update.flags |= Notify::PeerUpdateFlag::InviteLinkChanged;
Notify::peerUpdatedDelayed(update);
}
}
void ChannelData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see Local::readPeer as well
PhotoId newPhotoId = photoId;
ImagePtr newPhoto = _userpic;
@ -504,6 +514,16 @@ bool ChannelData::setAbout(const QString &newAbout) {
return true;
}
void ChannelData::setInviteLink(const QString &newInviteLink) {
if (newInviteLink != _inviteLink) {
_inviteLink = newInviteLink;
Notify::PeerUpdate update(this);
update.flags |= Notify::PeerUpdateFlag::InviteLinkChanged;
Notify::peerUpdatedDelayed(update);
}
}
void ChannelData::flagsUpdated() {
if (isMegagroup()) {
if (!mgInfo) {

View File

@ -486,7 +486,6 @@ private:
class ChatData : public PeerData {
public:
ChatData(const PeerId &id) : PeerData(id), inputChat(MTP_int(bareId())) {
}
void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId);
@ -560,7 +559,15 @@ public:
MarkupSenders markupSenders;
int botStatus = 0; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other
// ImagePtr photoFull;
QString invitationUrl;
void setInviteLink(const QString &newInviteLink);
QString inviteLink() const {
return _inviteLink;
}
private:
QString _inviteLink;
};
enum PtsSkippedQueue {
@ -659,7 +666,6 @@ struct MegagroupInfo {
class ChannelData : public PeerData {
public:
ChannelData(const PeerId &id) : PeerData(id), inputChannel(MTP_inputChannel(MTP_int(bareId()), MTP_long(0))) {
}
void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId);
@ -756,7 +762,11 @@ public:
}
// ImagePtr photoFull;
QString invitationUrl;
void setInviteLink(const QString &newInviteLink);
QString inviteLink() const {
return _inviteLink;
}
int32 inviter = 0; // > 0 - user who invited me to channel, < 0 - not in channel
QDateTime inviteDate;
@ -810,6 +820,8 @@ private:
QString _restrictionReason;
QString _about;
QString _inviteLink;
};
inline bool isUser(const PeerData *peer) {

View File

@ -0,0 +1,69 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "ui/buttons/left_outline_button.h"
namespace Ui {
LeftOutlineButton::LeftOutlineButton(QWidget *parent, const QString &text, const style::OutlineButton &st) : Button(parent)
, _text(text)
, _fullText(text)
, _textWidth(st.font->width(_text))
, _st(st) {
resizeToWidth(_textWidth + _st.padding.left() + _st.padding.right());
setCursor(style::cur_pointer);
}
void LeftOutlineButton::setText(const QString &text) {
_text = text;
_fullText = text;
_textWidth = _st.font->width(_text);
resizeToWidth(width());
}
void LeftOutlineButton::resizeToWidth(int newWidth) {
int availableWidth = qMax(newWidth - _st.padding.left() - _st.padding.right(), 1);
if (availableWidth < _textWidth) {
_text = _st.font->elided(_fullText, availableWidth);
_textWidth = _st.font->width(_text);
}
resize(newWidth, _st.padding.top() + _st.font->height + _st.padding.bottom());
}
void LeftOutlineButton::paintEvent(QPaintEvent *e) {
Painter p(this);
bool over = (_state & Button::StateOver);
if (width() > _st.outlineWidth) {
p.fillRect(rtlrect(0, 0, _st.outlineWidth, height(), width()), over ? _st.outlineFgOver : _st.outlineFg);
p.fillRect(rtlrect(_st.outlineWidth, 0, width() - _st.outlineWidth, height(), width()), over ? _st.textBgOver : _st.textBg);
}
p.setFont(_st.font);
p.setPen(over ? _st.textFgOver : _st.textFg);
p.drawTextLeft(_st.padding.left(), _st.padding.top(), width(), _text, _textWidth);
}
void LeftOutlineButton::onStateChanged(int oldState, ButtonStateChangeSource source) {
update();
}
} // namespace Ui

View File

@ -0,0 +1,47 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include "ui/button.h"
namespace Ui {
class LeftOutlineButton : public Button {
public:
LeftOutlineButton(QWidget *parent, const QString &text, const style::OutlineButton &st = st::defaultLeftOutlineButton);
void resizeToWidth(int newWidth);
void setText(const QString &text);
protected:
void paintEvent(QPaintEvent *e) override;
void onStateChanged(int oldState, ButtonStateChangeSource source) override;
private:
QString _text, _fullText;
int _textWidth;
const style::OutlineButton &_st;
};
} // namespace Ui

View File

@ -268,7 +268,7 @@ bool Checkbox::checked() const {
return _checked;
}
void Checkbox::setChecked(bool checked) {
void Checkbox::setChecked(bool checked, NotifyAboutChange notify) {
if (_checked != checked) {
_checked = checked;
if (_checked) {
@ -277,11 +277,17 @@ void Checkbox::setChecked(bool checked) {
a_checked.start(0);
}
_a_checked.start();
emit changed();
if (notify == NotifyAboutChange::Notify) {
emit changed();
}
}
}
void Checkbox::finishAnimations() {
a_checked.finish();
_a_checked.stop();
}
void Checkbox::step_over(float64 ms, bool timer) {
float64 dt = ms / _st.duration;
if (dt >= 1) {

View File

@ -87,27 +87,29 @@ class Checkbox : public Button {
Q_OBJECT
public:
Checkbox(QWidget *parent, const QString &text, bool checked = false, const style::Checkbox &st = st::defaultCheckbox);
bool checked() const;
void setChecked(bool checked);
enum class NotifyAboutChange {
Notify,
DontNotify,
};
void setChecked(bool checked, NotifyAboutChange notify = NotifyAboutChange::Notify);
void step_over(float64 ms, bool timer);
void step_checked(float64 ms, bool timer);
void finishAnimations();
void paintEvent(QPaintEvent *e);
public slots:
void onClicked();
void onStateChange(int oldState, ButtonStateChangeSource source);
signals:
void changed();
private:
void step_over(float64 ms, bool timer);
void step_checked(float64 ms, bool timer);
const style::Checkbox &_st;
anim::fvalue a_over, a_checked;

View File

@ -406,6 +406,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_profile_settings_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_profile_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@ -721,6 +725,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Deploy\moc_profile_settings_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Deploy\moc_profile_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@ -1062,6 +1070,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_profile_settings_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_profile_widget.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
@ -1263,6 +1275,7 @@
<ClCompile Include="SourceFiles\ui\animation.cpp" />
<ClCompile Include="SourceFiles\ui\boxshadow.cpp" />
<ClCompile Include="SourceFiles\ui\button.cpp" />
<ClCompile Include="SourceFiles\ui\buttons\left_outline_button.cpp" />
<ClCompile Include="SourceFiles\ui\buttons\peer_avatar_button.cpp" />
<ClCompile Include="SourceFiles\ui\buttons\round_button.cpp" />
<ClCompile Include="SourceFiles\ui\countryinput.cpp" />
@ -1574,7 +1587,20 @@
<ClInclude Include="SourceFiles\profile\profile_invite_link_widget.h" />
<ClInclude Include="SourceFiles\profile\profile_members_widget.h" />
<ClInclude Include="SourceFiles\profile\profile_section_memento.h" />
<ClInclude Include="SourceFiles\profile\profile_settings_widget.h" />
<CustomBuild Include="SourceFiles\profile\profile_settings_widget.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">Moc%27ing profile_settings_widget.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/profile/profile_settings_widget.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore\5.6.0\QtCore" "-I$(QTDIR)\include\QtGui\5.6.0\QtGui" "-I.\..\..\Libraries\breakpad\src" "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\ThirdParty\minizip" "-I.\..\..\Libraries\openssl\Release\include"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing profile_settings_widget.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/profile/profile_settings_widget.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore\5.6.0\QtCore" "-I$(QTDIR)\include\QtGui\5.6.0\QtGui" "-I.\..\..\Libraries\breakpad\src" "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\ThirdParty\minizip" "-I.\..\..\Libraries\openssl_debug\Debug\include"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing profile_settings_widget.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/profile/profile_settings_widget.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore\5.6.0\QtCore" "-I$(QTDIR)\include\QtGui\5.6.0\QtGui" "-I.\..\..\Libraries\breakpad\src" "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\ThirdParty\minizip" "-I.\..\..\Libraries\openssl\Release\include"</Command>
</CustomBuild>
<ClInclude Include="SourceFiles\profile\profile_shared_media_widget.h" />
<ClInclude Include="SourceFiles\profile\profile_userpic_button.h" />
<ClInclude Include="SourceFiles\serialize\serialize_common.h" />
@ -1623,6 +1649,7 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore\5.6.0\QtCore" "-I$(QTDIR)\include\QtGui\5.6.0\QtGui" "-I.\..\..\Libraries\breakpad\src" "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\ThirdParty\minizip" "-I.\..\..\Libraries\openssl\Release\include" "-fstdafx.h" "-f../../SourceFiles/ui/countryinput.h"</Command>
</CustomBuild>
<ClInclude Include="SourceFiles\ui\buttons\left_outline_button.h" />
<ClInclude Include="SourceFiles\ui\buttons\peer_avatar_button.h" />
<ClInclude Include="SourceFiles\ui\buttons\round_button.h" />
<ClInclude Include="SourceFiles\ui\emoji_config.h" />

View File

@ -1233,6 +1233,18 @@
<ClCompile Include="SourceFiles\profile\profile_shared_media_widget.cpp">
<Filter>SourceFiles\profile</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Deploy\moc_profile_settings_widget.cpp">
<Filter>GeneratedFiles\Deploy</Filter>
</ClCompile>
<ClCompile Include="SourceFiles\ui\buttons\left_outline_button.cpp">
<Filter>SourceFiles\ui\buttons</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_profile_settings_widget.cpp">
<Filter>GeneratedFiles\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_profile_settings_widget.cpp">
<Filter>GeneratedFiles\Release</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SourceFiles\stdafx.h">
@ -1448,12 +1460,12 @@
<ClInclude Include="SourceFiles\profile\profile_members_widget.h">
<Filter>SourceFiles\profile</Filter>
</ClInclude>
<ClInclude Include="SourceFiles\profile\profile_settings_widget.h">
<Filter>SourceFiles\profile</Filter>
</ClInclude>
<ClInclude Include="SourceFiles\profile\profile_shared_media_widget.h">
<Filter>SourceFiles\profile</Filter>
</ClInclude>
<ClInclude Include="SourceFiles\ui\buttons\left_outline_button.h">
<Filter>SourceFiles\ui\buttons</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="SourceFiles\application.h">
@ -1717,6 +1729,9 @@
<CustomBuild Include="SourceFiles\profile\profile_block_widget.h">
<Filter>SourceFiles\profile</Filter>
</CustomBuild>
<CustomBuild Include="SourceFiles\profile\profile_settings_widget.h">
<Filter>SourceFiles\profile</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="Resources\langs\lang_it.strings">