mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Share UI: Hide 'allow editing' for files #4211
This commit is contained in:
parent
cec4b803cf
commit
a2eee7e349
3 changed files with 44 additions and 36 deletions
|
@ -129,13 +129,9 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
|
|||
}
|
||||
|
||||
// File can't have public upload set.
|
||||
if (_isFile) {
|
||||
_ui->checkBox_editing->setEnabled(false);
|
||||
} else {
|
||||
if (!_account->capabilities().sharePublicLinkAllowUpload()) {
|
||||
_ui->checkBox_editing->setEnabled(false);
|
||||
}
|
||||
}
|
||||
_ui->widget_editing->setVisible(!_isFile);
|
||||
_ui->checkBox_editing->setEnabled(
|
||||
_account->capabilities().sharePublicLinkAllowUpload());
|
||||
|
||||
/*
|
||||
* Create the share manager and connect it properly
|
||||
|
@ -268,13 +264,10 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
|
|||
* Only directories can have public upload set
|
||||
* For public links the server sets CREATE and UPDATE permissions.
|
||||
*/
|
||||
_ui->checkBox_editing->setEnabled(
|
||||
_account->capabilities().sharePublicLinkAllowUpload());
|
||||
if (!_isFile) {
|
||||
_ui->checkBox_editing->setEnabled(true);
|
||||
if (_share->getPublicUpload()) {
|
||||
_ui->checkBox_editing->setChecked(true);
|
||||
} else {
|
||||
_ui->checkBox_editing->setChecked(false);
|
||||
}
|
||||
_ui->checkBox_editing->setChecked(_share->getPublicUpload());
|
||||
}
|
||||
|
||||
setShareLink(_share->getLink().toString());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<height>212</height>
|
||||
<height>237</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -168,28 +168,42 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_editing">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_editing">
|
||||
<property name="text">
|
||||
<string>Allow editing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QWidget" name="widget_editing" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_editing">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_editing">
|
||||
<property name="text">
|
||||
<string>Allow editing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "configfile.h"
|
||||
|
||||
#include <QVariantMap>
|
||||
#include <QDebug>
|
||||
|
||||
namespace OCC {
|
||||
|
||||
|
|
Loading…
Reference in a new issue