зеркало из https://github.com/nextcloud/desktop.git
Show progess indicator
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
This commit is contained in:
Родитель
c3fac23903
Коммит
275e46f0db
|
@ -23,6 +23,8 @@
|
|||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcUserGroupShare, "nextcloud.gui.usergroupshare", QtInfoMsg)
|
||||
|
||||
namespace OCC {
|
||||
|
||||
/**
|
||||
|
|
|
@ -433,6 +433,7 @@ ShareUserLine::ShareUserLine(QSharedPointer<UserGroupShare> share,
|
|||
, _share(share)
|
||||
, _isFile(isFile)
|
||||
{
|
||||
Q_ASSERT(_share);
|
||||
_ui->setupUi(this);
|
||||
|
||||
_ui->sharedWith->setElideMode(Qt::ElideRight);
|
||||
|
@ -449,6 +450,9 @@ ShareUserLine::ShareUserLine(QSharedPointer<UserGroupShare> share,
|
|||
connect(_ui->confirmExpirationDate, &QAbstractButton::clicked, this, &ShareUserLine::setExpireDate);
|
||||
connect(_ui->calendar, &QDateTimeEdit::dateChanged, this, &ShareUserLine::setExpireDate);
|
||||
|
||||
connect(_share.data(), &UserGroupShare::noteSet, this, &ShareUserLine::disableProgessIndicatorAnimation);
|
||||
connect(_share.data(), &UserGroupShare::expireDateSet, this, &ShareUserLine::disableProgessIndicatorAnimation);
|
||||
|
||||
// create menu with checkable permissions
|
||||
auto *menu = new QMenu(this);
|
||||
_permissionReshare= new QAction(tr("Can reshare"), this);
|
||||
|
@ -747,6 +751,7 @@ void ShareUserLine::customizeStyle()
|
|||
|
||||
_ui->noteConfirmButton->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
|
||||
_ui->confirmExpirationDate->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
|
||||
_ui->progressIndicator->setColor(QGuiApplication::palette().color(QPalette::WindowText));
|
||||
}
|
||||
|
||||
void ShareUserLine::showNoteOptions(bool show)
|
||||
|
@ -769,7 +774,7 @@ void ShareUserLine::toggleNoteOptions(bool enable)
|
|||
{
|
||||
showNoteOptions(enable);
|
||||
|
||||
if (_share && !enable) {
|
||||
if (!enable) {
|
||||
// Delete note
|
||||
_share->setNote(QString());
|
||||
}
|
||||
|
@ -782,16 +787,15 @@ void ShareUserLine::onNoteConfirmButtonClicked()
|
|||
|
||||
void ShareUserLine::setNote(const QString ¬e)
|
||||
{
|
||||
if (_share) {
|
||||
_share->setNote(note);
|
||||
}
|
||||
enableProgessIndicatorAnimation(true);
|
||||
_share->setNote(note);
|
||||
}
|
||||
|
||||
void ShareUserLine::toggleExpireDateOptions(bool enable)
|
||||
{
|
||||
showExpireDateOptions(enable);
|
||||
|
||||
if (_share && !enable) {
|
||||
if (!enable) {
|
||||
_share->setExpireDate(QDate());
|
||||
}
|
||||
}
|
||||
|
@ -814,10 +818,23 @@ void ShareUserLine::showExpireDateOptions(bool show)
|
|||
|
||||
void ShareUserLine::setExpireDate()
|
||||
{
|
||||
if (!_share) {
|
||||
return;
|
||||
}
|
||||
|
||||
enableProgessIndicatorAnimation(true);
|
||||
_share->setExpireDate(_ui->calendar->date());
|
||||
}
|
||||
|
||||
void ShareUserLine::enableProgessIndicatorAnimation(bool enable)
|
||||
{
|
||||
if (enable) {
|
||||
if (!_ui->progressIndicator->isAnimated()) {
|
||||
_ui->progressIndicator->startAnimation();
|
||||
}
|
||||
} else {
|
||||
_ui->progressIndicator->stopAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
void ShareUserLine::disableProgessIndicatorAnimation()
|
||||
{
|
||||
enableProgessIndicatorAnimation(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,6 +160,9 @@ private:
|
|||
void showExpireDateOptions(bool show);
|
||||
void setExpireDate();
|
||||
|
||||
void enableProgessIndicatorAnimation(bool enable);
|
||||
void disableProgessIndicatorAnimation();
|
||||
|
||||
Ui::ShareUserLine *_ui;
|
||||
QSharedPointer<UserGroupShare> _share;
|
||||
bool _isFile;
|
||||
|
|
|
@ -66,6 +66,9 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressIndicator" name="progressIndicator" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -207,6 +210,12 @@
|
|||
<extends>QLabel</extends>
|
||||
<header>elidedlabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QProgressIndicator</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QProgressIndicator.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../theme.qrc"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче