| 124 | } |
| 125 | |
| 126 | static void |
| 127 | notify_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 |
no test coverage detected