Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<file>src/gui/WizardStyledWindow.qml</file>
<file>src/gui/UserStatusWindow.qml</file>
<file>src/gui/WindowAccountHeader.qml</file>
<file>src/gui/ActivitiesWindow.qml</file>
<file>src/gui/activity/qml/ActivitiesWindow.qml</file>
<file>src/gui/AssistantWindow.qml</file>
<file>src/gui/UserStatusWindowStatusRow.qml</file>
<file>src/gui/UserStatusWindowPredefinedStatusRow.qml</file>
Expand All @@ -31,16 +31,16 @@
<file>src/gui/tray/MainWindow.qml</file>
<file>src/gui/tray/UserLine.qml</file>
<file>src/gui/tray/HeaderButton.qml</file>
<file>src/gui/tray/SyncStatus.qml</file>
<file>src/gui/tray/ActivityItem.qml</file>
<file>src/gui/activity/qml/SyncStatus.qml</file>
<file>src/gui/activity/qml/ActivityItem.qml</file>
<file>src/gui/tray/AutoSizingMenu.qml</file>
<file>src/gui/tray/ActivityList.qml</file>
<file>src/gui/activity/qml/ActivityList.qml</file>
<file>src/gui/tray/CurrentAccountHeaderButton.qml</file>
<file>src/gui/tray/TrayWindowHeader.qml</file>
<file>src/gui/tray/ActivityItemContextMenu.qml</file>
<file>src/gui/tray/ActivityItemActions.qml</file>
<file>src/gui/tray/ActivityItemContent.qml</file>
<file>src/gui/tray/TalkReplyTextField.qml</file>
<file>src/gui/activity/qml/ActivityItemContextMenu.qml</file>
<file>src/gui/activity/qml/ActivityItemActions.qml</file>
<file>src/gui/activity/qml/ActivityItemContent.qml</file>
<file>src/gui/activity/qml/TalkReplyTextField.qml</file>
<file>src/gui/tray/CallNotificationDialog.qml</file>
<file>src/gui/tray/EditFileLocallyLoadingDialog.qml</file>
<file>src/gui/tray/EncryptionTokenDiscoveryDialog.qml</file>
Expand Down
23 changes: 12 additions & 11 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,25 @@ set(client_SRCS
governance/governancetypes.h
tray/svgimageprovider.h
tray/svgimageprovider.cpp
tray/syncstatussummary.h
tray/syncstatussummary.cpp
tray/activitydata.h
tray/activitydata.cpp
tray/activitylistmodel.h
tray/activitylistmodel.cpp
activity/syncstatussummary.h
activity/syncstatussummary.cpp
activity/activitydata.h
activity/activitydata.cpp
activity/activitylistmodel.h
activity/activitylistmodel.cpp
search/unifiedsearchresult.h
tray/asyncimageresponse.cpp
tray/trayimageprovider.cpp
tray/trayaccountappsmodel.h
tray/trayaccountappsmodel.cpp
tray/usermodel.h
tray/usermodel.cpp
tray/notificationhandler.h
tray/notificationhandler.cpp
tray/sortedactivitylistmodel.h
tray/sortedactivitylistmodel.cpp
activity/notificationhandler.h
activity/notificationhandler.cpp
activity/sortedactivitylistmodel.h
activity/sortedactivitylistmodel.cpp
creds/credentialsfactory.h
tray/talkreply.cpp
activity/talkreply.cpp
creds/credentialsfactory.cpp
creds/httpcredentialsgui.h
creds/httpcredentialsgui.cpp
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "caseclashfilenamedialog.h"
#include "activitydata.h"
#include "systray.h"
#include "talkreply.h"
#include "common/utility.h"

#include <QAbstractListModel>
Expand Down Expand Up @@ -120,6 +121,19 @@
_currentItem = currentItem;
}

void ActivityListModel::sendReplyMessage(const int activityIndex, const QString &conversationToken, const QString &message, const QString &replyTo)

Check warning on line 124 in src/gui/activity/activitylistmodel.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/activity/activitylistmodel.cpp:124:42 [bugprone-easily-swappable-parameters]

4 adjacent parameters of 'sendReplyMessage' of similar type are easily swapped by mistake

Check warning on line 124 in src/gui/activity/activitylistmodel.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/activity/activitylistmodel.cpp:124:25 [readability-convert-member-functions-to-static]

method 'sendReplyMessage' can be made static
{
if (!_accountState || conversationToken.isEmpty() || message.isEmpty()) {
return;
}

auto *const talkReply = new TalkReply(_accountState, this);

Check warning on line 130 in src/gui/activity/activitylistmodel.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/activity/activitylistmodel.cpp:130:17 [cppcoreguidelines-init-variables]

variable 'talkReply' is not initialized
connect(talkReply, &TalkReply::replyMessageSent, this, [this, activityIndex](const QString &replyMessage) {
setReplyMessageSent(activityIndex, replyMessage);
});
talkReply->sendReplyMessage(conversationToken, message, replyTo);
}

void ActivityListModel::setAndRefreshCurrentlyFetching(bool value)
{
if (_currentlyFetching == value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ACTIVITYLISTMODEL_H
#define ACTIVITYLISTMODEL_H

#include <QtCore>

Check failure on line 10 in src/gui/activity/activitylistmodel.h

View workflow job for this annotation

GitHub Actions / build

src/gui/activity/activitylistmodel.h:10:10 [clang-diagnostic-error]

'QtCore' file not found

#include "activitydata.h"

Expand Down Expand Up @@ -123,6 +123,7 @@
void slotTriggerDefaultAction(const int activityIndex);
void slotTriggerAction(const int activityIndex, const int actionIndex);
void slotTriggerDismiss(const int activityIndex);
Q_INVOKABLE void sendReplyMessage(const int activityIndex, const QString &conversationToken, const QString &message, const QString &replyTo);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the new public activity APIs

This new public Q_INVOKABLE has no Doxygen documentation, despite /workspace/desktop/AGENTS.md requiring: “Document the type and each declared member.” Its behavior for an empty conversation token, message, or replyTo is not evident from the declaration and should be documented; the newly added SyncStatusSummary::loadForAccount() and User::refreshActivities() declarations likewise need the required documentation.

Useful? React with 👍 / 👎.


void addNotificationToActivityList(const OCC::Activity &activity);
void addErrorToActivityList(const OCC::Activity &activity, const OCC::ActivityListModel::ErrorType type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
#ifndef NOTIFICATIONHANDLER_H
#define NOTIFICATIONHANDLER_H

#include <QtCore>

Check failure on line 9 in src/gui/activity/notificationhandler.h

View workflow job for this annotation

GitHub Actions / build

src/gui/activity/notificationhandler.h:9:10 [clang-diagnostic-error]

'QtCore' file not found

#include "usermodel.h"
#include "activitydata.h"

class QJsonDocument;

namespace OCC {

class AccountState;
class JsonApiJob;

class ServerNotificationHandler : public QObject
{
Q_OBJECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import QtQuick.Controls
import QtQuick.Layouts

import Style
import "./tray"
import "../.."

WizardStyledWindow {
id: root

property int userIndex: -1
property var currentUser: null
property var account: null
property var activityUser: null
property var activityModel: null
property var syncStatusModel: null
readonly property string headline: qsTr("Activities")

title: ""
Expand All @@ -24,21 +25,20 @@ WizardStyledWindow {
minimumWidth: Style.wizardStandaloneWindowMinimumWidth
minimumHeight: Style.wizardStandaloneWindowMinimumHeight

function reloadForCurrentUser() {
function resetActivityList() {
newActivitiesButtonLoader.active = false
syncStatus.model.loadForUser(root.currentUser)
}
Comment thread
Rello marked this conversation as resolved.

Shortcut {
sequences: [StandardKey.Cancel]
onActivated: root.close()
}

Component.onCompleted: reloadForCurrentUser()
Component.onCompleted: resetActivityList()

onVisibleChanged: {
if (visible) {
reloadForCurrentUser()
resetActivityList()
}
}

Expand All @@ -53,7 +53,7 @@ WizardStyledWindow {
WindowAccountHeader {
Layout.fillWidth: true
title: root.headline
user: root.currentUser
user: root.account
}

Rectangle {
Expand All @@ -66,8 +66,9 @@ WizardStyledWindow {
id: syncStatus

Layout.fillWidth: true
accentColor: Style.accentColor
user: root.currentUser
accentColor: root.account ? root.account.accentColor : Style.accentColor
syncStatusModel: root.syncStatusModel
user: root.activityUser
activityListModel: root.activityModel
}

Expand All @@ -86,7 +87,7 @@ WizardStyledWindow {

anchors.fill: parent
activeFocusOnTab: true
currentUser: root.currentUser
accentColor: root.account ? root.account.accentColor : Style.accentColor
model: root.activityModel
onOpenFile: Qt.openUrlExternally(filePath)
onActivityItemClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style
import com.nextcloud.desktopclient

ItemDelegate {
id: root
Expand All @@ -17,14 +16,14 @@ ItemDelegate {

property int iconSize: Style.trayListItemIconSize

property var currentUser: UserModel.currentUser

property var activityModel: null

property color accentColor: Style.accentColor

property bool isFileActivityList: false

readonly property bool isChatActivity: model.objectType === "chat" || model.objectType === "room" || model.objectType === "call"
readonly property bool isTalkReplyPossible: root.currentUser !== null && model.conversationToken !== ""
readonly property bool isTalkReplyPossible: root.activityModel !== null && model.conversationToken !== ""
property bool isTalkReplyOptionVisible: model.messageSent !== ""

padding: Style.standardSpacing
Expand Down Expand Up @@ -78,10 +77,12 @@ ItemDelegate {
Layout.leftMargin: Style.trayListItemIconSize + Style.trayHorizontalMargin

sourceComponent: TalkReplyTextField {
accentColor: root.currentUser ? root.currentUser.accentColor : palette.highlight
accentColor: root.accentColor
onSendReply: {
root.currentUser.sendReplyMessage(model.activityIndex, model.conversationToken, reply, model.messageId);
talkReplyTextFieldLoader.visible = false;
if (root.activityModel) {
root.activityModel.sendReplyMessage(model.activityIndex, model.conversationToken, reply, model.messageId)
talkReplyTextFieldLoader.visible = false
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style
import com.nextcloud.desktopclient

Repeater {
id: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import QtQuick.Layouts
import Style
import Qt5Compat.GraphicalEffects
import com.nextcloud.desktopclient
import "../../tray"

RowLayout {
id: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQml
import QtQuick
import QtQuick.Controls
import Style
import "../../tray"

AutoSizingMenu {
id: moreActionsButtonContextMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import QtQuick.Controls

import Style
import com.nextcloud.desktopclient as NC
import "../../tray"

ScrollView {
id: controlRoot
property alias model: sortedActivityList.sourceModel
property var currentUser: NC.UserModel.currentUser
property alias count: activityList.count
property alias atYBeginning : activityList.atYBeginning
property bool isFileActivityList: false
property int iconSize: Style.trayListItemIconSize
property color accentColor: Style.accentColor
property int delegateHorizontalPadding: 0

property bool scrollingToTop: false
Expand Down Expand Up @@ -99,7 +100,7 @@ ScrollView {
width: activityList.contentItem.width

isFileActivityList: controlRoot.isFileActivityList
currentUser: controlRoot.currentUser
accentColor: controlRoot.accentColor
activityModel: controlRoot.model
iconSize: controlRoot.iconSize
flickable: activityList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ import QtQuick.Layouts
import Style

import com.nextcloud.desktopclient as NC
import "../../tray"

RowLayout {
id: root

property alias model: syncStatus
property var syncStatusModel: null
property var model: syncStatusModel ? syncStatusModel : defaultSyncStatus
property color accentColor: Style.ncBlue
property var user: NC.UserModel.currentUser
property var user: null
property var activityListModel: null

spacing: Style.trayHorizontalMargin

NC.SyncStatusSummary {
id: syncStatus
id: defaultSyncStatus
}

NCBusyIndicator {
Expand All @@ -41,7 +43,7 @@ RowLayout {

padding: 0

imageSource: syncStatus.syncIcon
imageSource: root.model.syncIcon
running: false // hotfix for download speed slowdown when tray is open
}

Expand All @@ -60,7 +62,7 @@ RowLayout {

Layout.fillWidth: true

text: syncStatus.syncStatusString
text: root.model.syncStatusString
verticalAlignment: Text.AlignVCenter
font.pixelSize: Style.topLinePixelSize
font.bold: true
Expand All @@ -71,12 +73,12 @@ RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: Style.progressBarPreferredHeight

active: syncStatus.syncing && syncStatus.totalFiles > 0
active: root.model.syncing && root.model.totalFiles > 0
visible: active

sourceComponent: NCProgressBar {
id: syncProgressBar
value: syncStatus.syncProgress
value: root.model.syncProgress
fillColor: root.accentColor
}
}
Expand All @@ -86,8 +88,8 @@ RowLayout {

Layout.fillWidth: true

text: syncStatus.syncStatusDetailString
visible: syncStatus.syncStatusDetailString !== ""
text: root.model.syncStatusDetailString
visible: root.model.syncStatusDetailString !== ""
font.pixelSize: Style.subLinePixelSize
wrapMode: Text.Wrap
}
Expand All @@ -105,14 +107,14 @@ RowLayout {
visible: root.user !== null &&
root.activityListModel !== null &&
!root.activityListModel.hasSyncConflicts &&
!syncStatus.syncing &&
!syncStatus.needsSandboxReapproval &&
!root.model.syncing &&
!root.model.needsSandboxReapproval &&
(root.user.hasLocalFolder ||
(Qt.platform.os === "osx" && root.user.hasFileProvider)) &&
root.user.isConnected
enabled: visible
onClicked: {
if(!syncStatus.syncing) {
if(!root.model.syncing) {
root.user.forceSyncNow();
}
}
Expand All @@ -126,7 +128,7 @@ RowLayout {
visible: root.user !== null &&
root.activityListModel !== null &&
root.activityListModel.hasSyncConflicts &&
!syncStatus.syncing &&
!root.model.syncing &&
root.user.hasLocalFolder &&
root.user.isConnected
enabled: visible
Expand All @@ -149,8 +151,8 @@ RowLayout {

text: qsTr("Open settings")

visible: syncStatus.needsSandboxReapproval &&
!syncStatus.syncing &&
visible: root.model.needsSandboxReapproval &&
!root.model.syncing &&
root.user !== null &&
root.user.hasLocalFolder &&
root.user.isConnected
Expand Down
Loading
Loading