Skip to content

Commit 45aab00

Browse files
committed
views: Indicate configuring/enabling notifications if checkbox disabled.
This commit adds an extra Text widget in the stream settings indicating the user to configure or enable notifications if the checkbox is disabled. Currently, there are two ways to enable notifications in ZT: - Pass the --notify flag when starting ZT. - Add notify=enabled in the zuliprc file. See https://github.com/zulip/zulip-terminal#notifications for details on configuring notifications for your platform.
1 parent 9f31ddd commit 45aab00

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

zulipterminal/ui_tools/views.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,10 +1299,18 @@ def __init__(self, controller: Any, stream_id: int) -> None:
12991299
footlinks_width,
13001300
len(visual_notification.label) + 4,
13011301
)
1302+
visual_notification = [visual_notification]
1303+
# If notifications is not configured or enabled by the user, then
1304+
# disable the checkbox and mention it explicitly with a suffix text
13021305
if not self.controller.notify_enabled:
1303-
visual_notification = urwid.WidgetDisable(
1304-
urwid.AttrMap(visual_notification, "widget_disabled")
1305-
)
1306+
visual_notification = [
1307+
urwid.WidgetDisable(
1308+
urwid.AttrMap(*visual_notification, "widget_disabled")
1309+
),
1310+
urwid.Text(
1311+
("popup_important", " [notifications not configured or enabled]")
1312+
),
1313+
]
13061314
self.widgets = self.make_table_with_categories(
13071315
stream_info_content, column_widths
13081316
)
@@ -1317,7 +1325,7 @@ def __init__(self, controller: Any, stream_id: int) -> None:
13171325

13181326
self.widgets.append(muted_setting)
13191327
self.widgets.append(pinned_setting)
1320-
self.widgets.append(visual_notification)
1328+
self.widgets.extend(visual_notification)
13211329
super().__init__(controller, self.widgets, "STREAM_DESC", popup_width, title)
13221330

13231331
def toggle_mute_status(self, button: Any, new_state: bool) -> None:

0 commit comments

Comments
 (0)