Skip to content

Commit

Permalink
NXDRIVE-2912: Display Drive notification for document review
Browse files Browse the repository at this point in the history
  • Loading branch information
swetayadav1 committed Mar 20, 2024
1 parent 2d97277 commit 30b7b93
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions nxdrive/data/qml/Systray.qml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,27 @@ Rectangle {
}
]
}

// Pending Tasks
SystrayStatus {
id: pendingTasks
state: "pending_tasks"
visible: (state == "pending_tasks")
color: progressFilledLight
textColor: lightTheme
icon: MdiFont.Icon.bell

states: [
State {
name: "pending_tasks"
PropertyChanges {
target: updateState
text: qsTr("PENDING_DOCUMENT_REVIEWS").arg(api.fetch_pending_tasks(accountSelect.getRole("uid"))) + tl.tr
// onClicked: updatePopup.open()
}
}
]
}
}

// Different systray contents when there is no accounts
Expand Down
9 changes: 9 additions & 0 deletions nxdrive/gui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ def get_completed_sessions_count(self, uid: str, /) -> int:
)
return 0

@pyqtSlot(str, result=int)
def fetch_pending_tasks(self, uid: str, /) -> str:
"""Return pending tasks count for Drive notification."""
"""engine = self._manager.engines.get(uid)
if engine:
workflow = self.application.workflow
workflow.get_pending_tasks(uid, engine)"""
return 2

Check warning on line 246 in nxdrive/gui/api.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/api.py#L246

Added line #L246 was not covered by tests

@pyqtSlot(str, str, int, float, bool)
def pause_transfer(
self,
Expand Down

0 comments on commit 30b7b93

Please sign in to comment.