mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
style: Fix style of a lot of pointers
This commit is contained in:
parent
7d1564e586
commit
fcd8eed7cd
|
@ -58,7 +58,7 @@ QRectF ChatLineContentProxy::boundingRect() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void ChatLineContentProxy::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||||
{
|
{
|
||||||
painter->setClipRect(boundingRect());
|
painter->setClipRect(boundingRect());
|
||||||
proxy->paint(painter, option, widget);
|
proxy->paint(painter, option, widget);
|
||||||
|
@ -69,7 +69,7 @@ qreal ChatLineContentProxy::getAscent() const
|
||||||
return 7.0;
|
return 7.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ChatLineContentProxy::getWidget() const
|
QWidget* ChatLineContentProxy::getWidget() const
|
||||||
{
|
{
|
||||||
return proxy->widget();
|
return proxy->widget();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
|
|
||||||
QRectF boundingRect() const override;
|
QRectF boundingRect() const override;
|
||||||
void setWidth(qreal width) override;
|
void setWidth(qreal width) override;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
||||||
qreal getAscent() const override;
|
qreal getAscent() const override;
|
||||||
|
|
||||||
QWidget* getWidget() const;
|
QWidget* getWidget() const;
|
||||||
|
|
|
@ -882,7 +882,7 @@ bool ChatLog::isActiveFileTransfer(ChatLine::Ptr l)
|
||||||
if (!proxy)
|
if (!proxy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QWidget *widget = proxy->getWidget();
|
QWidget* widget = proxy->getWidget();
|
||||||
FileTransferWidget *transferWidget = qobject_cast<FileTransferWidget*>(widget);
|
FileTransferWidget *transferWidget = qobject_cast<FileTransferWidget*>(widget);
|
||||||
if (transferWidget && transferWidget->isActive())
|
if (transferWidget && transferWidget->isActive())
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
FileTransferWidget::FileTransferWidget(QWidget *parent, ToxFile file)
|
FileTransferWidget::FileTransferWidget(QWidget* parent, ToxFile file)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::FileTransferWidget)
|
, ui(new Ui::FileTransferWidget)
|
||||||
, fileInfo(file)
|
, fileInfo(file)
|
||||||
|
|
|
@ -39,7 +39,7 @@ class FileTransferWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileTransferWidget(QWidget *parent, ToxFile file);
|
explicit FileTransferWidget(QWidget* parent, ToxFile file);
|
||||||
virtual ~FileTransferWidget();
|
virtual ~FileTransferWidget();
|
||||||
void autoAcceptTransfer(const QString& path);
|
void autoAcceptTransfer(const QString& path);
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
Image(QSize size, const QString &filename);
|
Image(QSize size, const QString &filename);
|
||||||
|
|
||||||
virtual QRectF boundingRect() const override;
|
virtual QRectF boundingRect() const override;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
||||||
virtual void setWidth(qreal width) override;
|
virtual void setWidth(qreal width) override;
|
||||||
virtual qreal getAscent() const override;
|
virtual qreal getAscent() const override;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ QRectF NotificationIcon::boundingRect() const
|
||||||
return QRectF(QPointF(-size.width() / 2.0, -size.height() / 2.0), size);
|
return QRectF(QPointF(-size.width() / 2.0, -size.height() / 2.0), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationIcon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void NotificationIcon::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||||
{
|
{
|
||||||
painter->setClipRect(boundingRect());
|
painter->setClipRect(boundingRect());
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
explicit NotificationIcon(QSize size);
|
explicit NotificationIcon(QSize size);
|
||||||
|
|
||||||
virtual QRectF boundingRect() const override;
|
virtual QRectF boundingRect() const override;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
||||||
virtual void setWidth(qreal width) override;
|
virtual void setWidth(qreal width) override;
|
||||||
virtual qreal getAscent() const override;
|
virtual qreal getAscent() const override;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
Spinner(const QString& img, QSize size, qreal speed);
|
Spinner(const QString& img, QSize size, qreal speed);
|
||||||
|
|
||||||
virtual QRectF boundingRect() const override;
|
virtual QRectF boundingRect() const override;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
||||||
virtual void setWidth(qreal width) override;
|
virtual void setWidth(qreal width) override;
|
||||||
virtual void visibilityChanged(bool visible) override;
|
virtual void visibilityChanged(bool visible) override;
|
||||||
virtual qreal getAscent() const override;
|
virtual qreal getAscent() const override;
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
virtual QString getSelectedText() const final;
|
virtual QString getSelectedText() const final;
|
||||||
|
|
||||||
virtual QRectF boundingRect() const final;
|
virtual QRectF boundingRect() const final;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) final;
|
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) final;
|
||||||
|
|
||||||
virtual void visibilityChanged(bool keepInMemory) final;
|
virtual void visibilityChanged(bool keepInMemory) final;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ Friend* FriendList::findFriend(const ToxPk& friendPk)
|
||||||
auto id = key2id.find(friendPk.getKey());
|
auto id = key2id.find(friendPk.getKey());
|
||||||
if (id != key2id.end())
|
if (id != key2id.end())
|
||||||
{
|
{
|
||||||
Friend *f = findFriend(*id);
|
Friend* f = findFriend(*id);
|
||||||
if (!f)
|
if (!f)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (f->getPublicKey() == friendPk)
|
if (f->getPublicKey() == friendPk)
|
||||||
|
|
|
@ -53,7 +53,7 @@ void Group::updatePeer(int peerId, QString name)
|
||||||
peers[peerId] = name;
|
peers[peerId] = name;
|
||||||
toxids[peerPk] = name;
|
toxids[peerPk] = name;
|
||||||
|
|
||||||
Friend *f = FriendList::findFriend(peerKey);
|
Friend* f = FriendList::findFriend(peerKey);
|
||||||
if (f != nullptr && f->hasAlias())
|
if (f != nullptr && f->hasAlias())
|
||||||
{
|
{
|
||||||
peers[peerId] = f->getDisplayedName();
|
peers[peerId] = f->getDisplayedName();
|
||||||
|
@ -100,7 +100,7 @@ void Group::regeneratePeerList()
|
||||||
if (toxids[peerPk].isEmpty())
|
if (toxids[peerPk].isEmpty())
|
||||||
toxids[peerPk] = tr("<Empty>", "Placeholder when someone's name in a group chat is empty");
|
toxids[peerPk] = tr("<Empty>", "Placeholder when someone's name in a group chat is empty");
|
||||||
|
|
||||||
Friend *f = FriendList::findFriend(id);
|
Friend* f = FriendList::findFriend(id);
|
||||||
if (f != nullptr && f->hasAlias())
|
if (f != nullptr && f->hasAlias())
|
||||||
{
|
{
|
||||||
peers[i] = f->getDisplayedName();
|
peers[i] = f->getDisplayedName();
|
||||||
|
|
|
@ -82,7 +82,7 @@ bool handleToxURI(const QString &toxURI)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ToxURIDialog::ToxURIDialog(QWidget *parent, const QString &userId, const QString &message) :
|
ToxURIDialog::ToxURIDialog(QWidget* parent, const QString &userId, const QString &message) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ToxURIDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ToxURIDialog(QWidget *parent, const QString &userId, const QString &message);
|
explicit ToxURIDialog(QWidget* parent, const QString &userId, const QString &message);
|
||||||
QString getRequestMessage();
|
QString getRequestMessage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
const int OfflineMsgEngine::offlineTimeout = 20000;
|
const int OfflineMsgEngine::offlineTimeout = 20000;
|
||||||
QMutex OfflineMsgEngine::globalMutex;
|
QMutex OfflineMsgEngine::globalMutex;
|
||||||
|
|
||||||
OfflineMsgEngine::OfflineMsgEngine(Friend *frnd) :
|
OfflineMsgEngine::OfflineMsgEngine(Friend* frnd) :
|
||||||
mutex(QMutex::Recursive),
|
mutex(QMutex::Recursive),
|
||||||
f(frnd)
|
f(frnd)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
GenericNetCamView::GenericNetCamView(QWidget *parent)
|
GenericNetCamView::GenericNetCamView(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
verLayout = new QVBoxLayout(this);
|
verLayout = new QVBoxLayout(this);
|
||||||
|
|
|
@ -107,7 +107,7 @@ private:
|
||||||
VideoSurface* videoSurface;
|
VideoSurface* videoSurface;
|
||||||
};
|
};
|
||||||
|
|
||||||
GroupNetCamView::GroupNetCamView(int group, QWidget *parent)
|
GroupNetCamView::GroupNetCamView(int group, QWidget* parent)
|
||||||
: GenericNetCamView(parent)
|
: GenericNetCamView(parent)
|
||||||
, group(group)
|
, group(group)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ class NetCamView : public GenericNetCamView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NetCamView(int friendId, QWidget *parent=0);
|
NetCamView(int friendId, QWidget* parent=0);
|
||||||
~NetCamView();
|
~NetCamView();
|
||||||
|
|
||||||
virtual void show(VideoSource* source, const QString& title);
|
virtual void show(VideoSource* source, const QString& title);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
AboutUser::AboutUser(ToxPk &toxId, QWidget *parent) :
|
AboutUser::AboutUser(ToxPk &toxId, QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::AboutUser)
|
ui(new Ui::AboutUser)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ AboutUser::AboutUser(ToxPk &toxId, QWidget *parent) :
|
||||||
ui->selectSaveDir->setText(Settings::getInstance().getAutoAcceptDir(this->friendPk));
|
ui->selectSaveDir->setText(Settings::getInstance().getAutoAcceptDir(this->friendPk));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutUser::setFriend(Friend *f)
|
void AboutUser::setFriend(Friend* f)
|
||||||
{
|
{
|
||||||
this->setWindowTitle(f->getDisplayedName());
|
this->setWindowTitle(f->getDisplayedName());
|
||||||
ui->userName->setText(f->getDisplayedName());
|
ui->userName->setText(f->getDisplayedName());
|
||||||
|
|
|
@ -14,9 +14,9 @@ class AboutUser : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AboutUser(ToxPk &toxID, QWidget *parent = 0);
|
explicit AboutUser(ToxPk &toxID, QWidget* parent = 0);
|
||||||
~AboutUser();
|
~AboutUser();
|
||||||
void setFriend(Friend *f);
|
void setFriend(Friend* f);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AboutUser *ui;
|
Ui::AboutUser *ui;
|
||||||
|
|
|
@ -61,7 +61,7 @@ protected:
|
||||||
void setContainerAttribute(Qt::WidgetAttribute attribute, bool enabled);
|
void setContainerAttribute(Qt::WidgetAttribute attribute, bool enabled);
|
||||||
QLayout* friendOnlineLayout() const;
|
QLayout* friendOnlineLayout() const;
|
||||||
QLayout* friendOfflineLayout() const;
|
QLayout* friendOfflineLayout() const;
|
||||||
void emitChatroomWidget(QLayout *layout, int index);
|
void emitChatroomWidget(QLayout* layout, int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void onSetName() {}
|
virtual void onSetName() {}
|
||||||
|
|
|
@ -154,7 +154,7 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||||
void CircleWidget::dragEnterEvent(QDragEnterEvent* event)
|
void CircleWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
ToxId toxId(event->mimeData()->text());
|
ToxId toxId(event->mimeData()->text());
|
||||||
Friend *f = FriendList::findFriend(toxId.getPublicKey());
|
Friend* f = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (f != nullptr)
|
if (f != nullptr)
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ void CircleWidget::dropEvent(QDropEvent* event)
|
||||||
|
|
||||||
// Check, that the user has a friend with the same ToxId
|
// Check, that the user has a friend with the same ToxId
|
||||||
ToxId toxId(event->mimeData()->text());
|
ToxId toxId(event->mimeData()->text());
|
||||||
Friend *f = FriendList::findFriend(toxId.getPublicKey());
|
Friend* f = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (!f)
|
if (!f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ ContentDialog::ContentDialog(SettingsWidget* settingsWidget, QWidget* parent)
|
||||||
setStyleSheet(Style::getStylesheet(":/ui/contentDialog/contentDialog.css"));
|
setStyleSheet(Style::getStylesheet(":/ui/contentDialog/contentDialog.css"));
|
||||||
splitter->setHandleWidth(6);
|
splitter->setHandleWidth(6);
|
||||||
|
|
||||||
QWidget *friendWidget = new QWidget();
|
QWidget* friendWidget = new QWidget();
|
||||||
friendWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
friendWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||||
friendWidget->setAutoFillBackground(true);
|
friendWidget->setAutoFillBackground(true);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ ContentLayout::ContentLayout()
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentLayout::ContentLayout(QWidget *parent)
|
ContentLayout::ContentLayout(QWidget* parent)
|
||||||
: QVBoxLayout(parent)
|
: QVBoxLayout(parent)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
EmoticonsWidget::EmoticonsWidget(QWidget *parent) :
|
EmoticonsWidget::EmoticonsWidget(QWidget* parent) :
|
||||||
QMenu(parent)
|
QMenu(parent)
|
||||||
{
|
{
|
||||||
setStyleSheet(Style::getStylesheet(":/ui/emoticonWidget/emoticonWidget.css"));
|
setStyleSheet(Style::getStylesheet(":/ui/emoticonWidget/emoticonWidget.css"));
|
||||||
|
|
|
@ -28,7 +28,7 @@ class EmoticonsWidget : public QMenu
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit EmoticonsWidget(QWidget *parent = 0);
|
explicit EmoticonsWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void insertEmoticon(QString str);
|
void insertEmoticon(QString str);
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "flowlayout.h"
|
#include "flowlayout.h"
|
||||||
FlowLayout::FlowLayout(QWidget *parent, int margin, int hSpacing, int vSpacing)
|
FlowLayout::FlowLayout(QWidget* parent, int margin, int hSpacing, int vSpacing)
|
||||||
: QLayout(parent), m_hSpace(hSpacing), m_vSpace(vSpacing)
|
: QLayout(parent), m_hSpace(hSpacing), m_vSpace(vSpacing)
|
||||||
{
|
{
|
||||||
setContentsMargins(margin, margin, margin, margin);
|
setContentsMargins(margin, margin, margin, margin);
|
||||||
|
@ -149,7 +149,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
|
||||||
QLayoutItem *item;
|
QLayoutItem *item;
|
||||||
foreach (item, itemList)
|
foreach (item, itemList)
|
||||||
{
|
{
|
||||||
QWidget *wid = item->widget();
|
QWidget* wid = item->widget();
|
||||||
int spaceX = horizontalSpacing();
|
int spaceX = horizontalSpacing();
|
||||||
if (spaceX == -1)
|
if (spaceX == -1)
|
||||||
spaceX = wid->style()->layoutSpacing(
|
spaceX = wid->style()->layoutSpacing(
|
||||||
|
@ -186,11 +186,11 @@ int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const
|
||||||
}
|
}
|
||||||
else if (parent->isWidgetType())
|
else if (parent->isWidgetType())
|
||||||
{
|
{
|
||||||
QWidget *pw = static_cast<QWidget *>(parent);
|
QWidget* pw = static_cast<QWidget* >(parent);
|
||||||
return pw->style()->pixelMetric(pm, 0, pw);
|
return pw->style()->pixelMetric(pm, 0, pw);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return static_cast<QLayout *>(parent)->spacing();
|
return static_cast<QLayout* >(parent)->spacing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void addFriendRequestWidget(const QString& friendAddress, const QString& message);
|
void addFriendRequestWidget(const QString& friendAddress, const QString& message);
|
||||||
void removeFriendRequestWidget(QWidget *friendWidget);
|
void removeFriendRequestWidget(QWidget* friendWidget);
|
||||||
void retranslateAcceptButton(QPushButton* acceptButton);
|
void retranslateAcceptButton(QPushButton* acceptButton);
|
||||||
void retranslateRejectButton(QPushButton* rejectButton);
|
void retranslateRejectButton(QPushButton* rejectButton);
|
||||||
void deleteFriendRequest(const ToxId& toxId);
|
void deleteFriendRequest(const ToxId& toxId);
|
||||||
|
@ -86,7 +86,7 @@ private:
|
||||||
QLineEdit toxId;
|
QLineEdit toxId;
|
||||||
QTextEdit message;
|
QTextEdit message;
|
||||||
QVBoxLayout layout, headLayout;
|
QVBoxLayout layout, headLayout;
|
||||||
QWidget *head, *main;
|
QWidget* head, *main;
|
||||||
QString lastUsername;
|
QString lastUsername;
|
||||||
QTabWidget* tabWidget;
|
QTabWidget* tabWidget;
|
||||||
QVBoxLayout* requestsLayout;
|
QVBoxLayout* requestsLayout;
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
#include "src/widget/widget.h"
|
#include "src/widget/widget.h"
|
||||||
|
|
||||||
GenericChatForm::GenericChatForm(QWidget *parent)
|
GenericChatForm::GenericChatForm(QWidget* parent)
|
||||||
: QWidget(parent, Qt::Window)
|
: QWidget(parent, Qt::Window)
|
||||||
, audioInputFlag(false)
|
, audioInputFlag(false)
|
||||||
, audioOutputFlag(false)
|
, audioOutputFlag(false)
|
||||||
|
@ -498,7 +498,7 @@ void GenericChatForm::onSelectAllClicked()
|
||||||
|
|
||||||
QString GenericChatForm::resolveToxId(const ToxPk &id)
|
QString GenericChatForm::resolveToxId(const ToxPk &id)
|
||||||
{
|
{
|
||||||
Friend *f = FriendList::findFriend(id);
|
Friend* f = FriendList::findFriend(id);
|
||||||
if (f)
|
if (f)
|
||||||
return f->getDisplayedName();
|
return f->getDisplayedName();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class GenericChatForm : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit GenericChatForm(QWidget *parent = 0);
|
explicit GenericChatForm(QWidget* parent = 0);
|
||||||
~GenericChatForm();
|
~GenericChatForm();
|
||||||
|
|
||||||
void setName(const QString &newName);
|
void setName(const QString &newName);
|
||||||
|
@ -122,7 +122,7 @@ protected:
|
||||||
int curRow;
|
int curRow;
|
||||||
CroppingLabel *nameLabel;
|
CroppingLabel *nameLabel;
|
||||||
MaskablePixmapWidget *avatar;
|
MaskablePixmapWidget *avatar;
|
||||||
QWidget *headWidget;
|
QWidget* headWidget;
|
||||||
QPushButton *fileButton, *screenshotButton, *emoteButton, *callButton, *videoButton, *volButton, *micButton;
|
QPushButton *fileButton, *screenshotButton, *emoteButton, *callButton, *videoButton, *volButton, *micButton;
|
||||||
FlyoutOverlayWidget *fileFlyout;
|
FlyoutOverlayWidget *fileFlyout;
|
||||||
QVBoxLayout *headTextLayout;
|
QVBoxLayout *headTextLayout;
|
||||||
|
|
|
@ -283,7 +283,7 @@ void GroupChatForm::peerAudioPlaying(int peer)
|
||||||
void GroupChatForm::dragEnterEvent(QDragEnterEvent *ev)
|
void GroupChatForm::dragEnterEvent(QDragEnterEvent *ev)
|
||||||
{
|
{
|
||||||
ToxId toxId = ToxId(ev->mimeData()->text());
|
ToxId toxId = ToxId(ev->mimeData()->text());
|
||||||
Friend *frnd = FriendList::findFriend(toxId.getPublicKey());
|
Friend* frnd = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (frnd)
|
if (frnd)
|
||||||
ev->acceptProposedAction();
|
ev->acceptProposedAction();
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ void GroupChatForm::dragEnterEvent(QDragEnterEvent *ev)
|
||||||
void GroupChatForm::dropEvent(QDropEvent *ev)
|
void GroupChatForm::dropEvent(QDropEvent *ev)
|
||||||
{
|
{
|
||||||
ToxId toxId = ToxId(ev->mimeData()->text());
|
ToxId toxId = ToxId(ev->mimeData()->text());
|
||||||
Friend *frnd = FriendList::findFriend(toxId.getPublicKey());
|
Friend* frnd = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (!frnd)
|
if (!frnd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "loadhistorydialog.h"
|
#include "loadhistorydialog.h"
|
||||||
#include "ui_loadhistorydialog.h"
|
#include "ui_loadhistorydialog.h"
|
||||||
|
|
||||||
LoadHistoryDialog::LoadHistoryDialog(QWidget *parent) :
|
LoadHistoryDialog::LoadHistoryDialog(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::LoadHistoryDialog)
|
ui(new Ui::LoadHistoryDialog)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ class LoadHistoryDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LoadHistoryDialog(QWidget *parent = 0);
|
explicit LoadHistoryDialog(QWidget* parent = 0);
|
||||||
~LoadHistoryDialog();
|
~LoadHistoryDialog();
|
||||||
|
|
||||||
QDateTime getFromDate();
|
QDateTime getFromDate();
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
ProfileForm::ProfileForm(QWidget *parent) :
|
ProfileForm::ProfileForm(QWidget* parent) :
|
||||||
QWidget{parent}, qr{nullptr}
|
QWidget{parent}, qr{nullptr}
|
||||||
{
|
{
|
||||||
bodyUI = new Ui::IdentitySettings;
|
bodyUI = new Ui::IdentitySettings;
|
||||||
|
|
|
@ -55,7 +55,7 @@ class ProfileForm : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ProfileForm(QWidget *parent = nullptr);
|
explicit ProfileForm(QWidget* parent = nullptr);
|
||||||
~ProfileForm();
|
~ProfileForm();
|
||||||
virtual void show() final{}
|
virtual void show() final{}
|
||||||
void show(ContentLayout* contentLayout);
|
void show(ContentLayout* contentLayout);
|
||||||
|
@ -97,7 +97,7 @@ private:
|
||||||
Ui::IdentitySettings* bodyUI;
|
Ui::IdentitySettings* bodyUI;
|
||||||
MaskablePixmapWidget* profilePicture;
|
MaskablePixmapWidget* profilePicture;
|
||||||
QLabel* nameLabel;
|
QLabel* nameLabel;
|
||||||
QWidget *head;
|
QWidget* head;
|
||||||
Core* core;
|
Core* core;
|
||||||
QTimer timer;
|
QTimer timer;
|
||||||
bool hasCheck = false;
|
bool hasCheck = false;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "verticalonlyscroller.h"
|
#include "verticalonlyscroller.h"
|
||||||
|
|
||||||
VerticalOnlyScroller::VerticalOnlyScroller(QWidget *parent) :
|
VerticalOnlyScroller::VerticalOnlyScroller(QWidget* parent) :
|
||||||
QScrollArea(parent)
|
QScrollArea(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class VerticalOnlyScroller : public QScrollArea
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VerticalOnlyScroller(QWidget *parent = 0);
|
explicit VerticalOnlyScroller(QWidget* parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void resizeEvent(QResizeEvent *event) final override;
|
virtual void resizeEvent(QResizeEvent *event) final override;
|
||||||
|
|
|
@ -82,7 +82,7 @@ void FriendListLayout::moveFriendWidgets(FriendListWidget* listWidget)
|
||||||
QWidget* getWidget = friendOnlineLayout.getLayout()->takeAt(0)->widget();
|
QWidget* getWidget = friendOnlineLayout.getLayout()->takeAt(0)->widget();
|
||||||
|
|
||||||
FriendWidget* friendWidget = qobject_cast<FriendWidget*>(getWidget);
|
FriendWidget* friendWidget = qobject_cast<FriendWidget*>(getWidget);
|
||||||
Friend *f = FriendList::findFriend(friendWidget->friendId);
|
Friend* f = FriendList::findFriend(friendWidget->friendId);
|
||||||
listWidget->moveWidget(friendWidget, f->getStatus(), false);
|
listWidget->moveWidget(friendWidget, f->getStatus(), false);
|
||||||
}
|
}
|
||||||
while (!friendOfflineLayout.getLayout()->isEmpty())
|
while (!friendOfflineLayout.getLayout()->isEmpty())
|
||||||
|
@ -90,7 +90,7 @@ void FriendListLayout::moveFriendWidgets(FriendListWidget* listWidget)
|
||||||
QWidget* getWidget = friendOfflineLayout.getLayout()->takeAt(0)->widget();
|
QWidget* getWidget = friendOfflineLayout.getLayout()->takeAt(0)->widget();
|
||||||
|
|
||||||
FriendWidget* friendWidget = qobject_cast<FriendWidget*>(getWidget);
|
FriendWidget* friendWidget = qobject_cast<FriendWidget*>(getWidget);
|
||||||
Friend *f = FriendList::findFriend(friendWidget->friendId);
|
Friend* f = FriendList::findFriend(friendWidget->friendId);
|
||||||
listWidget->moveWidget(friendWidget, f->getStatus(), false);
|
listWidget->moveWidget(friendWidget, f->getStatus(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
int count = activityLayout ? activityLayout->count() : 0;
|
int count = activityLayout ? activityLayout->count() : 0;
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
QWidget *widget = activityLayout->itemAt(i)->widget();
|
QWidget* widget = activityLayout->itemAt(i)->widget();
|
||||||
CategoryWidget *categoryWidget = qobject_cast<CategoryWidget*>(widget);
|
CategoryWidget *categoryWidget = qobject_cast<CategoryWidget*>(widget);
|
||||||
if (categoryWidget)
|
if (categoryWidget)
|
||||||
{
|
{
|
||||||
|
@ -332,11 +332,11 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendListWidget::moveFriends(QLayout *layout)
|
void FriendListWidget::moveFriends(QLayout* layout)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < layout->count(); i++)
|
for (int i = 0; i < layout->count(); i++)
|
||||||
{
|
{
|
||||||
QWidget *widget = layout->itemAt(i)->widget();
|
QWidget* widget = layout->itemAt(i)->widget();
|
||||||
FriendWidget *friendWidget = qobject_cast<FriendWidget*>(widget);
|
FriendWidget *friendWidget = qobject_cast<FriendWidget*>(widget);
|
||||||
CircleWidget *circleWidget = qobject_cast<CircleWidget*>(widget);
|
CircleWidget *circleWidget = qobject_cast<CircleWidget*>(widget);
|
||||||
if (circleWidget)
|
if (circleWidget)
|
||||||
|
@ -350,7 +350,7 @@ void FriendListWidget::moveFriends(QLayout *layout)
|
||||||
QDate activityDate = getDateFriend(contact);
|
QDate activityDate = getDateFriend(contact);
|
||||||
Time time = getTime(activityDate);
|
Time time = getTime(activityDate);
|
||||||
|
|
||||||
QWidget *w = activityLayout->itemAt(time)->widget();
|
QWidget* w = activityLayout->itemAt(time)->widget();
|
||||||
CategoryWidget* categoryWidget = qobject_cast<CategoryWidget*>(w);
|
CategoryWidget* categoryWidget = qobject_cast<CategoryWidget*>(w);
|
||||||
categoryWidget->addFriendWidget(friendWidget, contact->getStatus());
|
categoryWidget->addFriendWidget(friendWidget, contact->getStatus());
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ void FriendListWidget::addCircleWidget(FriendWidget* friendWidget)
|
||||||
{
|
{
|
||||||
if (friendWidget != nullptr)
|
if (friendWidget != nullptr)
|
||||||
{
|
{
|
||||||
Friend *f = FriendList::findFriend(friendWidget->friendId);
|
Friend* f = FriendList::findFriend(friendWidget->friendId);
|
||||||
ToxPk toxPk = f->getPublicKey();
|
ToxPk toxPk = f->getPublicKey();
|
||||||
int circleId = Settings::getInstance().getFriendCircleID(toxPk);
|
int circleId = Settings::getInstance().getFriendCircleID(toxPk);
|
||||||
CircleWidget* circleOriginal = CircleWidget::getFromID(circleId);
|
CircleWidget* circleOriginal = CircleWidget::getFromID(circleId);
|
||||||
|
@ -640,7 +640,7 @@ void FriendListWidget::cycleContacts(GenericChatroomWidget* activeChatroomWidget
|
||||||
void FriendListWidget::dragEnterEvent(QDragEnterEvent* event)
|
void FriendListWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
ToxId toxId(event->mimeData()->text());
|
ToxId toxId(event->mimeData()->text());
|
||||||
Friend *frnd = FriendList::findFriend(toxId.getPublicKey());
|
Friend* frnd = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (frnd)
|
if (frnd)
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
}
|
||||||
|
@ -655,7 +655,7 @@ void FriendListWidget::dropEvent(QDropEvent* event)
|
||||||
|
|
||||||
// Check, that the user has a friend with the same ToxId
|
// Check, that the user has a friend with the same ToxId
|
||||||
ToxId toxId(event->mimeData()->text());
|
ToxId toxId(event->mimeData()->text());
|
||||||
Friend *f = FriendList::findFriend(toxId.getPublicKey());
|
Friend* f = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (!f)
|
if (!f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ void FriendListWidget::moveWidget(FriendWidget* widget, Status s, bool add)
|
||||||
{
|
{
|
||||||
if (mode == Name)
|
if (mode == Name)
|
||||||
{
|
{
|
||||||
Friend *f = FriendList::findFriend(widget->friendId);
|
Friend* f = FriendList::findFriend(widget->friendId);
|
||||||
int circleId = Settings::getInstance().getFriendCircleID(f->getPublicKey());
|
int circleId = Settings::getInstance().getFriendCircleID(f->getPublicKey());
|
||||||
CircleWidget* circleWidget = CircleWidget::getFromID(circleId);
|
CircleWidget* circleWidget = CircleWidget::getFromID(circleId);
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ void FriendListWidget::moveWidget(FriendWidget* widget, Status s, bool add)
|
||||||
Friend* contact = FriendList::findFriend(widget->friendId);
|
Friend* contact = FriendList::findFriend(widget->friendId);
|
||||||
QDate activityDate = getDateFriend(contact);
|
QDate activityDate = getDateFriend(contact);
|
||||||
Time time = getTime(activityDate);
|
Time time = getTime(activityDate);
|
||||||
QWidget *w = activityLayout->itemAt(time)->widget();
|
QWidget* w = activityLayout->itemAt(time)->widget();
|
||||||
CategoryWidget* categoryWidget = qobject_cast<CategoryWidget*>(w);
|
CategoryWidget* categoryWidget = qobject_cast<CategoryWidget*>(w);
|
||||||
categoryWidget->addFriendWidget(widget, contact->getStatus());
|
categoryWidget->addFriendWidget(widget, contact->getStatus());
|
||||||
categoryWidget->show();
|
categoryWidget->show();
|
||||||
|
|
|
@ -81,7 +81,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
CircleWidget* createCircleWidget(int id = -1);
|
CircleWidget* createCircleWidget(int id = -1);
|
||||||
QLayout* nextLayout(QLayout* layout, bool forward) const;
|
QLayout* nextLayout(QLayout* layout, bool forward) const;
|
||||||
void moveFriends(QLayout *layout);
|
void moveFriends(QLayout* layout);
|
||||||
|
|
||||||
Mode mode;
|
Mode mode;
|
||||||
bool groupsOnTop;
|
bool groupsOnTop;
|
||||||
|
|
|
@ -77,7 +77,7 @@ FriendWidget::FriendWidget(int FriendId, QString id)
|
||||||
* Default context menu event handler.
|
* Default context menu event handler.
|
||||||
* Redirect all event information to the signal.
|
* Redirect all event information to the signal.
|
||||||
*/
|
*/
|
||||||
void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
void FriendWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||||
{
|
{
|
||||||
emit contextMenuCalled(event);
|
emit contextMenuCalled(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class FriendWidget : public GenericChatroomWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
FriendWidget(int FriendId, QString id);
|
FriendWidget(int FriendId, QString id);
|
||||||
virtual void contextMenuEvent(QContextMenuEvent * event) override;
|
virtual void contextMenuEvent(QContextMenuEvent* event) override;
|
||||||
virtual void setAsActiveChatroom() override;
|
virtual void setAsActiveChatroom() override;
|
||||||
virtual void setAsInactiveChatroom() override;
|
virtual void setAsInactiveChatroom() override;
|
||||||
virtual void updateStatusLight() override;
|
virtual void updateStatusLight() override;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "src/widget/tool/croppinglabel.h"
|
#include "src/widget/tool/croppinglabel.h"
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
GenericChatItemWidget::GenericChatItemWidget(QWidget *parent)
|
GenericChatItemWidget::GenericChatItemWidget(QWidget* parent)
|
||||||
: QFrame(parent), compact(false)
|
: QFrame(parent), compact(false)
|
||||||
{
|
{
|
||||||
setProperty("compact", Settings::getInstance().getCompactLayout());
|
setProperty("compact", Settings::getInstance().getCompactLayout());
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
FriendOnlineItem
|
FriendOnlineItem
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit GenericChatItemWidget(QWidget *parent = 0);
|
explicit GenericChatItemWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
bool isCompact() const;
|
bool isCompact() const;
|
||||||
void setCompact(bool compact);
|
void setCompact(bool compact);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
GenericChatroomWidget::GenericChatroomWidget(QWidget *parent)
|
GenericChatroomWidget::GenericChatroomWidget(QWidget* parent)
|
||||||
: GenericChatItemWidget(parent), active{false}
|
: GenericChatItemWidget(parent), active{false}
|
||||||
{
|
{
|
||||||
// avatar
|
// avatar
|
||||||
|
|
|
@ -34,7 +34,7 @@ class GenericChatroomWidget : public GenericChatItemWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit GenericChatroomWidget(QWidget *parent = 0);
|
explicit GenericChatroomWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
virtual void setAsActiveChatroom() = 0;
|
virtual void setAsActiveChatroom() = 0;
|
||||||
virtual void setAsInactiveChatroom() = 0;
|
virtual void setAsInactiveChatroom() = 0;
|
||||||
|
|
|
@ -236,7 +236,7 @@ void GroupWidget::resetEventFlags()
|
||||||
void GroupWidget::dragEnterEvent(QDragEnterEvent *ev)
|
void GroupWidget::dragEnterEvent(QDragEnterEvent *ev)
|
||||||
{
|
{
|
||||||
ToxId toxId = ToxId(ev->mimeData()->text());
|
ToxId toxId = ToxId(ev->mimeData()->text());
|
||||||
Friend *frnd = FriendList::findFriend(toxId.getPublicKey());
|
Friend* frnd = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (frnd)
|
if (frnd)
|
||||||
ev->acceptProposedAction();
|
ev->acceptProposedAction();
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ void GroupWidget::dragLeaveEvent(QDragLeaveEvent *)
|
||||||
void GroupWidget::dropEvent(QDropEvent *ev)
|
void GroupWidget::dropEvent(QDropEvent *ev)
|
||||||
{
|
{
|
||||||
ToxId toxId = ToxId(ev->mimeData()->text());
|
ToxId toxId = ToxId(ev->mimeData()->text());
|
||||||
Friend *frnd = FriendList::findFriend(toxId.getPublicKey());
|
Friend* frnd = FriendList::findFriend(toxId.getPublicKey());
|
||||||
if (!frnd)
|
if (!frnd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -274,11 +274,10 @@ bool GUI::askQuestion(const QString& title, const QString& msg,
|
||||||
* @param hints Is the input method hints that will be used if the combobox is editable and an input method is active.
|
* @param hints Is the input method hints that will be used if the combobox is editable and an input method is active.
|
||||||
* @return This function returns the text of the current item, or if editable is true, the current text of the combobox.
|
* @return This function returns the text of the current item, or if editable is true, the current text of the combobox.
|
||||||
*/
|
*/
|
||||||
QString GUI::itemInputDialog(QWidget * parent, const QString & title,
|
QString GUI::itemInputDialog(QWidget* parent, const QString& title,
|
||||||
const QString & label, const QStringList & items,
|
const QString& label, const QStringList& items,
|
||||||
int current, bool editable, bool * ok,
|
int current, bool editable, bool* ok,
|
||||||
Qt::WindowFlags flags,
|
Qt::WindowFlags flags, Qt::InputMethodHints hints)
|
||||||
Qt::InputMethodHints hints)
|
|
||||||
{
|
{
|
||||||
if (QThread::currentThread() == qApp->thread())
|
if (QThread::currentThread() == qApp->thread())
|
||||||
{
|
{
|
||||||
|
@ -395,11 +394,10 @@ bool GUI::_askQuestion(const QString& title, const QString& msg,
|
||||||
return box.clickedButton() == pushButton1;
|
return box.clickedButton() == pushButton1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GUI::_itemInputDialog(QWidget * parent, const QString & title,
|
QString GUI::_itemInputDialog(QWidget* parent, const QString& title,
|
||||||
const QString & label, const QStringList & items,
|
const QString& label, const QStringList& items,
|
||||||
int current, bool editable, bool * ok,
|
int current, bool editable, bool* ok,
|
||||||
Qt::WindowFlags flags,
|
Qt::WindowFlags flags, Qt::InputMethodHints hints)
|
||||||
Qt::InputMethodHints hints)
|
|
||||||
{
|
{
|
||||||
return QInputDialog::getItem(parent, title, label, items, current, editable, ok, flags, hints);
|
return QInputDialog::getItem(parent, title, label, items, current, editable, ok, flags, hints);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,9 @@ public:
|
||||||
const QString& button1, const QString& button2,
|
const QString& button1, const QString& button2,
|
||||||
bool defaultAns = false, bool warning = true);
|
bool defaultAns = false, bool warning = true);
|
||||||
|
|
||||||
static QString itemInputDialog(QWidget * parent, const QString & title,
|
static QString itemInputDialog(QWidget* parent, const QString& title,
|
||||||
const QString & label, const QStringList & items,
|
const QString& label, const QStringList& items,
|
||||||
int current = 0, bool editable = true, bool * ok = 0,
|
int current = 0, bool editable = true, bool* ok = 0,
|
||||||
Qt::WindowFlags flags = 0,
|
Qt::WindowFlags flags = 0,
|
||||||
Qt::InputMethodHints hints = Qt::ImhNone);
|
Qt::InputMethodHints hints = Qt::ImhNone);
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ private slots:
|
||||||
bool _askQuestion(const QString& title, const QString& msg,
|
bool _askQuestion(const QString& title, const QString& msg,
|
||||||
const QString& button1, const QString& button2,
|
const QString& button1, const QString& button2,
|
||||||
bool defaultAns = false, bool warning = true);
|
bool defaultAns = false, bool warning = true);
|
||||||
QString _itemInputDialog(QWidget * parent, const QString & title,
|
QString _itemInputDialog(QWidget* parent, const QString& title,
|
||||||
const QString & label, const QStringList & items,
|
const QString& label, const QStringList& items,
|
||||||
int current = 0, bool editable = true, bool * ok = 0,
|
int current = 0, bool editable = true, bool* ok = 0,
|
||||||
Qt::WindowFlags flags = 0,
|
Qt::WindowFlags flags = 0,
|
||||||
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
|
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
|
||||||
QString _passwordDialog(const QString& cancel, const QString& body);
|
QString _passwordDialog(const QString& cancel, const QString& body);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
LoginScreen::LoginScreen(QWidget *parent) :
|
LoginScreen::LoginScreen(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::LoginScreen),
|
ui(new Ui::LoginScreen),
|
||||||
quitShortcut{QKeySequence(Qt::CTRL + Qt::Key_Q), this}
|
quitShortcut{QKeySequence(Qt::CTRL + Qt::Key_Q), this}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class LoginScreen : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LoginScreen(QWidget *parent = 0);
|
explicit LoginScreen(QWidget* parent = 0);
|
||||||
~LoginScreen();
|
~LoginScreen();
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
* @brief pointer to dynamically call the constructor.
|
* @brief pointer to dynamically call the constructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName)
|
MaskablePixmapWidget::MaskablePixmapWidget(QWidget* parent, QSize size, QString maskName)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, renderTarget(nullptr)
|
, renderTarget(nullptr)
|
||||||
, maskName(maskName)
|
, maskName(maskName)
|
||||||
|
|
|
@ -26,7 +26,7 @@ class MaskablePixmapWidget final : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName = QString());
|
MaskablePixmapWidget(QWidget* parent, QSize size, QString maskName = QString());
|
||||||
~MaskablePixmapWidget();
|
~MaskablePixmapWidget();
|
||||||
void autopickBackground();
|
void autopickBackground();
|
||||||
void setClickable(bool clickable);
|
void setClickable(bool clickable);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
NotificationEdgeWidget::NotificationEdgeWidget(Position position, QWidget *parent)
|
NotificationEdgeWidget::NotificationEdgeWidget(Position position, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_StyledBackground); // Show background.
|
setAttribute(Qt::WA_StyledBackground); // Show background.
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
Bottom
|
Bottom
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit NotificationEdgeWidget(Position position, QWidget *parent = 0);
|
explicit NotificationEdgeWidget(Position position, QWidget* parent = 0);
|
||||||
void updateNotificationCount(int count);
|
void updateNotificationCount(int count);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -195,7 +195,7 @@ void NotificationScrollArea::findPreviousWidget()
|
||||||
ensureWidgetVisible(next, 0, referencesAbove != 1 ? topEdge->height() : 0);
|
ensureWidgetVisible(next, 0, referencesAbove != 1 ? topEdge->height() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationScrollArea::Visibility NotificationScrollArea::widgetVisible(QWidget *widget) const
|
NotificationScrollArea::Visibility NotificationScrollArea::widgetVisible(QWidget* widget) const
|
||||||
{
|
{
|
||||||
int y = widget->mapTo(viewport(), QPoint()).y();
|
int y = widget->mapTo(viewport(), QPoint()).y();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ class PasswordEdit : public QLineEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PasswordEdit(QWidget *parent);
|
explicit PasswordEdit(QWidget* parent);
|
||||||
~PasswordEdit();
|
~PasswordEdit();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
* @link https://stackoverflow.com/questions/21400254/how-to-draw-a-qr-code-with-qt-in-native-c-c
|
* @link https://stackoverflow.com/questions/21400254/how-to-draw-a-qr-code-with-qt-in-native-c-c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QRWidget::QRWidget(QWidget *parent) : QWidget(parent), data("0")
|
QRWidget::QRWidget(QWidget* parent) : QWidget(parent), data("0")
|
||||||
//Note: The encoding fails with empty string so I just default to something else.
|
//Note: The encoding fails with empty string so I just default to something else.
|
||||||
//Use the setQRData() call to change this.
|
//Use the setQRData() call to change this.
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ class QRWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QRWidget(QWidget *parent = 0);
|
explicit QRWidget(QWidget* parent = 0);
|
||||||
~QRWidget();
|
~QRWidget();
|
||||||
void setQRData(const QString& data);
|
void setQRData(const QString& data);
|
||||||
QImage* getImage();
|
QImage* getImage();
|
||||||
|
|
|
@ -182,7 +182,7 @@ QString Style::resolve(QString qss, const QFont& baseFont)
|
||||||
return qss;
|
return qss;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Style::repolish(QWidget *w)
|
void Style::repolish(QWidget* w)
|
||||||
{
|
{
|
||||||
w->style()->unpolish(w);
|
w->style()->unpolish(w);
|
||||||
w->style()->polish(w);
|
w->style()->polish(w);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "activatedialog.h"
|
#include "activatedialog.h"
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
|
||||||
ActivateDialog::ActivateDialog(QWidget *parent, Qt::WindowFlags f)
|
ActivateDialog::ActivateDialog(QWidget* parent, Qt::WindowFlags f)
|
||||||
: QDialog(parent, f)
|
: QDialog(parent, f)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
AdjustingScrollArea::AdjustingScrollArea(QWidget *parent)
|
AdjustingScrollArea::AdjustingScrollArea(QWidget* parent)
|
||||||
: QScrollArea(parent)
|
: QScrollArea(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class AdjustingScrollArea : public QScrollArea
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AdjustingScrollArea(QWidget *parent = 0);
|
explicit AdjustingScrollArea(QWidget* parent = 0);
|
||||||
virtual ~AdjustingScrollArea() = default;
|
virtual ~AdjustingScrollArea() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
* @brief Used to correct the rounding factors on non-square rects
|
* @brief Used to correct the rounding factors on non-square rects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CallConfirmWidget::CallConfirmWidget(const QWidget *Anchor, const Friend& f) :
|
CallConfirmWidget::CallConfirmWidget(const QWidget* Anchor, const Friend& f) :
|
||||||
QWidget(), anchor(Anchor), f(f),
|
QWidget(), anchor(Anchor), f(f),
|
||||||
rectW{120}, rectH{85},
|
rectW{120}, rectH{85},
|
||||||
spikeW{30}, spikeH{15},
|
spikeW{30}, spikeH{15},
|
||||||
|
|
|
@ -34,7 +34,7 @@ class CallConfirmWidget final : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CallConfirmWidget(const QWidget *Anchor, const Friend& f);
|
explicit CallConfirmWidget(const QWidget* Anchor, const Friend& f);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void accepted();
|
void accepted();
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
ChatTextEdit::ChatTextEdit(QWidget *parent) :
|
ChatTextEdit::ChatTextEdit(QWidget* parent) :
|
||||||
QTextEdit(parent)
|
QTextEdit(parent)
|
||||||
{
|
{
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ChatTextEdit final : public QTextEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ChatTextEdit(QWidget *parent = 0);
|
explicit ChatTextEdit(QWidget* parent = 0);
|
||||||
~ChatTextEdit();
|
~ChatTextEdit();
|
||||||
void setLastMessage(QString lm);
|
void setLastMessage(QString lm);
|
||||||
void sendKeyEvent(QKeyEvent * event);
|
void sendKeyEvent(QKeyEvent * event);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
FlyoutOverlayWidget::FlyoutOverlayWidget(QWidget *parent)
|
FlyoutOverlayWidget::FlyoutOverlayWidget(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
|
@ -30,7 +30,7 @@ class FlyoutOverlayWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(qreal flyoutPercent READ flyoutPercent WRITE setFlyoutPercent)
|
Q_PROPERTY(qreal flyoutPercent READ flyoutPercent WRITE setFlyoutPercent)
|
||||||
public:
|
public:
|
||||||
explicit FlyoutOverlayWidget(QWidget *parent = 0);
|
explicit FlyoutOverlayWidget(QWidget* parent = 0);
|
||||||
~FlyoutOverlayWidget();
|
~FlyoutOverlayWidget();
|
||||||
|
|
||||||
int animationDuration() const;
|
int animationDuration() const;
|
||||||
|
@ -55,7 +55,7 @@ private:
|
||||||
void finishedAnimation();
|
void finishedAnimation();
|
||||||
void startAnimation(bool forward);
|
void startAnimation(bool forward);
|
||||||
|
|
||||||
QWidget *container;
|
QWidget* container;
|
||||||
QPropertyAnimation *animation;
|
QPropertyAnimation *animation;
|
||||||
qreal percent = 1.0f;
|
qreal percent = 1.0f;
|
||||||
QPoint startPos;
|
QPoint startPos;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
FriendRequestDialog::FriendRequestDialog(QWidget *parent, const QString &userId, const QString &message) :
|
FriendRequestDialog::FriendRequestDialog(QWidget* parent, const QString &userId, const QString &message) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_QuitOnClose, false);
|
setAttribute(Qt::WA_QuitOnClose, false);
|
||||||
|
|
|
@ -26,7 +26,7 @@ class FriendRequestDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit FriendRequestDialog(QWidget *parent, const QString &userId, const QString &message);
|
explicit FriendRequestDialog(QWidget* parent, const QString &userId, const QString &message);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FRIENDREQUESTDIALOG_HPP
|
#endif // FRIENDREQUESTDIALOG_HPP
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QLinearGradient>
|
#include <QLinearGradient>
|
||||||
|
|
||||||
MicFeedbackWidget::MicFeedbackWidget(QWidget *parent)
|
MicFeedbackWidget::MicFeedbackWidget(QWidget* parent)
|
||||||
: QWidget(parent), mMeterListener(nullptr)
|
: QWidget(parent), mMeterListener(nullptr)
|
||||||
{
|
{
|
||||||
setFixedHeight(20);
|
setFixedHeight(20);
|
||||||
|
|
|
@ -28,7 +28,7 @@ class MicFeedbackWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit MicFeedbackWidget(QWidget *parent = 0);
|
explicit MicFeedbackWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent* event) override;
|
void paintEvent(QPaintEvent* event) override;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <QGraphicsOpacityEffect>
|
#include <QGraphicsOpacityEffect>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
MovableWidget::MovableWidget(QWidget *parent)
|
MovableWidget::MovableWidget(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
setMinimumHeight(64);
|
setMinimumHeight(64);
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
* to create dialog forms.
|
* to create dialog forms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ProfileImporter::ProfileImporter(QWidget *parent) : QWidget(parent)
|
ProfileImporter::ProfileImporter(QWidget* parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ProfileImporter : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ProfileImporter(QWidget *parent = 0);
|
explicit ProfileImporter(QWidget* parent = 0);
|
||||||
bool importProfile(const QString &path);
|
bool importProfile(const QString &path);
|
||||||
bool importProfile();
|
bool importProfile();
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
|
|
||||||
RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f)
|
RemoveFriendDialog::RemoveFriendDialog(QWidget* parent, const Friend* f)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
|
@ -11,7 +11,7 @@ class RemoveFriendDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit RemoveFriendDialog(QWidget *parent, const Friend* f);
|
explicit RemoveFriendDialog(QWidget* parent, const Friend* f);
|
||||||
|
|
||||||
inline bool removeHistory()
|
inline bool removeHistory()
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool toxActivateEventHandler(const QByteArray&)
|
||||||
|
|
||||||
Widget *Widget::instance{nullptr};
|
Widget *Widget::instance{nullptr};
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent)
|
Widget::Widget(QWidget* parent)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
icon{nullptr},
|
icon{nullptr},
|
||||||
trayMenu{nullptr},
|
trayMenu{nullptr},
|
||||||
|
@ -1252,7 +1252,7 @@ void Widget::onReceiptRecieved(int friendId, int receipt)
|
||||||
f->getChatForm()->getOfflineMsgEngine()->dischargeReceipt(receipt);
|
f->getChatForm()->getOfflineMsgEngine()->dischargeReceipt(receipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::addFriendDialog(Friend *frnd, ContentDialog *dialog)
|
void Widget::addFriendDialog(Friend* frnd, ContentDialog *dialog)
|
||||||
{
|
{
|
||||||
ContentDialog *contentDialog = ContentDialog::getFriendDialog(frnd->getFriendId());
|
ContentDialog *contentDialog = ContentDialog::getFriendDialog(frnd->getFriendId());
|
||||||
bool isSeparate = Settings::getInstance().getSeparateWindow();
|
bool isSeparate = Settings::getInstance().getSeparateWindow();
|
||||||
|
@ -1510,7 +1510,7 @@ void Widget::onFriendRequestReceived(const ToxPk& friendPk, const QString& messa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::updateFriendActivity(Friend *frnd)
|
void Widget::updateFriendActivity(Friend* frnd)
|
||||||
{
|
{
|
||||||
const ToxPk &pk = frnd->getPublicKey();
|
const ToxPk &pk = frnd->getPublicKey();
|
||||||
QDate date = Settings::getInstance().getFriendActivity(pk);
|
QDate date = Settings::getInstance().getFriendActivity(pk);
|
||||||
|
@ -2209,7 +2209,7 @@ void Widget::processOfflineMsgs()
|
||||||
if (OfflineMsgEngine::globalMutex.tryLock())
|
if (OfflineMsgEngine::globalMutex.tryLock())
|
||||||
{
|
{
|
||||||
QList<Friend*> frnds = FriendList::getAllFriends();
|
QList<Friend*> frnds = FriendList::getAllFriends();
|
||||||
for (Friend *f : frnds)
|
for (Friend* f : frnds)
|
||||||
{
|
{
|
||||||
f->getChatForm()->getOfflineMsgEngine()->deliverOfflineMsgs();
|
f->getChatForm()->getOfflineMsgEngine()->deliverOfflineMsgs();
|
||||||
}
|
}
|
||||||
|
@ -2221,7 +2221,7 @@ void Widget::processOfflineMsgs()
|
||||||
void Widget::clearAllReceipts()
|
void Widget::clearAllReceipts()
|
||||||
{
|
{
|
||||||
QList<Friend*> frnds = FriendList::getAllFriends();
|
QList<Friend*> frnds = FriendList::getAllFriends();
|
||||||
for (Friend *f : frnds)
|
for (Friend* f : frnds)
|
||||||
{
|
{
|
||||||
f->getChatForm()->getOfflineMsgEngine()->removeAllReceipts();
|
f->getChatForm()->getOfflineMsgEngine()->removeAllReceipts();
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,10 +65,10 @@ class Widget final : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Widget(QWidget *parent = 0);
|
explicit Widget(QWidget* parent = 0);
|
||||||
~Widget();
|
~Widget();
|
||||||
void init();
|
void init();
|
||||||
void setCentralWidget(QWidget *widget, const QString &widgetName);
|
void setCentralWidget(QWidget* widget, const QString &widgetName);
|
||||||
QString getUsername();
|
QString getUsername();
|
||||||
Camera* getCamera();
|
Camera* getCamera();
|
||||||
static Widget* getInstance();
|
static Widget* getInstance();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user