From 74ff9055829be0ab5828f400a87e61c54f433289 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 21 Apr 2018 17:21:44 +0300 Subject: [PATCH] Clean up Top Bar --- include/TopRoomBar.h | 5 ----- src/TopRoomBar.cc | 20 -------------------- 2 files changed, 25 deletions(-) diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index 0df31ee8..12fd0645 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -31,7 +31,6 @@ class FlatButton; class Label; class Menu; class OverlayModal; -class RoomSettings; class TopRoomBar : public QWidget { @@ -47,7 +46,6 @@ public: void updateRoomName(const QString &name); void updateRoomTopic(QString topic); void updateRoomAvatarFromName(const QString &name); - void setRoomSettings(QSharedPointer settings); void reset(); @@ -68,10 +66,7 @@ private: QLabel *nameLabel_; Label *topicLabel_; - QSharedPointer roomSettings_; - QMenu *menu_; - QAction *toggleNotifications_; QAction *leaveRoom_; QAction *inviteUsers_; diff --git a/src/TopRoomBar.cc b/src/TopRoomBar.cc index 73891881..6caf2edb 100644 --- a/src/TopRoomBar.cc +++ b/src/TopRoomBar.cc @@ -85,11 +85,6 @@ TopRoomBar::TopRoomBar(QWidget *parent) menu_ = new Menu(this); - toggleNotifications_ = new QAction(tr("Disable notifications"), this); - connect(toggleNotifications_, &QAction::triggered, this, [this]() { - roomSettings_->toggleNotifications(); - }); - inviteUsers_ = new QAction(tr("Invite users"), this); connect(inviteUsers_, &QAction::triggered, this, [this]() { MainWindow::instance()->openInviteUsersDialog( @@ -101,19 +96,10 @@ TopRoomBar::TopRoomBar(QWidget *parent) MainWindow::instance()->openLeaveRoomDialog(); }); - menu_->addAction(toggleNotifications_); menu_->addAction(inviteUsers_); menu_->addAction(leaveRoom_); connect(settingsBtn_, &QPushButton::clicked, this, [this]() { - if (roomSettings_.isNull()) - return; - - if (roomSettings_->isNotificationsEnabled()) - toggleNotifications_->setText(tr("Disable notifications")); - else - toggleNotifications_->setText(tr("Enable notifications")); - auto pos = mapToGlobal(settingsBtn_->pos()); menu_->popup( QPoint(pos.x() + buttonSize_ - menu_->sizeHint().width(), pos.y() + buttonSize_)); @@ -182,12 +168,6 @@ TopRoomBar::mousePressEvent(QMouseEvent *event) } } -void -TopRoomBar::setRoomSettings(QSharedPointer settings) -{ - roomSettings_ = settings; -} - void TopRoomBar::updateRoomAvatar(const QImage &avatar_image) {