summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-05-14 16:58:20 +0000
committerjstebbins <[email protected]>2014-05-14 16:58:20 +0000
commitebb2651ca57744741810e870e3762f1ada2959e6 (patch)
tree7b1e9ef3b85f02bfb9b67a43f74cba36fc750f4a /gtk/src
parent075f395197c3f68ecd9fd36be6a0112ecb6c945c (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')
-rw-r--r--gtk/src/callbacks.c5
-rw-r--r--gtk/src/ghb.ui52
-rw-r--r--gtk/src/internal_defaults.xml6
-rw-r--r--gtk/src/queuehandler.c27
-rw-r--r--gtk/src/queuehandler.h1
5 files changed, 56 insertions, 35 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 9d28532ee..192061c57 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -3244,6 +3244,11 @@ ghb_backend_events(signal_user_data_t *ud)
ud->job_activity_log = NULL;
if (js)
ghb_settings_set_int(js, "job_status", qstatus);
+ if (ghb_settings_get_boolean(ud->prefs, "RemoveFinishedJobs") &&
+ status.queue.error == GHB_ERROR_NONE)
+ {
+ ghb_queue_remove_row(ud, index);
+ }
if (ud->cancel_encode != GHB_CANCEL_ALL &&
ud->cancel_encode != GHB_CANCEL_FINISH)
{
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 628afe470..45bc0266c 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -6250,39 +6250,6 @@ You can edit these and add additional options.</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="row_spacing">2</property>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<object class="GtkBox" id="hbox6">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
@@ -6517,6 +6484,25 @@ on the Video tab instead.</property>
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="RemoveFinishedJobs">
+ <property name="label" translatable="yes">Delete completed jobs from queue</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">By default, completed jobs remain in the queue and are marked as complete.
+Check this if you want the queue to clean itself up by deleting completed jobs.</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="advanced_video_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index bcf8f9963..c057e00f9 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -137,8 +137,10 @@
</dict>
<key>Preferences</key>
<dict>
- <key>HideAdvancedVideoSettings</key>
+ <key>RemoveFinishedJobs</key>
<false />
+ <key>HideAdvancedVideoSettings</key>
+ <true />
<key>AutoScan</key>
<false />
<key>AddCC</key>
@@ -374,7 +376,7 @@
<key>h264Level</key>
<string></string>
<key>x264UseAdvancedOptions</key>
- <true />
+ <false />
<key>x264OptionExtra</key>
<string></string>
</dict>
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,
diff --git a/gtk/src/queuehandler.h b/gtk/src/queuehandler.h
index e91a2f241..3a5f8d145 100644
--- a/gtk/src/queuehandler.h
+++ b/gtk/src/queuehandler.h
@@ -30,5 +30,6 @@
void ghb_queue_buttons_grey(signal_user_data_t *ud);
gboolean ghb_reload_queue(signal_user_data_t *ud);
+void ghb_queue_remove_row(signal_user_data_t *ud, int row);
#endif // _QUEUEHANDLER_H_