<x>0</x>
<y>0</y>
<width>350</width>
- <height>136</height>
+ <height>160</height>
</rect>
</property>
<property name="sizePolicy">
<property name="bottomMargin">
<number>0</number>
</property>
+ <item row="2" column="1">
+ <widget class="QDateEdit" name="calendar">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Password:</string>
+ </property>
+ <property name="indent">
+ <number>20</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QToolButton" name="shareLinkToolButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="../../client.qrc">
+ <normaloff>:/client/resources/more.svg</normaloff>:/client/resources/more.svg</iconset>
+ </property>
+ <property name="popupMode">
+ <enum>QToolButton::InstantPopup</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="4">
+ <widget class="QLabel" name="errorLabel">
+ <property name="palette">
+ <palette>
+ <active>
+ <colorrole role="WindowText">
+ <brush brushstyle="SolidPattern">
+ <color alpha="255">
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </active>
+ <inactive>
+ <colorrole role="WindowText">
+ <brush brushstyle="SolidPattern">
+ <color alpha="255">
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </inactive>
+ <disabled>
+ <colorrole role="WindowText">
+ <brush brushstyle="SolidPattern">
+ <color alpha="255">
+ <red>123</red>
+ <green>121</green>
+ <blue>134</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </disabled>
+ </palette>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lineEdit_password">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QToolButton" name="confirmPassword">
+ <property name="icon">
+ <iconset resource="../../client.qrc">
+ <normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="confirmExpirationDate">
+ <property name="icon">
+ <iconset resource="../../client.qrc">
+ <normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
</item>
</layout>
</item>
- <item row="0" column="3">
- <widget class="QToolButton" name="shareLinkToolButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="icon">
- <iconset resource="../../client.qrc">
- <normaloff>:/client/resources/more.svg</normaloff>:/client/resources/more.svg</iconset>
- </property>
- <property name="popupMode">
- <enum>QToolButton::InstantPopup</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="passwordLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Password:</string>
- </property>
- <property name="indent">
- <number>20</number>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="lineEdit_password">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QToolButton" name="confirmPassword">
- <property name="icon">
- <iconset resource="../../client.qrc">
- <normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
<item row="2" column="0">
<widget class="QLabel" name="expirationLabel">
<property name="sizePolicy">
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QDateEdit" name="calendar">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QToolButton" name="confirmExpirationDate">
- <property name="icon">
- <iconset resource="../../client.qrc">
- <normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="4">
- <widget class="QLabel" name="errorLabel">
- <property name="palette">
- <palette>
- <active>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>255</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- </active>
- <inactive>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>255</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- </inactive>
- <disabled>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>123</red>
- <green>121</green>
- <blue>134</blue>
- </color>
- </brush>
- </colorrole>
- </disabled>
- </palette>
- </property>
- <property name="text">
- <string>TextLabel</string>
- </property>
- <property name="textFormat">
- <enum>Qt::PlainText</enum>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
Share::Share(AccountPtr account,
const QString &id,
+ const QString &uidowner,
+ const QString &ownerDisplayName,
const QString &path,
const ShareType shareType,
const Permissions permissions,
const QSharedPointer<Sharee> shareWith)
: _account(account)
, _id(id)
+ , _uidowner(uidowner)
+ , _ownerDisplayName(ownerDisplayName)
, _path(path)
, _shareType(shareType)
, _permissions(permissions)
return _id;
}
+QString Share::getUidOwner() const
+{
+ return _uidowner;
+}
+
+QString Share::getOwnerDisplayName() const
+{
+ return _ownerDisplayName;
+}
+
Share::ShareType Share::getShareType() const
{
return _shareType;
LinkShare::LinkShare(AccountPtr account,
const QString &id,
+ const QString &uidowner,
+ const QString &ownerDisplayName,
const QString &path,
const QString &name,
const QString &token,
bool passwordSet,
const QUrl &url,
const QDate &expireDate)
- : Share(account, id, path, Share::TypeLink, permissions)
+ : Share(account, id, uidowner, ownerDisplayName, path, Share::TypeLink, permissions)
, _name(name)
, _token(token)
, _passwordSet(passwordSet)
return QSharedPointer<LinkShare>(new LinkShare(_account,
data.value("id").toVariant().toString(), // "id" used to be an integer, support both
+ data.value("uid_owner").toString(),
+ data.value("displayname_owner").toString(),
data.value("path").toString(),
data.value("name").toString(),
data.value("token").toString(),
return QSharedPointer<Share>(new Share(_account,
data.value("id").toVariant().toString(), // "id" used to be an integer, support both
+ data.value("uid_owner").toVariant().toString(),
+ data.value("displayname_owner").toVariant().toString(),
data.value("path").toString(),
(Share::ShareType)data.value("share_type").toInt(),
(Share::Permissions)data.value("permissions").toInt(),
layout->setContentsMargins(0, 0, 0, 0);
int x = 0;
int height = 0;
+ QList<QString> linkOwners({});
foreach (const auto &share, shares) {
// We don't handle link shares, only TypeUser or TypeGroup
if (share->getShareType() == Share::TypeLink) {
+ if(!share->getUidOwner().isEmpty() &&
+ share->getUidOwner() != share->account()->davUser()){
+ linkOwners.append(share->getOwnerDisplayName());
+ }
continue;
}
+ // the owner of the file that shared it first
+ if(x == 0 && !share->getUidOwner().isEmpty()){
+ _ui->mainOwnerLabel->setText(QString("Shared with you by ").append(share->getOwnerDisplayName()));
+ }
+
ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _parentScrollArea);
connect(s, &ShareUserLine::resizeRequested, this, &ShareUserGroupWidget::slotAdjustScrollWidgetSize);
connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
}
}
- scrollArea->setFrameShape(x > 3 ? QFrame::StyledPanel : QFrame::NoFrame);
+ foreach (const QString &owner, linkOwners) {
+ auto ownerLabel = new QLabel(QString(owner + " shared via link"));
+ layout->addWidget(ownerLabel);
+ ownerLabel->setVisible(true);
+
+ x++;
+ if (x <= 6) {
+ height = newViewPort->sizeHint().height();
+ }
+ }
+
+ scrollArea->setFrameShape(x > 6 ? QFrame::StyledPanel : QFrame::NoFrame);
scrollArea->setVisible(!shares.isEmpty());
scrollArea->setFixedHeight(height);
scrollArea->setWidget(newViewPort);