mirror of https://github.com/nextcloud/desktop
Redesign local folder information in the account adding wizard
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
parent
e50ac349f4
commit
d8d72e81bb
|
@ -43,9 +43,14 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
|
|||
, _ocWizard(wizard)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
setupResoultionWidget();
|
||||
|
||||
_filePathLabel.reset(new ElidedLabel);
|
||||
_filePathLabel->setElideMode(Qt::ElideMiddle);
|
||||
_filePathLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
_filePathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||
_ui.locationsGridLayout->addWidget(_filePathLabel.data(), 3, 3);
|
||||
|
||||
registerField(QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);
|
||||
|
||||
auto sizePolicy = _progressIndi->sizePolicy();
|
||||
|
@ -116,6 +121,7 @@ void OwncloudAdvancedSetupPage::setupCustomization()
|
|||
variant = theme->customMedia(Theme::oCSetupBottom);
|
||||
WizardCommon::setupCustomMedia(variant, _ui.bottomLabel);
|
||||
|
||||
WizardCommon::customizeHintLabel(_filePathLabel.data());
|
||||
WizardCommon::customizeHintLabel(_ui.lFreeSpace);
|
||||
WizardCommon::customizeHintLabel(_ui.lSyncEverythingSizeLabel);
|
||||
WizardCommon::customizeHintLabel(_ui.lSelectiveSyncSizeLabel);
|
||||
|
@ -188,10 +194,11 @@ void OwncloudAdvancedSetupPage::fetchUserAvatar()
|
|||
{
|
||||
// Reset user avatar
|
||||
const auto appIcon = Theme::instance()->applicationIcon();
|
||||
_ui.lServerIcon->setPixmap(appIcon.pixmap(48));
|
||||
// To match the folder icon opposite the avatar -- that is 60x60, minus padding
|
||||
_ui.lServerIcon->setPixmap(appIcon.pixmap(32));
|
||||
// Fetch user avatar
|
||||
const auto account = _ocWizard->account();
|
||||
auto avatarSize = 64;
|
||||
auto avatarSize = 32;
|
||||
if (Theme::isHidpi()) {
|
||||
avatarSize *= 2;
|
||||
}
|
||||
|
@ -256,8 +263,6 @@ void OwncloudAdvancedSetupPage::updateStatus()
|
|||
|
||||
QString t;
|
||||
|
||||
setLocalFolderPushButtonPath(locFolder);
|
||||
|
||||
if (dataChanged()) {
|
||||
if (_remoteFolder.isEmpty() || _remoteFolder == QLatin1String("/")) {
|
||||
t = "";
|
||||
|
@ -277,6 +282,8 @@ void OwncloudAdvancedSetupPage::updateStatus()
|
|||
setResolutionGuiVisible(false);
|
||||
}
|
||||
|
||||
_filePathLabel->setText(QDir::toNativeSeparators(locFolder));
|
||||
|
||||
QString lfreeSpaceStr = Utility::octetsToString(availableLocalSpace());
|
||||
_ui.lFreeSpace->setText(QString(tr("%1 free space", "%1 gets replaced with the size and a matching unit. Example: 3 MB or 5 GB")).arg(lfreeSpaceStr));
|
||||
|
||||
|
@ -428,7 +435,6 @@ void OwncloudAdvancedSetupPage::slotSelectFolder()
|
|||
// TODO: remove when UX decision is made
|
||||
refreshVirtualFilesAvailibility(dir);
|
||||
|
||||
setLocalFolderPushButtonPath(dir);
|
||||
wizard()->setProperty("localFolder", dir);
|
||||
updateStatus();
|
||||
}
|
||||
|
@ -438,22 +444,6 @@ void OwncloudAdvancedSetupPage::slotSelectFolder()
|
|||
setErrorString(errorStr);
|
||||
}
|
||||
|
||||
|
||||
void OwncloudAdvancedSetupPage::setLocalFolderPushButtonPath(const QString &path)
|
||||
{
|
||||
const auto homeDir = QDir::homePath().endsWith('/') ? QDir::homePath() : QDir::homePath() + QLatin1Char('/');
|
||||
|
||||
if (!path.startsWith(homeDir)) {
|
||||
_ui.pbSelectLocalFolder->setText(QDir::toNativeSeparators(path));
|
||||
return;
|
||||
}
|
||||
|
||||
auto prettyPath = path;
|
||||
prettyPath.remove(0, homeDir.size());
|
||||
|
||||
_ui.pbSelectLocalFolder->setText(QDir::toNativeSeparators(prettyPath));
|
||||
}
|
||||
|
||||
void OwncloudAdvancedSetupPage::slotSelectiveSyncClicked()
|
||||
{
|
||||
AccountPtr acc = static_cast<OwncloudWizard *>(wizard())->account();
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "wizard/owncloudwizardcommon.h"
|
||||
#include "ui_owncloudadvancedsetuppage.h"
|
||||
#include "elidedlabel.h"
|
||||
|
||||
class QProgressIndicator;
|
||||
|
||||
|
@ -76,7 +77,6 @@ private:
|
|||
QString checkLocalSpace(qint64 remoteSize) const;
|
||||
void customizeStyle();
|
||||
void setServerAddressLabelUrl(const QUrl &url);
|
||||
void setLocalFolderPushButtonPath(const QString &path);
|
||||
void styleSyncLogo();
|
||||
void styleLocalFolderLabel();
|
||||
void setResolutionGuiVisible(bool value);
|
||||
|
@ -93,10 +93,12 @@ private:
|
|||
bool _localFolderValid = false;
|
||||
QProgressIndicator *_progressIndi;
|
||||
QString _remoteFolder;
|
||||
QString _localPath;
|
||||
QStringList _selectiveSyncBlacklist;
|
||||
qint64 _rSize = -1;
|
||||
qint64 _rSelectedSize = -1;
|
||||
OwncloudWizard *_ocWizard;
|
||||
QScopedPointer<ElidedLabel> _filePathLabel;
|
||||
};
|
||||
|
||||
} // namespace OCC
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue