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

Function notify_done

gtk/src/notifications.c:81–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static void
82notify_done (gboolean final, gboolean success, int64_t idx, signal_user_data_t *ud)
83{
84 if (!final)
85 {
86 if (success) n_succeeded += 1;
87 else n_failed += 1;
88 }
89
90 GhbValue *queueDict, *jobDict, *destDict;
91 g_autofree char *title = NULL;
92 g_autofree char *body = NULL;
93 gboolean notify_item, notify_queue;
94
95 notify_item = ghb_dict_get_bool(ud->prefs, "NotifyOnEncodeDone");
96 notify_queue = ghb_dict_get_bool(ud->prefs, "NotifyOnQueueDone");
97
98 if (notify_queue && final)
99 {
100 const char *msg = ghb_dict_get_string(ud->prefs, "CustomNotificationMessage");
101 if (msg && msg[0])
102 {
103 title = g_strdup(msg);
104 }
105 else
106 {
107 title = g_strdup(_("Put down that cocktail…"));
108 }
109 body = queue_complete_message();
110 }
111 else if (notify_item && !final)
112 {
113 queueDict = ghb_array_get(ud->queue, idx);
114 jobDict = ghb_dict_get(queueDict, "Job");
115 destDict = ghb_dict_get(jobDict, "Destination");
116 body = item_complete_name(ghb_dict_get_string(destDict, "File"));
117 title = g_strdup(success ? _("Encode Complete") : _("Encode Failed"));
118 }
119 else
120 {
121 return;
122 }
123 send_notification(title, body, "hb-done");
124}
125
126static void
127notify_paused (GhbNotification type, int64_t value, signal_user_data_t *ud)

Callers 1

ghb_send_notificationFunction · 0.85

Calls 5

ghb_dict_get_boolFunction · 0.85
ghb_dict_get_stringFunction · 0.85
queue_complete_messageFunction · 0.85
item_complete_nameFunction · 0.85
send_notificationFunction · 0.85

Tested by

no test coverage detected