Skip to content

Commit

Permalink
Merge branch 'master' into pr/607
Browse files Browse the repository at this point in the history
  • Loading branch information
Camila Ayres authored Jul 22, 2019
2 parents 4801bd5 + 4559965 commit 5d30f4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
21 changes: 11 additions & 10 deletions src/gui/shareusergroupwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
s->setBackgroundRole(layout->count() % 2 == 0 ? QPalette::Base : QPalette::AlternateBase);
layout->addWidget(s);
s->setVisible(true);

x++;
if (x <= 3) {
Expand Down Expand Up @@ -389,6 +388,15 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
menu->addAction(_permissionReshare);
connect(_permissionReshare, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);

menu->addSeparator();

// Adds action to delete share widget
QIcon deleteicon = QIcon::fromTheme(QLatin1String("user-trash"),QIcon(QLatin1String(":/client/resources/delete.png")));
_deleteShareButton= new QAction(deleteicon,tr("Unshare"), this);

menu->addAction(_deleteShareButton);
connect(_deleteShareButton, &QAction::triggered, this, &ShareUserLine::on_deleteShareButton_clicked);

/*
* Files can't have create or delete permissions
*/
Expand Down Expand Up @@ -435,20 +443,13 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
connect(share.data(), &Share::permissionsSet, this, &ShareUserLine::slotPermissionsSet);
connect(share.data(), &Share::shareDeleted, this, &ShareUserLine::slotShareDeleted);

_ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
QIcon(QLatin1String(":/client/resources/delete.png"))));
// _ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
// QIcon(QLatin1String(":/client/resources/delete.png"))));

if (!share->account()->capabilities().shareResharing()) {
_permissionReshare->setVisible(false);
}

//If the initiator is not you. And the recipient is not you. Show it without any options.
if(share->account()->id() != share->getId() && share->account()->davUser() != share->getShareWith()->shareWith()){
_ui->permissionsEdit->hide();
_ui->permissionToolButton->hide();
_ui->deleteShareButton->hide();
}

loadAvatar();
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/shareusergroupwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private slots:

// _permissionEdit is a checkbox
QAction *_permissionReshare;
QAction *_deleteShareButton;
QAction *_permissionCreate;
QAction *_permissionChange;
QAction *_permissionDelete;
Expand Down
10 changes: 1 addition & 9 deletions src/gui/shareuserline.ui
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,7 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteShareButton">
<property name="icon">
<iconset theme="user-trash">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
</layout>
</layout>
</widget>
<customwidgets>
<customwidget>
Expand Down

0 comments on commit 5d30f4b

Please sign in to comment.