* Sends a notification of the specified type. If a notification of the same or * a related type is already displayed, it will be replaced. * The value parameter will be used to determine the content of the message, * depending on the type. In some cases it will be displayed directly, in others * it is used as the index of the item to look up. */
| 166 | * it is used as the index of the item to look up. |
| 167 | */ |
| 168 | void |
| 169 | ghb_send_notification (GhbNotification type, int64_t value, signal_user_data_t *ud) |
| 170 | { |
| 171 | switch (type) |
| 172 | { |
| 173 | case GHB_NOTIFY_ITEM_DONE: |
| 174 | notify_done (FALSE, TRUE, value, ud); |
| 175 | break; |
| 176 | case GHB_NOTIFY_ITEM_FAILED: |
| 177 | notify_done (FALSE, FALSE, value, ud); |
| 178 | break; |
| 179 | case GHB_NOTIFY_QUEUE_DONE: |
| 180 | notify_done (TRUE, TRUE, value, ud); |
| 181 | // Reset the counters |
| 182 | n_succeeded = 0; |
| 183 | n_failed = 0; |
| 184 | break; |
| 185 | case GHB_NOTIFY_PAUSED_LOW_DISK_SPACE: |
| 186 | case GHB_NOTIFY_PAUSED_POWER_SAVE: |
| 187 | case GHB_NOTIFY_PAUSED_LOW_BATTERY: |
| 188 | case GHB_NOTIFY_PAUSED_ON_BATTERY: |
| 189 | notify_paused (type, value, ud); |
| 190 | break; |
| 191 | default: |
| 192 | g_debug("Notification not implemented"); |
| 193 | break; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /* |
| 198 | * Withdraws all notifications of the specified type. If there is a notification |
no test coverage detected