mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
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 <hello@camila.codes>
This commit is contained in:
parent
f0ef2c27a3
commit
c1c5e5da5f
3 changed files with 35 additions and 79 deletions
|
@ -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<QString> i(_accountsWithoutActivities);
|
||||
while (i.hasNext()) {
|
||||
t.append(tr("<br/>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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>693</width>
|
||||
<width>652</width>
|
||||
<height>556</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -77,8 +77,11 @@
|
|||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="_activityList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
|
@ -92,18 +95,18 @@
|
|||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
|
@ -112,18 +115,18 @@
|
|||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
|
@ -132,18 +135,18 @@
|
|||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
<red>252</red>
|
||||
<green>252</green>
|
||||
<blue>252</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
|
@ -151,13 +154,13 @@
|
|||
</palette>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
|
@ -185,7 +188,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item>
|
||||
<widget class="QLabel" name="_bottomLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
|
@ -201,28 +204,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="_copyButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">margin-left:40px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
|
|
Loading…
Reference in a new issue