-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simó Albert i Beltran <[email protected]>
- Loading branch information
Showing
6 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2024 Vlad Krupinskii <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
from gi.repository.GObject import TYPE_INT | ||
|
||
from errands.lib.data import TaskData, UserData | ||
from errands.widgets.base.base_page import BasePage, TaskListView | ||
from errands.widgets.pending.pending_page_name import PendingPageName | ||
|
||
|
||
class PendingPage(PendingPageName, BasePage): | ||
@property | ||
def no_task_message(self) -> str: | ||
return "No Pending Tasks" | ||
|
||
@property | ||
def tasks_data(self) -> list[TaskData]: | ||
return [ | ||
task | ||
for task in UserData.tasks | ||
if not task.deleted and not task.completed and not task.trash | ||
] | ||
|
||
def sort(self, task1: TaskListView, task2: TaskListView, user_data) -> TYPE_INT: | ||
return (task1.priority if task1.priority else 10) - ( | ||
task2.priority if task2.priority else 10 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2024 Vlad Krupinskii <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
class PendingPageName: | ||
@property | ||
def page_name(self) -> str: | ||
return "pending" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2024 Vlad Krupinskii <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
from errands.widgets.base.base_sidebar_row import BaseSidebarRow | ||
from errands.widgets.pending.pending_page_name import PendingPageName | ||
|
||
|
||
class PendingSidebarRow(PendingPageName, BaseSidebarRow): | ||
@property | ||
def icon_name(self) -> str: | ||
return "errands-priority-set-symbolic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters