MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / notify_paused

Function notify_paused

gtk/src/notifications.c:126–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126static void
127notify_paused (GhbNotification type, int64_t value, signal_user_data_t *ud)
128{
129 g_autofree char *body = NULL;
130
131 if (!ghb_get_queue_done_action() &&
132 !ghb_dict_get_bool(ud->prefs, "NotifyOnEncodeDone"))
133 {
134 return;
135 }
136
137 switch (type)
138 {
139 case GHB_NOTIFY_PAUSED_LOW_BATTERY:
140 body = g_strdup(_("Battery level is low."));
141 break;
142 case GHB_NOTIFY_PAUSED_ON_BATTERY:
143 body = g_strdup(_("Charger has been disconnected."));
144 break;
145 case GHB_NOTIFY_PAUSED_POWER_SAVE:
146 body = g_strdup(_("Power Saver mode has been activated."));
147 break;
148 case GHB_NOTIFY_PAUSED_LOW_DISK_SPACE:
149 {
150 g_autofree char *size_str = ghb_format_pretty_size(value);
151 body = g_strdup_printf(_("%s free space remaining."), size_str);
152 } break;
153 default:
154 body = NULL;
155 break;
156 }
157
158 send_notification(_("Encoding Paused"), body, "hb-paused");
159}
160
161/*
162 * Sends a notification of the specified type. If a notification of the same or

Callers 1

ghb_send_notificationFunction · 0.85

Calls 4

ghb_dict_get_boolFunction · 0.85
ghb_format_pretty_sizeFunction · 0.85
send_notificationFunction · 0.85

Tested by

no test coverage detected