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

Rebase on master

This commit is contained in:
tux3 2015-06-10 01:42:51 +02:00
parent cc9edf6f90
commit 33a33ef051
9 changed files with 16 additions and 21 deletions

View File

@ -38,7 +38,7 @@ FORMS += \
CONFIG += c++11 CONFIG += c++11
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti QMAKE_CXXFLAGS += -fno-exceptions
# Rules for creating/updating {ts|qm}-files # Rules for creating/updating {ts|qm}-files
include(translations/i18n.pri) include(translations/i18n.pri)

View File

@ -1369,7 +1369,7 @@ QString Settings::getCircleName(int id) const
void Settings::setCircleName(int id, const QString &name) void Settings::setCircleName(int id, const QString &name)
{ {
circleLst[id].name = name; circleLst[id].name = name;
save(); savePersonal();
} }
int Settings::addCircle(const QString &name) int Settings::addCircle(const QString &name)
@ -1390,7 +1390,7 @@ bool Settings::getCircleExpanded(int id) const
void Settings::setCircleExpanded(int id, bool expanded) void Settings::setCircleExpanded(int id, bool expanded)
{ {
circleLst[id].expanded = expanded; circleLst[id].expanded = expanded;
save(); savePersonal();
} }
int Settings::removeCircle(int id) int Settings::removeCircle(int id)

View File

@ -13,14 +13,14 @@
*/ */
#include "circlewidget.h" #include "circlewidget.h"
#include "src/misc/style.h" #include "src/widget/style.h"
#include "src/misc/settings.h" #include "src/persistence/settings.h"
#include "src/friendlist.h" #include "src/friendlist.h"
#include "src/friend.h" #include "src/friend.h"
#include "friendwidget.h" #include "friendwidget.h"
#include "friendlistlayout.h" #include "friendlistlayout.h"
#include "friendlistwidget.h" #include "friendlistwidget.h"
#include "croppinglabel.h" #include "src/widget/tool/croppinglabel.h"
#include "widget.h" #include "widget.h"
#include <QVariant> #include <QVariant>
#include <QLabel> #include <QLabel>

View File

@ -21,7 +21,7 @@
#include "friendlistlayout.h" #include "friendlistlayout.h"
#include "src/friend.h" #include "src/friend.h"
#include "src/friendlist.h" #include "src/friendlist.h"
#include "src/misc/settings.h" #include "src/persistence/settings.h"
#include "friendwidget.h" #include "friendwidget.h"
#include "groupwidget.h" #include "groupwidget.h"
#include "circlewidget.h" #include "circlewidget.h"
@ -123,7 +123,7 @@ void FriendListWidget::renameCircleWidget(const QString &newName)
{ {
assert(sender() != nullptr); assert(sender() != nullptr);
CircleWidget* circleWidget = dynamic_cast<CircleWidget*>(sender()); CircleWidget* circleWidget = static_cast<CircleWidget*>(sender());
assert(circleWidget != nullptr); assert(circleWidget != nullptr);
// Rename after removing so you can find it successfully. // Rename after removing so you can find it successfully.

View File

@ -13,9 +13,9 @@
*/ */
#include "genericchatitemwidget.h" #include "genericchatitemwidget.h"
#include "src/misc/style.h" #include "src/widget/style.h"
#include "src/misc/settings.h" #include "src/persistence/settings.h"
#include "croppinglabel.h" #include "src/widget/tool/croppinglabel.h"
#include <QVariant> #include <QVariant>
GenericChatItemWidget::GenericChatItemWidget(QWidget *parent) GenericChatItemWidget::GenericChatItemWidget(QWidget *parent)
@ -24,7 +24,6 @@ GenericChatItemWidget::GenericChatItemWidget(QWidget *parent)
setProperty("compact", Settings::getInstance().getCompactLayout()); setProperty("compact", Settings::getInstance().getCompactLayout());
nameLabel = new CroppingLabel(this); nameLabel = new CroppingLabel(this);
nameLabel->setObjectName("name");
nameLabel->setTextFormat(Qt::PlainText); nameLabel->setTextFormat(Qt::PlainText);
} }
@ -36,7 +35,6 @@ bool GenericChatItemWidget::isCompact() const
void GenericChatItemWidget::setCompact(bool compact) void GenericChatItemWidget::setCompact(bool compact)
{ {
this->compact = compact; this->compact = compact;
Style::repolish(this);
} }
QString GenericChatItemWidget::getName() const QString GenericChatItemWidget::getName() const

View File

@ -25,7 +25,7 @@
#include <QMouseEvent> #include <QMouseEvent>
GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) GenericChatroomWidget::GenericChatroomWidget(QWidget *parent)
: QFrame(parent), compact{Settings::getInstance().getCompactLayout()}, : GenericChatItemWidget(parent), compact{Settings::getInstance().getCompactLayout()},
active{false} active{false}
{ {
// avatar // avatar
@ -39,6 +39,9 @@ GenericChatroomWidget::GenericChatroomWidget(QWidget *parent)
statusMessageLabel->setTextFormat(Qt::PlainText); statusMessageLabel->setTextFormat(Qt::PlainText);
statusMessageLabel->setForegroundRole(QPalette::WindowText); statusMessageLabel->setForegroundRole(QPalette::WindowText);
nameLabel->setTextFormat(Qt::PlainText);
nameLabel->setForegroundRole(QPalette::WindowText);
setAutoFillBackground(true); setAutoFillBackground(true);
reloadTheme(); reloadTheme();
setCompact(compact); setCompact(compact);

View File

@ -31,12 +31,11 @@ namespace Ui {
class MainWindow; class MainWindow;
} }
class GenericChatroomWidget : public QFrame class GenericChatroomWidget : public GenericChatItemWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
GenericChatroomWidget(QWidget *parent = 0); GenericChatroomWidget(QWidget *parent = 0);
void mouseReleaseEvent (QMouseEvent* event);
virtual void setAsActiveChatroom(){;} virtual void setAsActiveChatroom(){;}
virtual void setAsInactiveChatroom(){;} virtual void setAsInactiveChatroom(){;}
@ -51,7 +50,6 @@ public:
void setName(const QString& name); void setName(const QString& name);
void setStatusMsg(const QString& status); void setStatusMsg(const QString& status);
QString getName() const;
QString getStatusMsg() const; QString getStatusMsg() const;
void reloadTheme(); void reloadTheme();
@ -60,7 +58,6 @@ public:
public slots: public slots:
void setCompact(bool compact); void setCompact(bool compact);
void onCompactChanged(bool compact);
signals: signals:
void chatroomWidgetClicked(GenericChatroomWidget* widget); void chatroomWidgetClicked(GenericChatroomWidget* widget);

View File

@ -48,8 +48,6 @@ protected:
virtual void dragEnterEvent(QDragEnterEvent* ev) override; virtual void dragEnterEvent(QDragEnterEvent* ev) override;
virtual void dragLeaveEvent(QDragLeaveEvent* ev); virtual void dragLeaveEvent(QDragLeaveEvent* ev);
virtual void dropEvent(QDropEvent* ev) override; virtual void dropEvent(QDropEvent* ev) override;
virtual void keyPressEvent(QKeyEvent* ev);
virtual void keyReleaseEvent(QKeyEvent* ev);
public: public:
int groupId; int groupId;

View File

@ -51,7 +51,6 @@ protected:
virtual QSize sizeHint() const final override; virtual QSize sizeHint() const final override;
virtual QSize minimumSizeHint() const final override; virtual QSize minimumSizeHint() const final override;
virtual void mouseReleaseEvent(QMouseEvent *e) final override; virtual void mouseReleaseEvent(QMouseEvent *e) final override;
virtual bool eventFilter(QObject *obj, QEvent *e) final override;
private slots: private slots:
void finishTextEdit(); void finishTextEdit();