mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
plug models into the dialog
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
f799d8c697
commit
789ca7230a
@ -24,7 +24,6 @@ Item {
|
||||
id: root
|
||||
|
||||
required property string existingFileName
|
||||
required property string conflictFileName
|
||||
required property string existingSize
|
||||
required property string conflictSize
|
||||
required property string existingDate
|
||||
|
||||
@ -59,7 +59,7 @@ Window {
|
||||
z: 2
|
||||
|
||||
EnforcedPlainTextLabel {
|
||||
text: qsTr("%1 files in conflict").arg(12)
|
||||
text: qsTr("%1 files in conflict").arg(delegateModel.count)
|
||||
font.bold: true
|
||||
font.pixelSize: 20
|
||||
Layout.fillWidth: true
|
||||
@ -129,6 +129,8 @@ Window {
|
||||
id: conflictListView
|
||||
|
||||
model: DelegateModel {
|
||||
id: delegateModel
|
||||
|
||||
model: realModel
|
||||
|
||||
delegate: ConflictDelegate {
|
||||
|
||||
@ -152,7 +152,7 @@ RowLayout {
|
||||
NC.UserModel.currentUser.isConnected
|
||||
enabled: visible
|
||||
onClicked: {
|
||||
NC.Systray.createResolveConflictsDialog();
|
||||
NC.Systray.createResolveConflictsDialog(activityModel.allConflicts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,6 +428,8 @@ void ActivityListModel::startFetchJob()
|
||||
void ActivityListModel::setFinalList(const ActivityList &finalList)
|
||||
{
|
||||
_finalList = finalList;
|
||||
|
||||
emit allConflictsChanged();
|
||||
}
|
||||
|
||||
const ActivityList &ActivityListModel::finalList() const
|
||||
@ -912,4 +914,17 @@ bool ActivityListModel::hasManySyncConflicts() const
|
||||
return _hasManySyncConflicts;
|
||||
}
|
||||
|
||||
ActivityList ActivityListModel::allConflicts() const
|
||||
{
|
||||
auto result = ActivityList{};
|
||||
|
||||
for(const auto &activity : _finalList) {
|
||||
if (activity._syncFileItemStatus == SyncFileItem::Conflict) {
|
||||
result.push_back(activity);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@ class ActivityListModel : public QAbstractListModel
|
||||
Q_PROPERTY(quint32 maxActionButtons READ maxActionButtons CONSTANT)
|
||||
Q_PROPERTY(AccountState *accountState READ accountState WRITE setAccountState NOTIFY accountStateChanged)
|
||||
Q_PROPERTY(bool hasManySyncConflicts READ hasManySyncConflicts NOTIFY hasManySyncConflictsChanged)
|
||||
Q_PROPERTY(OCC::ActivityList allConflicts READ allConflicts NOTIFY allConflictsChanged)
|
||||
|
||||
public:
|
||||
enum DataRole {
|
||||
@ -108,6 +109,8 @@ public:
|
||||
|
||||
[[nodiscard]] bool hasManySyncConflicts() const;
|
||||
|
||||
[[nodiscard]] OCC::ActivityList allConflicts() const;
|
||||
|
||||
public slots:
|
||||
void slotRefreshActivity();
|
||||
void slotRefreshActivityInitial();
|
||||
@ -130,6 +133,7 @@ public slots:
|
||||
signals:
|
||||
void accountStateChanged();
|
||||
void hasManySyncConflictsChanged();
|
||||
void allConflictsChanged();
|
||||
|
||||
void activityJobStatusCode(int statusCode);
|
||||
void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user