1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

style(groupinviteform): extracted few variables

This commit is contained in:
Diadlo 2016-04-10 13:57:52 +03:00
parent f137ba710c
commit 24b28b1e51
2 changed files with 9 additions and 5 deletions

View File

@ -96,7 +96,9 @@ void GroupInviteForm::addGroupInvite(int32_t friendId, uint8_t type, QByteArray
QHBoxLayout* groupLayout = new QHBoxLayout(groupWidget); QHBoxLayout* groupLayout = new QHBoxLayout(groupWidget);
CroppingLabel* groupLabel = new CroppingLabel(this); CroppingLabel* groupLabel = new CroppingLabel(this);
groupLabel->setText(tr("Invited by <b>%1</b> on %2.").arg(Nexus::getCore()->getFriendUsername(friendId), QDateTime::currentDateTime().toString())); QString name = Nexus::getCore()->getFriendUsername(friendId);
QString time = QDateTime::currentDateTime().toString();
groupLabel->setText(tr("Invited by <b>%1</b> on %2.").arg(name, time));
groupLayout->addWidget(groupLabel); groupLayout->addWidget(groupLabel);
QPushButton* acceptButton = new QPushButton(this); QPushButton* acceptButton = new QPushButton(this);

View File

@ -20,8 +20,10 @@
#ifndef GROUPINVITEFORM_H #ifndef GROUPINVITEFORM_H
#define GROUPINVITEFORM_H #define GROUPINVITEFORM_H
#include <QDateTime>
#include <QWidget> #include <QWidget>
#include <QSet> #include <QSet>
#include <src/widget/tool/croppinglabel.h>
#include "src/widget/gui.h" #include "src/widget/gui.h"
class QLabel; class QLabel;
@ -61,6 +63,7 @@ private:
void retranslateUi(); void retranslateUi();
void retranslateAcceptButton(QPushButton* acceptButton); void retranslateAcceptButton(QPushButton* acceptButton);
void retranslateRejectButton(QPushButton* rejectButton); void retranslateRejectButton(QPushButton* rejectButton);
void deleteInviteButtons(QWidget* widget);
private: private:
struct GroupInvite struct GroupInvite
@ -78,7 +81,6 @@ private:
QSet<QPushButton*> acceptButtons; QSet<QPushButton*> acceptButtons;
QSet<QPushButton*> rejectButtons; QSet<QPushButton*> rejectButtons;
QList<GroupInvite> groupInvites; QList<GroupInvite> groupInvites;
void deleteInviteButtons(QWidget *widget);
}; };
#endif // GROUPINVITEFORM_H #endif // GROUPINVITEFORM_H