1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-05-30 13:34:09 +02:00

Changes share link layout so it looks like the UI on the server.

- Adds icons to Share link and to save password on share dialog.
- Changes wording of the menu options for sharing link.
- Adds functionality to the new menu (mostly permissions).
- More widget size and size policy adjustments.

Signed-off-by: Camila San <hello@camila.codes>
This commit is contained in:
Camila San 2018-07-26 14:43:21 +02:00
parent a19904657a
commit b14aa11c29
No known key found for this signature in database
GPG Key ID: 7A4A6121E88E2AD4
14 changed files with 662 additions and 689 deletions

View File

@ -30,6 +30,11 @@
<file>resources/state-error.svg</file> <file>resources/state-error.svg</file>
<file>resources/state-warning.svg</file> <file>resources/state-warning.svg</file>
<file>resources/folder.svg</file> <file>resources/folder.svg</file>
<file>resources/network.svg</file>
<file>resources/settings.svg</file>
<file>resources/public-white.svg</file>
<file>resources/public.svg</file>
<file>resources/confirm.svg</file>
</qresource> </qresource>
<qresource prefix="/"/> <qresource prefix="/"/>
</RCC> </RCC>

1
resources/confirm.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 16 16" width="16" version="1.1" height="16"><path d="m8.5 0.5c-0.8974 0-1.3404 1.0909-0.6973 1.7168l4.7837 4.7832h-11.573c-1.3523-0.019125-1.3523 2.0191 0 2h11.572l-4.7832 4.7832c-0.98163 0.94251 0.47155 2.3957 1.4141 1.4141l6.4911-6.49c0.387-0.3878 0.391-1.0228 0-1.414l-6.4906-6.4903c-0.1883-0.1935-0.4468-0.30268-0.7168-0.3027z"/></svg>

After

(image error) Size: 393 B

1
resources/copy.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewbox="0 0 16 16"><path d="m13 15h-11l0.0005-10h11v3.0002l1-0.0004 0.0005-5.0001c0.000058-0.5834-0.4165-1.0002-1.0005-1.0001l-3.467 0.0005c0.0008-1.183-0.9492-2.0001-2.1325-2.0001s-2.1333 0.8171-2.1333 2.0004h-3.2c-0.5834 0-1.0662 0.4166-1.0662 0.9999l-0.0005 12c-0.0000243 0.584 0.4833 1 1.0667 1l10.933-0.0005c0.584-0.001 1-0.416 1-1v-3h-1zm-8.8005-12h1.0672c0.5833 0 1.0666-0.4162 1.0666-0.9996 0-0.5833 0.4834-0.9337 1.0667-0.9337s1.0667 0.3504 1.0667 0.9337c0 0.5834 0.5333 0.9996 1.0666 0.9996h1.2667c0.517 0 1.2 0.4166 1.2 1h-9c-0.0004-0.65 0.5988-1 1.1988-1zm-1.1995 8h2v-1h-2zm7.9998-2v-2l-4 3 3.9998 3v-2l5.0002-0.00005v-2l-4.9998-0.00005zm-8 4h4v-1h-4zm6-7h-6v1h6zm-3 2h-3v1h3z"/></svg>

After

(image error) Size: 777 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16" height="16" width="16"><path fill="#fff" d="m9.2363 2.166-3.1816 3.1836c-0.7071 0.7072-1.0378 1.6182-0.9883 2.457 0.05 0.8389 0.4333 1.5841 0.9883 2.1387l1.4121-1.416c-0.5672-0.5672-0.5444-1.2192 0.002-1.7656l3.1812-3.1817c0.52536-0.52536 1.2507-0.52318 1.772-0.002 0.48245 0.5556 0.52732 1.2382-0.004 1.7695l-0.82 0.8203c0.555 0.785 0.645 1.3663 0.593 2.2344l1.641-1.6406c1.2374-1.2374 1.2371-3.3645 0-4.6016-1.236-1.2361-3.342-1.2113-4.5957 0.004zm0.7071 3.8848-1.4141 1.418c0 0 0.003-00 0.004 0 0.55 0.55 0.50736 1.2582-0.004 1.7695l-3.1816 3.1817c-0.696 0.59192-1.2985 0.47105-1.7696 0-0.62636-0.62636-0.5-1.2681 0-1.768l0.85-0.8473c-0.556-0.7835-0.6484-1.365-0.5976-2.2324l-1.666 1.666c-1.2393 1.2393-1.2357 3.36 0 4.5957 1.2353 1.2353 3.362 1.2356 4.5976 0l3.1817-3.182c0.7086-0.7083 1.0396-1.6184 0.9906-2.4586-0.048-0.8401-0.432-1.5864-0.9887-2.1407z"/></svg>

After

(image error) Size: 942 B

1
resources/public.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16" height="16" width="16"><path d="m9.2363 2.166-3.1816 3.1836c-0.7071 0.7072-1.0378 1.6182-0.9883 2.457 0.05 0.8389 0.4333 1.5841 0.9883 2.1387l1.4121-1.416c-0.5672-0.5672-0.5444-1.2192 0.002-1.7656l3.1812-3.1817c0.52536-0.52536 1.2507-0.52318 1.772-0.002 0.48245 0.5556 0.52732 1.2382-0.004 1.7695l-0.82 0.8203c0.555 0.785 0.645 1.3663 0.593 2.2344l1.641-1.6406c1.2374-1.2374 1.2371-3.3645 0-4.6016-1.236-1.2361-3.342-1.2113-4.5957 0.004zm0.7071 3.8848-1.4141 1.418c0 0 0.003-00 0.004 0 0.55 0.55 0.50736 1.2582-0.004 1.7695l-3.1816 3.1817c-0.696 0.59192-1.2985 0.47105-1.7696 0-0.62636-0.62636-0.5-1.2681 0-1.768l0.85-0.8473c-0.556-0.7835-0.6484-1.365-0.5976-2.2324l-1.666 1.666c-1.2393 1.2393-1.2357 3.36 0 4.5957 1.2353 1.2353 3.362 1.2356 4.5976 0l3.1817-3.182c0.7086-0.7083 1.0396-1.6184 0.9906-2.4586-0.048-0.8401-0.432-1.5864-0.9887-2.1407z"/></svg>

After

(image error) Size: 930 B

View File

@ -29,7 +29,7 @@ namespace OCC {
* @brief The OcsShareJob class * @brief The OcsShareJob class
* @ingroup gui * @ingroup gui
* *
* Handle talking to the OCS Share API. * Handle talking to the OCS Share API.
* For creation, deletion and modification of shares. * For creation, deletion and modification of shares.
*/ */
class OcsShareJob : public OcsJob class OcsShareJob : public OcsJob
@ -71,7 +71,7 @@ public:
/** /**
* Set the share to be public upload * Set the share to be public upload
* *
* @param publicUpload Set or remove public upload * @param publicUpload Set or remove public upload
*/ */
void setPublicUpload(const QString &shareId, bool publicUpload); void setPublicUpload(const QString &shareId, bool publicUpload);
@ -93,11 +93,9 @@ public:
* Create a new link share * Create a new link share
* *
* @param path The path of the file/folder to share * @param path The path of the file/folder to share
* @param name The name of the link share, empty name auto-generates one
* @param password Optionally a password for the share * @param password Optionally a password for the share
*/ */
void createLinkShare(const QString &path, void createLinkShare(const QString &path, const QString &name,
const QString &name,
const QString &password); const QString &password);
/** /**

View File

@ -198,7 +198,6 @@ void ShareDialog::showSharingUi()
if (userGroupSharing) { if (userGroupSharing) {
_userGroupWidget = new ShareUserGroupWidget(_accountState->account(), _sharePath, _localPath, _maxSharingPermissions, _privateLinkUrl, this); _userGroupWidget = new ShareUserGroupWidget(_accountState->account(), _sharePath, _localPath, _maxSharingPermissions, _privateLinkUrl, this);
connect(_userGroupWidget, &ShareUserGroupWidget::togglePublicLinkShare, this, &ShareDialog::slotTogglePublicLinkShareDisplay);
_ui->verticalLayout->insertWidget(1, _userGroupWidget); _ui->verticalLayout->insertWidget(1, _userGroupWidget);
_userGroupWidget->getShares(); _userGroupWidget->getShares();
} }
@ -213,14 +212,6 @@ void ShareDialog::showSharingUi()
} }
} }
void ShareDialog::slotTogglePublicLinkShareDisplay(bool show)
{
if(show)
_linkWidget->toggleButton(true);
else
_linkWidget->toggleButton(false);
}
void ShareDialog::slotThumbnailFetched(const int &statusCode, const QByteArray &reply) void ShareDialog::slotThumbnailFetched(const int &statusCode, const QByteArray &reply)
{ {
if (statusCode != 200) { if (statusCode != 200) {

View File

@ -55,7 +55,6 @@ private slots:
void slotPropfindError(); void slotPropfindError();
void slotThumbnailFetched(const int &statusCode, const QByteArray &reply); void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
void slotAccountStateChanged(int state); void slotAccountStateChanged(int state);
void slotTogglePublicLinkShareDisplay(bool show);
private: private:
void showSharingUi(); void showSharingUi();

View File

@ -6,20 +6,20 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>380</width> <width>370</width>
<height>150</height> <height>100</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>380</width> <width>370</width>
<height>150</height> <height>100</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -32,8 +32,26 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>10</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item> <item>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0" columnstretch="0,1" columnminimumwidth="0,0"> <layout class="QGridLayout" name="gridLayout" rowstretch="0,0" columnstretch="0,0">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
@ -163,7 +181,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>360</width> <width>350</width>
<height>45</height> <height>45</height>
</size> </size>
</property> </property>
@ -192,7 +210,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents"> <widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry"> <property name="geometry">

View File

@ -32,8 +32,6 @@
namespace OCC { namespace OCC {
const char propertyShareC[] = "oc_share";
ShareLinkWidget::ShareLinkWidget(AccountPtr account, ShareLinkWidget::ShareLinkWidget(AccountPtr account,
const QString &sharePath, const QString &sharePath,
const QString &localPath, const QString &localPath,
@ -44,83 +42,67 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
, _account(account) , _account(account)
, _sharePath(sharePath) , _sharePath(sharePath)
, _localPath(localPath) , _localPath(localPath)
, _manager(0) , _manager(nullptr)
, _linkShare(nullptr)
, _passwordRequired(false) , _passwordRequired(false)
, _expiryRequired(false) , _expiryRequired(false)
, _namesSupported(true) , _namesSupported(true)
, _linkContextMenu(nullptr)
, _copyLinkAction(nullptr)
, _readOnlyLinkAction(nullptr)
, _allowEditingLinkAction(nullptr)
, _allowUploadEditingLinkAction(nullptr)
, _allowUploadLinkAction(nullptr)
, _passwordProtectLinkAction(nullptr)
, _expirationDateLinkAction(nullptr)
, _unshareLinkAction(nullptr)
{ {
_ui->setupUi(this); _ui->setupUi(this);
// _ui->linkShares->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
// _ui->linkShares->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
// _ui->linkShares->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
//Is this a file or folder? //Is this a file or folder?
QFileInfo fi(localPath); QFileInfo fi(localPath);
_isFile = fi.isFile(); _isFile = fi.isFile();
// Note: the share name cannot be longer than 64 characters
_ui->nameLineEdit->setText(tr("Public link"));
// the following progress indicator widgets are added to layouts which makes them // the following progress indicator widgets are added to layouts which makes them
// automatically deleted once the dialog dies. // automatically deleted once the dialog dies.
_pi_create = new QProgressIndicator(); _pi_create = new QProgressIndicator();
_pi_password = new QProgressIndicator(); _pi_password = new QProgressIndicator();
_pi_date = new QProgressIndicator(); _pi_date = new QProgressIndicator();
_pi_editing = new QProgressIndicator(); _pi_editing = new QProgressIndicator();
//_ui->horizontalLayout_create->addWidget(_pi_create); _ui->verticalLayout->addWidget(_pi_create, Qt::AlignCenter);
//_ui->horizontalLayout_password->addWidget(_pi_password); _ui->verticalLayout->addWidget(_pi_password, Qt::AlignCenter);
//_ui->layout_editing->addWidget(_pi_editing, 0, 2); _ui->verticalLayout->addWidget(_pi_editing, Qt::AlignCenter);
//_ui->horizontalLayout_expire->insertWidget(_ui->horizontalLayout_expire->count() - 1, _pi_date);
_ui->createShareButton->hide();
connect(_ui->nameLineEdit, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotShareNameEntered); connect(_ui->enableShareLink, &QCheckBox::toggled, this, &ShareLinkWidget::slotCreateorDeleteShareLink);
connect(_ui->createShareButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotShareNameEntered); connect(_ui->lineEdit_password, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotCreatePassword);
connect(_ui->linkShares, &QTableWidget::itemSelectionChanged, this, &ShareLinkWidget::slotShareSelectionChanged); connect(_ui->confirmPassword, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCreatePassword);
connect(_ui->linkShares, &QTableWidget::itemChanged, this, &ShareLinkWidget::slotNameEdited); connect(_ui->confirmExpirationDate, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCreatePassword);
connect(_ui->checkBox_password, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxPasswordClicked);
connect(_ui->lineEdit_password, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotPasswordReturnPressed);
connect(_ui->lineEdit_password, &QLineEdit::textChanged, this, &ShareLinkWidget::slotPasswordChanged);
connect(_ui->pushButton_setPassword, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPasswordReturnPressed);
connect(_ui->checkBox_expire, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxExpireClicked);
connect(_ui->calendar, &QDateTimeEdit::dateChanged, this, &ShareLinkWidget::slotExpireDateChanged); connect(_ui->calendar, &QDateTimeEdit::dateChanged, this, &ShareLinkWidget::slotExpireDateChanged);
//connect(_ui->radio_readOnly, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsClicked);
//connect(_ui->radio_readWrite, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsClicked);
//connect(_ui->radio_uploadOnly, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsClicked);
_ui->errorLabel->hide(); _ui->errorLabel->hide();
bool sharingPossible = true; bool sharingPossible = true;
if (!_account->capabilities().sharePublicLink()) { if (!_account->capabilities().sharePublicLink()) {
displayError(tr("Link shares have been disabled")); qCWarning(lcSharing) << "Link shares have been disabled";
sharingPossible = false; sharingPossible = false;
} else if (!(maxSharingPermissions & SharePermissionShare)) { } else if (!(maxSharingPermissions & SharePermissionShare)) {
displayError(tr("The file can not be shared because it was shared without sharing permission.")); qCWarning(lcSharing) << "The file can not be shared because it was shared without sharing permission.";
sharingPossible = false; sharingPossible = false;
} }
if (!sharingPossible) {
_ui->nameLineEdit->setEnabled(false); if (!sharingPossible)
_ui->createShareButton->setEnabled(false); _ui->shareLinkWidget->hide();
} else
_ui->shareLinkWidget->show();
// Older servers don't support multiple public link shares // Older servers don't support multiple public link shares
if (!_account->capabilities().sharePublicLinkMultiple()) { if (!_account->capabilities().sharePublicLinkMultiple()) {
_namesSupported = false; _namesSupported = false;
_ui->createShareButton->setText(tr("Create public link share"));
_ui->nameLineEdit->hide();
_ui->nameLineEdit->clear(); // so we don't send a name
} }
_ui->shareProperties->setEnabled(false); _ui->passwordShareProperty->hide();
_ui->shareProperties->setVisible(false); _ui->expirationShareProperty->hide();
_ui->pushButton_setPassword->setEnabled(false);
_ui->lineEdit_password->setEnabled(false);
_ui->pushButton_setPassword->setEnabled(false);
_ui->checkBox_password->setText(tr("P&assword protect"));
_ui->calendar->setMinimumDate(QDate::currentDate().addDays(1)); _ui->calendar->setMinimumDate(QDate::currentDate().addDays(1));
_ui->calendar->setEnabled(false);
// check if the file is already inside of a synced folder // check if the file is already inside of a synced folder
if (sharePath.isEmpty()) { if (sharePath.isEmpty()) {
@ -135,41 +117,13 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
} }
// Parse capabilities // TODO File Drop
// If password is enforced then don't allow users to disable it
if (_account->capabilities().sharePublicLinkEnforcePassword()) {
_ui->checkBox_password->setEnabled(false);
_passwordRequired = true;
}
// If expiredate is enforced do not allow disable and set max days
if (_account->capabilities().sharePublicLinkEnforceExpireDate()) {
_ui->checkBox_expire->setEnabled(false);
_ui->calendar->setMaximumDate(QDate::currentDate().addDays(
_account->capabilities().sharePublicLinkExpireDateDays()));
_expiryRequired = true;
}
// File can't have public upload set; we also hide it if the capability isn't there // File can't have public upload set; we also hide it if the capability isn't there
// _ui->widget_editing->setVisible( // _ui->widget_editing->setVisible(
// !_isFile && _account->capabilities().sharePublicLinkAllowUpload()); // !_isFile && _account->capabilities().sharePublicLinkAllowUpload());
//_ui->radio_uploadOnly->setVisible( //_ui->radio_uploadOnly->setVisible(
//_account->capabilities().sharePublicLinkSupportsUploadOnly()); //_account->capabilities().sharePublicLinkSupportsUploadOnly());
// Prepare sharing menu
_linkContextMenu = new QMenu(this);
connect(_linkContextMenu, &QMenu::triggered,
this, &ShareLinkWidget::slotLinkContextMenuActionTriggered);
_openLinkAction = _linkContextMenu->addAction(tr("Open link in browser"));
_copyLinkAction = _linkContextMenu->addAction(tr("Copy link to clipboard"));
_copyDirectLinkAction = _linkContextMenu->addAction(tr("Copy link to clipboard (direct download)"));
_emailLinkAction = _linkContextMenu->addAction(tr("Send link by email"));
_emailDirectLinkAction = _linkContextMenu->addAction(tr("Send link by email (direct download)"));
_deleteLinkAction = _linkContextMenu->addAction(tr("Delete"));
/* /*
* Create the share manager and connect it properly * Create the share manager and connect it properly
*/ */
@ -187,13 +141,6 @@ ShareLinkWidget::~ShareLinkWidget()
delete _ui; delete _ui;
} }
void ShareLinkWidget::toggleButton(bool show){
if(show)
_ui->createShareButton->show();
else
_ui->createShareButton->hide();
}
void ShareLinkWidget::getShares() void ShareLinkWidget::getShares()
{ {
if (_manager) { if (_manager) {
@ -206,196 +153,194 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
const QString versionString = _account->serverVersion(); const QString versionString = _account->serverVersion();
qCInfo(lcSharing) << versionString << "Fetched" << shares.count() << "shares"; qCInfo(lcSharing) << versionString << "Fetched" << shares.count() << "shares";
// Select the share that was previously selected,
// except if an explicit override was asked for
QString reselectShareId = _selectedShareId;
if (!_newShareOverrideSelectionId.isEmpty()) {
reselectShareId = _newShareOverrideSelectionId;
_newShareOverrideSelectionId.clear();
}
auto table = _ui->linkShares;
// Wipe the table without updating the ui elements, we
// might want their state untouched if the same share ends
// up being selected
disconnect(table, &QTableWidget::itemSelectionChanged, this, &ShareLinkWidget::slotShareSelectionChanged);
table->clearContents();
table->setRowCount(0);
connect(table, &QTableWidget::itemSelectionChanged, this, &ShareLinkWidget::slotShareSelectionChanged);
auto deleteIcon = QIcon::fromTheme(QLatin1String("user-trash"),
QIcon(QLatin1String(":/client/resources/delete.png")));
foreach (auto share, shares) { foreach (auto share, shares) {
if (share->getShareType() != Share::TypeLink) { if (share->getShareType() != Share::TypeLink) {
continue; continue;
} }
auto linkShare = qSharedPointerDynamicCast<LinkShare>(share); _linkShare = qSharedPointerDynamicCast<LinkShare>(share);
// Connect all shares signals to gui slots // Connect all shares signals to gui slots
connect(share.data(), &Share::serverError, this, &ShareLinkWidget::slotServerError); connect(share.data(), &Share::serverError, this, &ShareLinkWidget::slotServerError);
connect(share.data(), &Share::shareDeleted, this, &ShareLinkWidget::slotDeleteShareFetched); connect(share.data(), &Share::shareDeleted, this, &ShareLinkWidget::slotDeleteShareFetched);
connect(share.data(), &Share::permissionsSet, this, &ShareLinkWidget::slotPermissionsSet); //TODO connect(_linkShare.data(), &LinkShare::expireDateSet, this, &ShareLinkWidget::slotExpireSet);
connect(linkShare.data(), &LinkShare::expireDateSet, this, &ShareLinkWidget::slotExpireSet); connect(_linkShare.data(), &LinkShare::passwordSet, this, &ShareLinkWidget::slotPasswordSet);
connect(linkShare.data(), &LinkShare::passwordSet, this, &ShareLinkWidget::slotPasswordSet); connect(_linkShare.data(), &LinkShare::passwordSetError, this, &ShareLinkWidget::slotPasswordSetError);
connect(linkShare.data(), &LinkShare::passwordSetError, this, &ShareLinkWidget::slotPasswordSetError);
// Build the table row // Prepare permissions check and create group action
auto row = table->rowCount(); bool checked = false;
table->insertRow(row); SharePermissions perm = _linkShare->getPermissions();
QActionGroup *permissionsGroup = new QActionGroup(this);
auto nameItem = new QTableWidgetItem; // radio button style
auto name = shareName(*linkShare); permissionsGroup->setExclusive(true);
if (!_namesSupported) {
nameItem->setFlags(nameItem->flags() & ~Qt::ItemIsEditable);
}
nameItem->setText(name);
nameItem->setData(Qt::UserRole, QVariant::fromValue(linkShare));
table->setItem(row, 0, nameItem);
auto dotdotdotButton = new QToolButton; if(_isFile){
dotdotdotButton->setText("..."); checked = perm.testFlag(SharePermissionRead) &&
dotdotdotButton->setProperty(propertyShareC, QVariant::fromValue(linkShare)); perm.testFlag(SharePermissionUpdate) &&
connect(dotdotdotButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotContextMenuButtonClicked); perm.testFlag(SharePermissionDelete);
table->setCellWidget(row, 1, dotdotdotButton); _allowEditingLinkAction = permissionsGroup->addAction(tr("Allow Editing"));
_allowEditingLinkAction->setCheckable(true);
_allowEditingLinkAction->setChecked(checked);
auto deleteButton = new QToolButton;
deleteButton->setIcon(deleteIcon);
deleteButton->setProperty(propertyShareC, QVariant::fromValue(linkShare));
deleteButton->setToolTip(tr("Delete link share"));
connect(deleteButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotDeleteShareClicked);
table->setCellWidget(row, 2, deleteButton);
// Reestablish the previous selection
if (reselectShareId == share->getId()) {
table->selectRow(row);
}
}
if (!selectedShare()) {
if (table->rowCount() != 0) {
// Select the first share by default
table->selectRow(0);
} else { } else {
// explicitly note the deselection, checked = perm.testFlag(SharePermissionRead);
// since this was not triggered on table clear above _readOnlyLinkAction = permissionsGroup->addAction(tr("Read only"));
slotShareSelectionChanged(); _readOnlyLinkAction->setCheckable(true);
} _readOnlyLinkAction->setChecked(checked);
}
if (!_namesSupported) { checked = perm.testFlag(SharePermissionRead) &&
_ui->createShareButton->setHidden(table->rowCount() == 0); perm.testFlag(SharePermissionCreate) &&
perm.testFlag(SharePermissionUpdate) &&
perm.testFlag(SharePermissionDelete);
_allowUploadEditingLinkAction = permissionsGroup->addAction(tr("Allow Upload && Editing"));
_allowUploadEditingLinkAction->setCheckable(true);
_allowUploadEditingLinkAction->setChecked(checked);
checked = perm.testFlag(SharePermissionCreate);
_allowUploadLinkAction = permissionsGroup->addAction(tr("File Drop (Upload Only)"));
_allowUploadLinkAction->setCheckable(true);
_allowUploadLinkAction->setChecked(checked);
}
// Prepare sharing menu
_linkContextMenu = new QMenu(this);
// Add copy action (icon only)
_copyLinkAction = _linkContextMenu->addAction(QIcon(":/client/resources/copy.svg"),
tr("Copy link"));
// Adds permissions actions (radio button style)
if(_isFile){
_linkContextMenu->addAction(_allowEditingLinkAction);
} else {
_linkContextMenu->addAction(_readOnlyLinkAction);
_linkContextMenu->addAction(_allowUploadEditingLinkAction);
_linkContextMenu->addAction(_allowUploadLinkAction);
}
// Adds action to display password widget (check box)
_passwordProtectLinkAction = _linkContextMenu->addAction(tr("Password Protect"));
_passwordProtectLinkAction->setCheckable(true);
if(_linkShare->isPasswordSet()){
_passwordProtectLinkAction->setChecked(true);
_ui->lineEdit_password->setPlaceholderText("********");
_ui->passwordShareProperty->show();
}
// If password is enforced then don't allow users to disable it
if (_account->capabilities().sharePublicLinkEnforcePassword()) {
_passwordProtectLinkAction->setChecked(true);
_passwordProtectLinkAction->setEnabled(false);
_passwordRequired = true;
}
// Adds action to display expiration date widget (check box)
_expirationDateLinkAction = _linkContextMenu->addAction(tr("Expiration Date"));
_expirationDateLinkAction->setCheckable(true);
if(_linkShare->getExpireDate().isValid()){
_expirationDateLinkAction->setChecked(true);
_ui->expirationShareProperty->show();
}
// If expiredate is enforced do not allow disable and set max days
if (_account->capabilities().sharePublicLinkEnforceExpireDate()) {
_ui->calendar->setMaximumDate(QDate::currentDate().addDays(
_account->capabilities().sharePublicLinkExpireDateDays()));
_expirationDateLinkAction->setChecked(true);
_expirationDateLinkAction->setEnabled(false);
_expiryRequired = true;
}
// Adds action to unshare widget (check box)
_unshareLinkAction = _linkContextMenu->addAction(QIcon(":/client/resources/delete.png"),
tr("Unshare"));
connect(_linkContextMenu, &QMenu::triggered,
this, &ShareLinkWidget::slotLinkContextMenuActionTriggered);
_ui->shareLinkToolButton->setMenu(_linkContextMenu);
_ui->shareLinkToolButton->setEnabled(true);
_ui->enableShareLink->setEnabled(true);
_ui->enableShareLink->setChecked(true);
} }
if(table->rowCount() == 0)
_ui->linkShares->setHidden(true);
} }
void ShareLinkWidget::slotShareSelectionChanged() // TODO
{ //void ShareLinkWidget::slotShareSelectionChanged()
// Disable running progress indicators //{
_pi_create->stopAnimation(); // // Disable running progress indicators
_pi_editing->stopAnimation(); // _pi_create->stopAnimation();
_pi_date->stopAnimation(); // _pi_editing->stopAnimation();
_pi_password->stopAnimation(); // _pi_date->stopAnimation();
// _pi_password->stopAnimation();
_ui->errorLabel->hide(); // _ui->errorLabel->hide();
// _ui->passwordShareProperty->show();
// _ui->expirationShareProperty->show();
auto share = selectedShare();
if (!share) {
_ui->shareProperties->setHidden(false);
_ui->shareProperties->setVisible(false);
//_ui->radio_readOnly->setChecked(false);
//_ui->radio_readWrite->setChecked(false);
//_ui->radio_uploadOnly->setChecked(false);
_ui->checkBox_expire->setChecked(false);
_ui->checkBox_password->setChecked(false);
return;
}
bool selectionUnchanged = _selectedShareId == share->getId();
_selectedShareId = share->getId();
_ui->shareProperties->setEnabled(true);
_ui->shareProperties->setVisible(true);
_ui->checkBox_password->setEnabled(!_passwordRequired);
_ui->checkBox_expire->setEnabled(!_expiryRequired);
// _ui->widget_editing->setEnabled(true);
// if (!_account->capabilities().sharePublicLinkAllowUpload()) { // if (!_account->capabilities().sharePublicLinkAllowUpload()) {
// _ui->radio_readWrite->setEnabled(false); // _allowUploadEditingLinkAction->setEnabled(false);
// _ui->radio_uploadOnly->setEnabled(false); // _allowUploadLinkAction->setEnabled(false);
// } // }
// Password state // // Password state
_ui->checkBox_password->setText(tr("P&assword protect")); // _ui->lineEdit_password->setEnabled(_linkShare->isPasswordSet());
if (!selectionUnchanged) { // if(_linkShare->isPasswordSet()) _ui->lineEdit_password->setPlaceholderText("********");
if (share->isPasswordSet()) { // _ui->lineEdit_password->setText(QString());
_ui->checkBox_password->setChecked(true); // _ui->lineEdit_password->setEnabled(_linkShare->isPasswordSet());
_ui->lineEdit_password->setPlaceholderText("********"); // _ui->confirmPassword->setEnabled(_linkShare->isPasswordSet());
_ui->lineEdit_password->setEnabled(true);
} else {
_ui->checkBox_password->setChecked(false);
_ui->lineEdit_password->setPlaceholderText(QString());
_ui->lineEdit_password->setEnabled(false);
}
_ui->lineEdit_password->setText(QString());
_ui->pushButton_setPassword->setEnabled(false);
}
// Expiry state // // Expiry state
_ui->calendar->setMinimumDate(QDate::currentDate().addDays(1)); // _ui->calendar->setMinimumDate(QDate::currentDate().addDays(1));
if (share->getExpireDate().isValid()) { // if (_linkShare->getExpireDate().isValid()) {
_ui->checkBox_expire->setChecked(true); // _ui->calendar->setDate(_linkShare->getExpireDate());
_ui->calendar->setDate(share->getExpireDate()); // _ui->calendar->setEnabled(true);
_ui->calendar->setEnabled(true); // }
} else { // // Public upload state (box is hidden for files)
_ui->checkBox_expire->setChecked(false);
_ui->calendar->setEnabled(false);
}
// Public upload state (box is hidden for files)
// if (!_isFile) { // if (!_isFile) {
// if (share->getPublicUpload()) { // if (_linkShare->getPublicUpload()) {
// if (share->getShowFileListing()) { // if (_linkShare->getShowFileListing()) {
// //_ui->radio_readWrite->setChecked(true); // _allowUploadEditingLinkAction->setChecked(true);
// } else { // } else {
// //_ui->radio_uploadOnly->setChecked(true); // _allowUploadLinkAction->setChecked(true);
// } // }
// } else { // } else {
// //_ui->radio_readOnly->setChecked(true); // _readOnlyLinkAction->setChecked(true);
// } // }
// } // }
} //}
void ShareLinkWidget::setExpireDate(const QDate &date) void ShareLinkWidget::setExpireDate(const QDate &date)
{ {
if (auto current = selectedShare()) { if (_linkShare) {
_pi_date->startAnimation(); _pi_date->startAnimation();
_ui->errorLabel->hide(); _ui->errorLabel->hide();
current->setExpireDate(date); _linkShare->setExpireDate(date);
} }
} }
void ShareLinkWidget::slotExpireSet() // TODO
{ //void ShareLinkWidget::slotExpireSet()
if (sender() == selectedShare().data()) { //{
slotShareSelectionChanged(); // if (sender() == _linkShare.data()) {
} // slotShareSelectionChanged();
} // }
//}
void ShareLinkWidget::slotExpireDateChanged(const QDate &date) void ShareLinkWidget::slotExpireDateChanged(const QDate &date)
{ {
if (_ui->checkBox_expire->isChecked()) { setExpireDate(date);
setExpireDate(date);
}
} }
void ShareLinkWidget::slotPasswordReturnPressed() void ShareLinkWidget::slotCreatePassword()
{ {
if (!_manager) { if (!_manager) {
return; return;
} }
if (!selectedShare()) { if (!_linkShare) {
// If share creation requires a password, we'll be in this case // If share creation requires a password, we'll be in this case
if (_ui->lineEdit_password->text().isEmpty()) { if (_ui->lineEdit_password->text().isEmpty()) {
_ui->lineEdit_password->setFocus(); _ui->lineEdit_password->setFocus();
@ -403,42 +348,39 @@ void ShareLinkWidget::slotPasswordReturnPressed()
} }
_pi_create->startAnimation(); _pi_create->startAnimation();
_manager->createLinkShare(_sharePath, _ui->nameLineEdit->text(), _ui->lineEdit_password->text()); _manager->createLinkShare(_sharePath, QString(), _ui->lineEdit_password->text());
} else { } else {
setPassword(_ui->lineEdit_password->text()); setPassword(_ui->lineEdit_password->text());
} }
_ui->lineEdit_password->clearFocus();
} }
void ShareLinkWidget::slotPasswordChanged(const QString &newText) void ShareLinkWidget::slotCreateorDeleteShareLink(bool checked)
{ {
// disable the set-password button if (!_manager) {
_ui->pushButton_setPassword->setEnabled(newText.length() > 0); qCWarning(lcSharing) << "No share manager set.";
}
void ShareLinkWidget::slotNameEdited(QTableWidgetItem *item)
{
if (!_namesSupported) {
return; return;
} }
QString newName = item->text(); _pi_create->startAnimation();
auto share = item->data(Qt::UserRole).value<QSharedPointer<LinkShare>>(); if(checked){
if (share && newName != share->getName() && newName != share->getToken()) { _manager->createLinkShare(_sharePath, QString(), QString());
share->setName(newName); } else {
if (!_linkShare) {
qCWarning(lcSharing) << "No public link set.";
return;
}
confirmAndDeleteShare();
} }
_ui->shareLinkToolButton->setEnabled(checked);
} }
void ShareLinkWidget::setPassword(const QString &password) void ShareLinkWidget::setPassword(const QString &password)
{ {
if (auto current = selectedShare()) { if (_linkShare) {
_pi_password->startAnimation(); _pi_password->startAnimation();
_ui->errorLabel->hide(); _ui->errorLabel->hide();
_linkShare->setPassword(password);
_ui->checkBox_password->setEnabled(false);
_ui->lineEdit_password->setEnabled(false);
current->setPassword(password);
} }
} }
@ -469,48 +411,24 @@ void ShareLinkWidget::slotPasswordSet()
getShares(); getShares();
} }
void ShareLinkWidget::slotShareNameEntered()
{
if (!_manager) {
return;
}
_pi_create->startAnimation();
_manager->createLinkShare(_sharePath, _ui->nameLineEdit->text(), QString());
if(!_account->capabilities().sharePublicLinkMultiple())
_ui->createShareButton->setHidden(true);
_ui->linkShares->setHidden(false);
}
void ShareLinkWidget::slotDeleteShareFetched() void ShareLinkWidget::slotDeleteShareFetched()
{ {
getShares(); getShares();
} }
void ShareLinkWidget::slotCreateShareFetched(const QSharedPointer<LinkShare> &share) void ShareLinkWidget::slotCreateShareFetched()
{ {
_pi_create->stopAnimation(); _pi_create->stopAnimation();
_pi_password->stopAnimation(); _pi_password->stopAnimation();
_ui->nameLineEdit->clear();
_newShareOverrideSelectionId = share->getId();
getShares(); getShares();
} }
void ShareLinkWidget::slotCreateShareRequiresPassword(const QString &message) void ShareLinkWidget::slotCreateShareRequiresPassword(const QString &message)
{ {
// Deselect existing shares
_ui->linkShares->clearSelection();
// Prepare password entry // Prepare password entry
_pi_create->stopAnimation(); _pi_create->stopAnimation();
_pi_password->stopAnimation(); _pi_password->stopAnimation();
_ui->shareProperties->setEnabled(true); _ui->passwordShareProperty->show();
_ui->shareProperties->setVisible(true);
_ui->checkBox_password->setChecked(true);
_ui->checkBox_password->setEnabled(false);
_ui->checkBox_password->setText(tr("Public sh&aring requires a password"));
_ui->checkBox_expire->setEnabled(false);
//_ui->widget_editing->setEnabled(false);
if (!message.isEmpty()) { if (!message.isEmpty()) {
_ui->errorLabel->setText(message); _ui->errorLabel->setText(message);
_ui->errorLabel->show(); _ui->errorLabel->show();
@ -518,61 +436,34 @@ void ShareLinkWidget::slotCreateShareRequiresPassword(const QString &message)
_passwordRequired = true; _passwordRequired = true;
slotCheckBoxPasswordClicked(); togglePasswordOptions(true);
} }
void ShareLinkWidget::slotCheckBoxPasswordClicked() void ShareLinkWidget::togglePasswordOptions(bool enable)
{ {
if (_ui->checkBox_password->checkState() == Qt::Checked) { _ui->passwordShareProperty->setVisible(enable);
_ui->lineEdit_password->setEnabled(true); if(enable) _ui->lineEdit_password->setFocus();
_ui->pushButton_setPassword->setEnabled(true);
_ui->lineEdit_password->setPlaceholderText(tr("Please Set Password"));
_ui->lineEdit_password->setFocus();
} else {
setPassword(QString());
_ui->lineEdit_password->setPlaceholderText(QString());
_pi_password->startAnimation();
_ui->lineEdit_password->setEnabled(false);
_ui->pushButton_setPassword->setEnabled(false);
}
} }
void ShareLinkWidget::slotCheckBoxExpireClicked() void ShareLinkWidget::toggleExpireDateOptions(bool enable)
{ {
if (_ui->checkBox_expire->checkState() == Qt::Checked) { _ui->expirationShareProperty->setVisible(enable);
if (enable) {
const QDate date = QDate::currentDate().addDays(1); const QDate date = QDate::currentDate().addDays(1);
setExpireDate(date); setExpireDate(date);
_ui->calendar->setDate(date); _ui->calendar->setDate(date);
_ui->calendar->setMinimumDate(date); _ui->calendar->setMinimumDate(date);
_ui->calendar->setEnabled(true);
} else {
setExpireDate(QDate());
_ui->calendar->setEnabled(false);
} }
} }
void ShareLinkWidget::emailShareLink(const QUrl &url) void ShareLinkWidget::confirmAndDeleteShare()
{
QString fileName = _sharePath.mid(_sharePath.lastIndexOf('/') + 1);
Utility::openEmailComposer(
QString("I shared %1 with you").arg(fileName),
url.toString(),
this);
}
void ShareLinkWidget::openShareLink(const QUrl &url)
{
Utility::openBrowser(url, this);
}
void ShareLinkWidget::confirmAndDeleteShare(const QSharedPointer<LinkShare> &share)
{ {
auto messageBox = new QMessageBox( auto messageBox = new QMessageBox(
QMessageBox::Question, QMessageBox::Question,
tr("Confirm Link Share Deletion"), tr("Confirm Link Share Deletion"),
tr("<p>Do you really want to delete the public link share <i>%1</i>?</p>" tr("<p>Do you really want to delete the public link share <i>%1</i>?</p>"
"<p>Note: This action cannot be undone.</p>") "<p>Note: This action cannot be undone.</p>")
.arg(shareName(*share)), .arg(shareName()),
QMessageBox::NoButton, QMessageBox::NoButton,
this); this);
QPushButton *yesButton = QPushButton *yesButton =
@ -580,91 +471,63 @@ void ShareLinkWidget::confirmAndDeleteShare(const QSharedPointer<LinkShare> &sha
messageBox->addButton(tr("Cancel"), QMessageBox::NoRole); messageBox->addButton(tr("Cancel"), QMessageBox::NoRole);
connect(messageBox, &QMessageBox::finished, this, connect(messageBox, &QMessageBox::finished, this,
[messageBox, yesButton, share]() { [messageBox, yesButton, this]() {
if (messageBox->clickedButton() == yesButton) if (messageBox->clickedButton() == yesButton){
share->deleteShare(); this->_linkShare->deleteShare();
this->_ui->enableShareLink->setChecked(false);
this->_ui->shareLinkToolButton->setEnabled(false);
}
}); });
messageBox->open(); messageBox->open();
} }
QString ShareLinkWidget::shareName(const LinkShare &share) const QString ShareLinkWidget::shareName() const
{ {
QString name = share.getName(); QString name = _linkShare->getName();
if (!name.isEmpty()) if (!name.isEmpty())
return name; return name;
if (!_namesSupported) if (!_namesSupported)
return tr("Public link"); return tr("Public link");
return share.getToken(); return _linkShare->getToken();
} }
void ShareLinkWidget::slotContextMenuButtonClicked() void ShareLinkWidget::slotContextMenuButtonClicked()
{ {
auto share = sender()->property(propertyShareC).value<QSharedPointer<LinkShare>>();
bool downloadEnabled = share->getShowFileListing();
_copyDirectLinkAction->setVisible(downloadEnabled);
_emailDirectLinkAction->setVisible(downloadEnabled);
_linkContextMenu->setProperty(propertyShareC, QVariant::fromValue(share));
_linkContextMenu->exec(QCursor::pos()); _linkContextMenu->exec(QCursor::pos());
} }
void ShareLinkWidget::slotLinkContextMenuActionTriggered(QAction *action) void ShareLinkWidget::slotLinkContextMenuActionTriggered(QAction *action)
{ {
auto share = sender()->property(propertyShareC).value<QSharedPointer<LinkShare>>();
if (action == _deleteLinkAction) { bool state = action->isChecked();
confirmAndDeleteShare(share); SharePermissions perm = SharePermissionRead;
} else if (action == _copyLinkAction) {
QApplication::clipboard()->setText(share->getLink().toString());
} else if (action == _copyDirectLinkAction) {
QApplication::clipboard()->setText(share->getDirectDownloadLink().toString());
} else if (action == _emailLinkAction) {
emailShareLink(share->getLink());
} else if (action == _emailDirectLinkAction) {
emailShareLink(share->getDirectDownloadLink());
} else if (action == _openLinkAction) {
openShareLink(share->getLink());
}
}
void ShareLinkWidget::slotDeleteShareClicked() if (action == _copyLinkAction) {
{ QApplication::clipboard()->setText(_linkShare->getLink().toString());
auto share = sender()->property(propertyShareC).value<QSharedPointer<LinkShare>>();
confirmAndDeleteShare(share);
}
void ShareLinkWidget::slotPermissionsClicked() } else if (action == _readOnlyLinkAction && state) {
{ _linkShare->setPermissions(perm);
if (auto current = selectedShare()) {
//_ui->widget_editing->setEnabled(false);
_pi_editing->startAnimation();
_ui->errorLabel->hide();
SharePermissions perm = SharePermissionRead; } else if (action == _allowEditingLinkAction && state) {
// if (_ui->radio_readWrite->isChecked()) { perm |= SharePermissionDelete | SharePermissionUpdate;
// perm = SharePermissionRead | SharePermissionCreate _linkShare->setPermissions(perm);
// | SharePermissionUpdate | SharePermissionDelete;
// } else if (_ui->radio_uploadOnly->isChecked()) {
// perm = SharePermissionCreate;
// }
current->setPermissions(perm);
}
}
QSharedPointer<LinkShare> ShareLinkWidget::selectedShare() const } else if (action == _allowUploadEditingLinkAction && state) {
{ perm |= SharePermissionCreate | SharePermissionUpdate | SharePermissionDelete;
const auto items = _ui->linkShares->selectedItems(); _linkShare->setPermissions(perm);
if (items.isEmpty()) {
return QSharedPointer<LinkShare>();
}
return items.first()->data(Qt::UserRole).value<QSharedPointer<LinkShare>>(); } else if (action == _allowUploadLinkAction && state) {
} perm = SharePermissionCreate;
_linkShare->setPermissions(perm);
void ShareLinkWidget::slotPermissionsSet() } else if (action == _passwordProtectLinkAction) {
{ togglePasswordOptions(state);
if (sender() == selectedShare().data()) {
slotShareSelectionChanged(); } else if (action == _expirationDateLinkAction) {
toggleExpireDateOptions(state);
} else if (action == _unshareLinkAction) {
confirmAndDeleteShare();
} }
} }
@ -682,9 +545,6 @@ void ShareLinkWidget::slotServerError(int code, const QString &message)
void ShareLinkWidget::slotPasswordSetError(int code, const QString &message) void ShareLinkWidget::slotPasswordSetError(int code, const QString &message)
{ {
slotServerError(code, message); slotServerError(code, message);
_ui->checkBox_password->setEnabled(!_passwordRequired);
_ui->lineEdit_password->setEnabled(true);
_ui->lineEdit_password->setFocus(); _ui->lineEdit_password->setFocus();
} }

View File

@ -59,27 +59,21 @@ public:
private slots: private slots:
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares); void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
void slotShareSelectionChanged(); //void slotShareSelectionChanged();
void slotCreateorDeleteShareLink(bool checked);
void slotCreatePassword();
void slotShareNameEntered();
void slotDeleteShareClicked();
void slotCheckBoxPasswordClicked();
void slotCheckBoxExpireClicked();
void slotPasswordReturnPressed();
void slotPermissionsClicked();
void slotExpireDateChanged(const QDate &date); void slotExpireDateChanged(const QDate &date);
void slotPasswordChanged(const QString &newText);
void slotNameEdited(QTableWidgetItem *item);
void slotContextMenuButtonClicked(); void slotContextMenuButtonClicked();
void slotLinkContextMenuActionTriggered(QAction *action); void slotLinkContextMenuActionTriggered(QAction *action);
void slotDeleteShareFetched(); void slotDeleteShareFetched();
void slotCreateShareFetched(const QSharedPointer<LinkShare> &share); void slotCreateShareFetched();
void slotCreateShareRequiresPassword(const QString &message); void slotCreateShareRequiresPassword(const QString &message);
void slotPasswordSet(); void slotPasswordSet();
void slotExpireSet(); //void slotExpireSet();
void slotPermissionsSet();
void slotServerError(int code, const QString &message); void slotServerError(int code, const QString &message);
void slotPasswordSetError(int code, const QString &message); void slotPasswordSetError(int code, const QString &message);
@ -87,23 +81,24 @@ private slots:
private: private:
void displayError(const QString &errMsg); void displayError(const QString &errMsg);
void togglePasswordOptions(bool enable);
void setPassword(const QString &password); void setPassword(const QString &password);
void toggleExpireDateOptions(bool enable);
void setExpireDate(const QDate &date); void setExpireDate(const QDate &date);
void copyShareLink(const QUrl &url); void copyShareLink(const QUrl &url);
void emailShareLink(const QUrl &url);
void openShareLink(const QUrl &url);
/** Confirm with the user and then delete the share */ /** Confirm with the user and then delete the share */
void confirmAndDeleteShare(const QSharedPointer<LinkShare> &share); void confirmAndDeleteShare();
/** Retrieve a share's name, accounting for _namesSupported */ /** Retrieve a share's name, accounting for _namesSupported */
QString shareName(const LinkShare &share) const; QString shareName() const;
/** /**
* Retrieve the selected share, returning 0 if none. * Retrieve the selected share, returning 0 if none.
*/ */
QSharedPointer<LinkShare> selectedShare() const; //QSharedPointer<LinkShare> selectedShare() const;
Ui::ShareLinkWidget *_ui; Ui::ShareLinkWidget *_ui;
AccountPtr _account; AccountPtr _account;
@ -117,28 +112,22 @@ private:
QProgressIndicator *_pi_editing; QProgressIndicator *_pi_editing;
ShareManager *_manager; ShareManager *_manager;
QSharedPointer<LinkShare> _linkShare;
bool _isFile; bool _isFile;
bool _passwordRequired; bool _passwordRequired;
bool _expiryRequired; bool _expiryRequired;
bool _namesSupported; bool _namesSupported;
// For maintaining the selection and temporary ui state QMenu *_linkContextMenu;
// when getShares() finishes, but the selection didn't QAction *_copyLinkAction;
// change. QAction *_readOnlyLinkAction;
QString _selectedShareId; QAction *_allowEditingLinkAction;
QAction *_allowUploadEditingLinkAction;
// When a new share is created, we want to select it QAction *_allowUploadLinkAction;
// the next time getShares() finishes. This stores its id. QAction *_passwordProtectLinkAction;
QString _newShareOverrideSelectionId; QAction *_expirationDateLinkAction;
QAction *_unshareLinkAction;
QMenu *_linkContextMenu = nullptr;
QAction *_deleteLinkAction = nullptr;
QAction *_openLinkAction = nullptr;
QAction *_copyLinkAction = nullptr;
QAction *_copyDirectLinkAction = nullptr;
QAction *_emailLinkAction = nullptr;
QAction *_emailDirectLinkAction = nullptr;
}; };
} }

View File

@ -7,18 +7,18 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>350</width> <width>350</width>
<height>238</height> <height>124</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>340</width> <width>350</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -33,7 +33,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>6</number>
</property> </property>
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
@ -51,34 +51,12 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLineEdit" name="nameLineEdit"> <widget class="QWidget" name="shareLinkWidget" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>26</height>
</size>
</property>
<property name="placeholderText">
<string>Enter a name to create a new public link...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="createShareButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -89,114 +67,10 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <layout class="QHBoxLayout" name="shareLinkLayout">
<size> <property name="spacing">
<width>350</width> <number>3</number>
<height>26</height> </property>
</size>
</property>
<property name="text">
<string>&amp;Create new</string>
</property>
</widget>
</item>
<item>
<widget class="QTableWidget" name="linkShares">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>80</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
</property>
<property name="autoScrollMargin">
<number>10</number>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="gridStyle">
<enum>Qt::NoPen</enum>
</property>
<property name="columnCount">
<number>3</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>80</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>40</number>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>30</number>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>20</number>
</attribute>
<column/>
<column/>
<column/>
</widget>
</item>
<item>
<widget class="QWidget" name="shareProperties" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,0,0">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
@ -212,99 +86,174 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="horizontalSpacing"> <item>
<widget class="QPushButton" name="createShareButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>240</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">text-align: left</string>
</property>
<property name="text">
<string>&amp;Share link</string>
</property>
<property name="icon">
<iconset resource="../../client.qrc">
<normaloff>:/client/resources/public.svg</normaloff>:/client/resources/public.svg</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="enableShareLink">
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="shareLinkToolButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../client.qrc">
<normaloff>:/client/resources/more.png</normaloff>:/client/resources/more.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="passwordShareProperty" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<layout class="QHBoxLayout" name="passwordHorizontalLayout">
<property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="verticalSpacing"> <property name="sizeConstraint">
<number>5</number> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<item row="0" column="4"> <property name="leftMargin">
<widget class="QPushButton" name="pushButton_setPassword"> <number>18</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="QLabel" name="label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>162</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Save</string> <string>Password:</string>
</property>
<property name="indent">
<number>0</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item>
<widget class="QCheckBox" name="checkBox_expire">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&amp;Expiration date</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_password">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&amp;Password</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="lineEdit_password"> <widget class="QLineEdit" name="lineEdit_password">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>120</width>
<height>0</height> <height>26</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -321,18 +270,114 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="4"> <item>
<widget class="QDateEdit" name="calendar"> <widget class="QPushButton" name="confirmPassword">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>18</width>
<height>0</height> <height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../client.qrc">
<normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="expirationShareProperty" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<layout class="QHBoxLayout" name="expirationShareLayout" stretch="0,0,0">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<property name="leftMargin">
<number>18</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="QLabel" name="expirationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>162</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>Expiration date:</string>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="calendar">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>26</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -346,13 +391,45 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="confirmExpirationDate">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>18</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>18</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../client.qrc">
<normaloff>:/client/resources/confirm.svg</normaloff>:/client/resources/confirm.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="errorLabel"> <widget class="QLabel" name="errorLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -429,6 +506,8 @@
</layout> </layout>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources/> <resources>
<include location="../../client.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>350</width> <width>350</width>
<height>56</height> <height>54</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -19,7 +19,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>350</width> <width>350</width>
<height>54</height> <height>52</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -73,39 +73,14 @@
<item> <item>
<widget class="QLineEdit" name="shareeLineEdit"> <widget class="QLineEdit" name="shareeLineEdit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>220</width> <width>250</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>Share with users or groups ...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="permissionToolButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>26</height> <height>26</height>
</size> </size>
</property> </property>
@ -115,8 +90,42 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="placeholderText">
<string>Share with users or groups ...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="permissionToolButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>98</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text"> <property name="text">
<string>...</string> <string>can edit</string>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property> </property>
<property name="toolButtonStyle"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum> <enum>Qt::ToolButtonTextOnly</enum>
@ -139,7 +148,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>350</width> <width>350</width>
<height>0</height> <height>26</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -198,7 +207,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="margin"> <property name="margin">
<number>5</number> <number>0</number>
</property> </property>
<property name="indent"> <property name="indent">
<number>0</number> <number>0</number>

View File

@ -9,7 +9,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>340</width> <width>350</width>
<height>45</height> <height>45</height>
</rect> </rect>
</property> </property>
@ -21,7 +21,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>340</width> <width>350</width>
<height>45</height> <height>45</height>
</size> </size>
</property> </property>
@ -39,22 +39,22 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,3,2,2,2"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,3,2,2,2">
<property name="spacing"> <property name="spacing">
<number>3</number> <number>6</number>
</property> </property>
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>3</number> <number>6</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>3</number> <number>6</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>3</number> <number>6</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>3</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="avatar"> <widget class="QLabel" name="avatar">
@ -70,15 +70,30 @@
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="scaledContents"> <property name="scaledContents">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="indent">
<number>0</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -92,7 +107,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>26</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
@ -125,7 +140,7 @@
<item> <item>
<widget class="QCheckBox" name="permissionsEdit"> <widget class="QCheckBox" name="permissionsEdit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -144,34 +159,38 @@
<item> <item>
<widget class="QToolButton" name="permissionToolButton"> <widget class="QToolButton" name="permissionToolButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>26</width>
<height>0</height> <height>26</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string/>
</property>
<property name="icon">
<iconset resource="../../client.qrc">
<normaloff>:/client/resources/more.png</normaloff>:/client/resources/more.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="deleteShareButton"> <widget class="QToolButton" name="deleteShareButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>26</width>
<height>0</height> <height>26</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
@ -185,6 +204,8 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../../client.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>