Skip to content

Commit

Permalink
Fix review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <blackslayer4@gmail.com>
  • Loading branch information
allexzander committed Apr 26, 2023
1 parent 8817572 commit 3b14043
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
14 changes: 8 additions & 6 deletions src/gui/filedetails/NCRadioButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@

import QtQuick 2.15
import QtQuick.Controls 2.15
import Style 1.0

RadioButton {
id: root
property int indicatorItemWidth: 16
property int indicatorItemHeight: 16
property string color: "#000000"
readonly property int radius: 9
property int indicatorItemWidth: Style.radioButtonIndicatorSize
property int indicatorItemHeight: Style.radioButtonIndicatorSize
property string color: Style.ncTextColor
readonly property int radius: Style.radioButtonCustomRadius

indicator: Rectangle {
implicitWidth: root.indicatorItemWidth
implicitHeight: root.indicatorItemHeight
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 5
anchors.leftMargin: Style.radioButtonCustomMarginLeftOuter
radius: root.radius
border.color: root.color
border.width: 1
Expand All @@ -35,7 +37,7 @@ RadioButton {
visible: root.checked
color: root.color
radius: root.radius
anchors.margins: 4
anchors.margins: Style.radioButtonCustomMarginLeftInner
}
}
}
18 changes: 8 additions & 10 deletions src/gui/filedetails/ShareDetailsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Page {
readonly property bool passwordEnforced: shareModelData.passwordEnforced
readonly property bool isSharePermissionChangeInProgress: shareModelData.isSharePermissionChangeInProgress
readonly property bool isHideDownloadInProgress: shareModelData.isHideDownloadInProgress
readonly property int currentPermissionMode: shareModelData.currentPermissionMode
readonly property int currentPermissionMode: shareModelData.currentPermissionMode

readonly property bool isLinkShare: shareModelData.shareType === ShareModel.ShareTypeLink

Expand Down Expand Up @@ -326,9 +326,7 @@ Page {
text: qsTr("Allow upload and editing")
enabled: !root.isSharePermissionChangeInProgress

onClicked: {
root.toggleAllowEditing(checked);
}
onClicked: root.toggleAllowEditing(checked)

NCBusyIndicator {
anchors.fill: parent
Expand All @@ -353,7 +351,7 @@ Page {
}

NCRadioButton {
property int permissionMode: ShareModel.ModeViewOnly
readonly property int permissionMode: ShareModel.ModeViewOnly
Layout.fillWidth: true
ButtonGroup.group: permissionModeRadioButtonsGroup
enabled: !root.isSharePermissionChangeInProgress
Expand All @@ -363,11 +361,11 @@ Page {
indicatorItemHeight: moreMenu.indicatorItemWidth
spacing: moreMenu.indicatorSpacing
padding: moreMenu.itemPadding
onClicked: root.permissionModeChanged(permissionMode);
onClicked: root.permissionModeChanged(permissionMode)
}

NCRadioButton {
property int permissionMode: ShareModel.ModeUploadAndEditing
readonly property int permissionMode: ShareModel.ModeUploadAndEditing
Layout.fillWidth: true
ButtonGroup.group: permissionModeRadioButtonsGroup
enabled: !root.isSharePermissionChangeInProgress
Expand All @@ -377,7 +375,7 @@ Page {
indicatorItemHeight: moreMenu.indicatorItemWidth
spacing: moreMenu.indicatorSpacing
padding: moreMenu.itemPadding
onClicked: root.permissionModeChanged(permissionMode);
onClicked: root.permissionModeChanged(permissionMode)

NCBusyIndicator {
anchors.fill: parent
Expand All @@ -388,7 +386,7 @@ Page {
}

NCRadioButton {
property int permissionMode: ShareModel.ModeFileDropOnly
readonly property int permissionMode: ShareModel.ModeFileDropOnly
Layout.fillWidth: true
ButtonGroup.group: permissionModeRadioButtonsGroup
enabled: !root.isSharePermissionChangeInProgress
Expand All @@ -398,7 +396,7 @@ Page {
indicatorItemHeight: moreMenu.indicatorItemWidth
spacing: moreMenu.indicatorSpacing
padding: moreMenu.itemPadding
onClicked: root.permissionModeChanged(permissionMode);
onClicked: root.permissionModeChanged(permissionMode)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/filedetails/sharemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void ShareModel::setupInternalLinkShare()
Q_EMIT internalLinkReady();
}

void ShareModel::setSharePermissionChangeInProgress(const QString &shareId, bool isInProgress)
void ShareModel::setSharePermissionChangeInProgress(const QString &shareId, const bool isInProgress)
{
if (isInProgress == _sharePermissionsChangeInProgress) {
return;
Expand All @@ -509,7 +509,7 @@ void ShareModel::setSharePermissionChangeInProgress(const QString &shareId, bool
Q_EMIT dataChanged(shareModelIndex, shareModelIndex, {IsSharePermissionsChangeInProgress});
}

void ShareModel::setHideDownloadEnabledChangeInProgress(const QString &shareId, bool isInProgress)
void ShareModel::setHideDownloadEnabledChangeInProgress(const QString &shareId, const bool isInProgress)
{
if (isInProgress == _hideDownloadEnabledChangeInProgress) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/filedetails/sharemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ private slots:
void handleSecureFileDropLinkShare();
void handleLinkShare();
void setupInternalLinkShare();
void setSharePermissionChangeInProgress(const QString &shareId, bool isInProgress);
void setHideDownloadEnabledChangeInProgress(const QString &shareId, bool isInProgress);
void setSharePermissionChangeInProgress(const QString &shareId, const bool isInProgress);
void setHideDownloadEnabledChangeInProgress(const QString &shareId, const bool isInProgress);

void slotPropfindReceived(const QVariantMap &result);
void slotServerError(const int code, const QString &message);
Expand Down
5 changes: 3 additions & 2 deletions src/gui/sharemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ LinkShare::LinkShare(AccountPtr account,
const QDate &expireDate,
const QString &note,
const QString &label,
bool hideDownload)
const bool hideDownload)
: Share(account, id, uidowner, ownerDisplayName, path, Share::TypeLink, isPasswordSet, permissions)
, _name(name)
, _token(token)
Expand Down Expand Up @@ -320,8 +320,9 @@ void LinkShare::slotLabelSet(const QJsonDocument &, const QVariant &label)
}
}

void LinkShare::slotHideDownloadSet(const QJsonDocument &jsonDoc, const QVariant hideDownload)
void LinkShare::slotHideDownloadSet(const QJsonDocument &jsonDoc, const QVariant &hideDownload)
{
Q_UNUSED(jsonDoc);
if (!hideDownload.isValid()) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/sharemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class LinkShare : public Share
const QDate &expireDate,
const QString &note,
const QString &label,
bool hideDownload);
const bool hideDownload);

/*
* Get the share link
Expand Down Expand Up @@ -317,7 +317,7 @@ private slots:
void slotExpireDateSet(const QJsonDocument &reply, const QVariant &value);
void slotNameSet(const QJsonDocument &, const QVariant &value);
void slotLabelSet(const QJsonDocument &, const QVariant &value);
void slotHideDownloadSet(const QJsonDocument &jsonDoc, const QVariant hideDownload);
void slotHideDownloadSet(const QJsonDocument &jsonDoc, const QVariant &hideDownload);

private:
QString _name;
Expand Down
5 changes: 5 additions & 0 deletions theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ QtObject {
readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
readonly property int unifiedSearchResultNothingFoundHorizontalMargin: 10

readonly property int radioButtonCustomMarginLeftInner: 4
readonly property int radioButtonCustomMarginLeftOuter: 5
readonly property int radioButtonCustomRadius: 9
readonly property int radioButtonIndicatorSize: 16

readonly property var fontMetrics: FontMetrics {}

readonly property int activityContentSpace: 4
Expand Down

0 comments on commit 3b14043

Please sign in to comment.