diff options
author | jstebbins <[email protected]> | 2014-05-14 16:58:20 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-05-14 16:58:20 +0000 |
commit | ebb2651ca57744741810e870e3762f1ada2959e6 (patch) | |
tree | 7b1e9ef3b85f02bfb9b67a43f74cba36fc750f4a /gtk/src/queuehandler.c | |
parent | 075f395197c3f68ecd9fd36be6a0112ecb6c945c (diff) |
LinGui: add preference option to remove completed queue jobs from queue
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6188 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/queuehandler.c')
-rw-r--r-- | gtk/src/queuehandler.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 7ae41afee..76ae59c07 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -1938,6 +1938,33 @@ find_pid: return FALSE; } +void +ghb_queue_remove_row(signal_user_data_t *ud, int row) +{ + GtkTreeView *treeview; + GtkTreeModel *store; + GtkTreeIter iter; + + if (row < 0) return; + if (row >= ghb_array_len(ud->queue)) + return; + + treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "queue_list")); + store = gtk_tree_view_get_model(treeview); + + gchar *path = g_strdup_printf ("%d", row); + if (gtk_tree_model_get_iter_from_string(store, &iter, path)) + { + gtk_tree_store_remove(GTK_TREE_STORE(store), &iter); + } + g_free(path); + + GValue *old = ghb_array_get_nth(ud->queue, row); + ghb_value_free(old); + ghb_array_remove(ud->queue, row); + ghb_save_queue(ud->queue); +} + G_MODULE_EXPORT gboolean queue_key_press_cb( GtkWidget *widget, |