| 1411 | } |
| 1412 | |
| 1413 | static void |
| 1414 | open_queue_file_cb (GtkFileChooser *chooser, gint response, |
| 1415 | signal_user_data_t *ud) |
| 1416 | { |
| 1417 | GFile *file; |
| 1418 | char *filename; |
| 1419 | GhbValue *queue; |
| 1420 | |
| 1421 | file = gtk_file_chooser_get_file(chooser); |
| 1422 | |
| 1423 | if (response != GTK_RESPONSE_ACCEPT || file == NULL) |
| 1424 | { |
| 1425 | ghb_file_chooser_destroy(chooser); |
| 1426 | return; |
| 1427 | } |
| 1428 | |
| 1429 | filename = g_file_get_path(file); |
| 1430 | g_object_unref(file); |
| 1431 | ghb_file_chooser_destroy(chooser); |
| 1432 | |
| 1433 | queue = ghb_read_settings_file(filename); |
| 1434 | if (queue != NULL) |
| 1435 | { |
| 1436 | int ii, count; |
| 1437 | count = ghb_array_len(queue); |
| 1438 | for (ii = 0; ii < count; ii++) |
| 1439 | { |
| 1440 | GhbValue *queueDict, *uiDict; |
| 1441 | |
| 1442 | queueDict = ghb_array_get(queue, ii); |
| 1443 | uiDict = ghb_dict_get(queueDict, "uiSettings"); |
| 1444 | ghb_value_incref(queueDict); |
| 1445 | ghb_dict_set_int(uiDict, "job_status", GHB_QUEUE_PENDING); |
| 1446 | ghb_dict_set_int(uiDict, "job_unique_id", 0); |
| 1447 | |
| 1448 | if (ud->queue == NULL) |
| 1449 | ud->queue = ghb_array_new(); |
| 1450 | ghb_array_append(ud->queue, queueDict); |
| 1451 | ghb_add_to_queue_list(ud, queueDict); |
| 1452 | } |
| 1453 | ghb_queue_buttons_grey(ud); |
| 1454 | ghb_save_queue(ud->queue); |
| 1455 | ghb_value_free(&queue); |
| 1456 | } |
| 1457 | g_free (filename); |
| 1458 | } |
| 1459 | |
| 1460 | static void open_queue_file (signal_user_data_t *ud) |
| 1461 | { |
nothing calls this directly
no test coverage detected