From c1c5e5da5f72d582577200a601a92919d2acb7ea Mon Sep 17 00:00:00 2001 From: Camila San Date: Mon, 13 Aug 2018 14:09:14 +0200 Subject: [PATCH] Fixes #533: Removes the copy activities/notifications button - Also removes the signal/slot associated with it. - Minor changes: removes white background and changes frame style to the same used in the accountsettings for consistency. Signed-off-by: Camila San --- src/gui/activitywidget.cpp | 37 ++++--------------- src/gui/activitywidget.h | 2 - src/gui/activitywidget.ui | 75 ++++++++++++++------------------------ 3 files changed, 35 insertions(+), 79 deletions(-) diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index 687a6703c..cd50dd7dd 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -67,7 +67,6 @@ ActivityWidget::ActivityWidget(AccountState *accountState, QWidget *parent) ActivityItemDelegate *delegate = new ActivityItemDelegate; delegate->setParent(this); _ui->_activityList->setItemDelegate(delegate); - _ui->_activityList->setBackgroundRole(QPalette::Background); _ui->_activityList->setAlternatingRowColors(true); _ui->_activityList->setModel(_model); @@ -76,9 +75,6 @@ ActivityWidget::ActivityWidget(AccountState *accountState, QWidget *parent) connect(_model, &ActivityListModel::activityJobStatusCode, this, &ActivityWidget::slotAccountActivityStatus); - _ui->_copyButton->setToolTip(tr("Copy the activity list to the clipboard.")); - connect(_ui->_copyButton, &QPushButton::click, this, &ActivityWidget::copyToClipboard); - connect(_model, &QAbstractItemModel::rowsInserted, this, &ActivityWidget::rowsInserted); connect(delegate, &ActivityItemDelegate::primaryButtonClickedOnItemView, this, &ActivityWidget::slotPrimaryButtonClickedOnListView); @@ -324,14 +320,17 @@ void ActivityWidget::slotRemoveAccount() void ActivityWidget::showLabels() { - QString t = tr("Server Activities"); - t.clear(); + _ui->_bottomLabel->hide(); // hide whatever was there before + QString t(""); QSetIterator i(_accountsWithoutActivities); while (i.hasNext()) { t.append(tr("
Account %1 does not have activities enabled.").arg(i.next())); } - _ui->_bottomLabel->setTextFormat(Qt::RichText); - _ui->_bottomLabel->setText(t); + if(!t.isEmpty()){ + _ui->_bottomLabel->setTextFormat(Qt::RichText); + _ui->_bottomLabel->setText(t); + _ui->_bottomLabel->show(); + } } void ActivityWidget::slotAccountActivityStatus(int statusCode) @@ -546,14 +545,7 @@ ActivitySettings::ActivitySettings(AccountState *accountState, QWidget *parent) _activityWidget = new ActivityWidget(_accountState, this); - // set background white - QPalette palette; - palette.setColor(QPalette::Background, Qt::white); - _activityWidget->setAutoFillBackground(true); - _activityWidget->setPalette(palette); - _vbox->insertWidget(1, _activityWidget); - connect(_activityWidget, &ActivityWidget::copyToClipboard, this, &ActivitySettings::slotCopyToClipboard); connect(_activityWidget, &ActivityWidget::guiLog, this, &ActivitySettings::guiLog); connect(&_notificationCheckTimer, &QTimer::timeout, this, &ActivitySettings::slotRegularNotificationCheck); @@ -576,21 +568,6 @@ void ActivitySettings::setNotificationRefreshInterval(std::chrono::milliseconds _notificationCheckTimer.start(interval.count()); } -void ActivitySettings::slotCopyToClipboard() -{ - QString text; - QTextStream ts(&text); - - QString message; - - _activityWidget->storeActivityList(ts); - message = tr("The server activity and notifications list has been copied to the clipboard."); - - QApplication::clipboard()->setText(text); - - emit guiLog(tr("Copied to clipboard"), message); -} - void ActivitySettings::slotRemoveAccount() { _activityWidget->slotRemoveAccount(); diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h index 8b74a565e..11da1ad6c 100644 --- a/src/gui/activitywidget.h +++ b/src/gui/activitywidget.h @@ -81,7 +81,6 @@ public slots: signals: void guiLog(const QString &, const QString &); - void copyToClipboard(); void rowsInserted(); void hideActivityTab(bool); void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row); @@ -140,7 +139,6 @@ public slots: void setNotificationRefreshInterval(std::chrono::milliseconds interval); private slots: - void slotCopyToClipboard(); void slotRegularNotificationCheck(); void slotDisplayActivities(); diff --git a/src/gui/activitywidget.ui b/src/gui/activitywidget.ui index b6aa092ef..7eec58fe3 100644 --- a/src/gui/activitywidget.ui +++ b/src/gui/activitywidget.ui @@ -6,7 +6,7 @@ 0 0 - 693 + 652 556 @@ -77,8 +77,11 @@ Form - - + + + QLayout::SetDefaultConstraint + + @@ -92,18 +95,18 @@ - 255 - 255 - 255 + 252 + 252 + 252 - 255 - 255 - 255 + 252 + 252 + 252 @@ -112,18 +115,18 @@ - 255 - 255 - 255 + 252 + 252 + 252 - 255 - 255 - 255 + 252 + 252 + 252 @@ -132,18 +135,18 @@ - 255 - 255 - 255 + 252 + 252 + 252 - 255 - 255 - 255 + 252 + 252 + 252 @@ -151,13 +154,13 @@ - QFrame::NoFrame + QFrame::StyledPanel - QFrame::Plain + QFrame::Sunken - 0 + 1 QAbstractScrollArea::AdjustToContents @@ -185,7 +188,7 @@ - + @@ -201,28 +204,6 @@ - - - - - 0 - 0 - - - - - 120 - 30 - - - - margin-left:40px; - - - Copy - - -