summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-07-29 15:30:11 +0000
committerjstebbins <[email protected]>2008-07-29 15:30:11 +0000
commit73bcc75d303988c45aa21e9d11a5e09199180e18 (patch)
tree3d7b9e4f78df992997a1ef64f53a124302f5c64a /gtk
parent9f9dfaa881dde27143fead985923350bcb4ee321 (diff)
LinGui: Make the gui recognize when scanning is complete while an encode is
in progress. This will change if status callback patch gets in. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1591 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/hb-backend.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 11f210bb3..d5b11410e 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1641,11 +1641,23 @@ ghb_backend_events(signal_user_data_t *ud, gint *unique_id)
hb_state_t s;
gchar * status;
GtkProgressBar *progress;
+ static gint scan_complete_count = 0;
+ gint scans;
if (h == NULL) return GHB_EVENT_NONE;
hb_get_state( h, &s );
+ scans = hb_get_scancount(h);
*unique_id = s.param.working.sequence_id & 0xFFFFFF;
progress = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "progressbar"));
+ if (scans > scan_complete_count || s.state == HB_STATE_SCANDONE)
+ {
+ scan_complete_count = hb_get_scancount(h);
+ status = g_strdup_printf ("Scan done");
+ gtk_progress_bar_set_text (progress, status);
+ g_free(status);
+ gtk_progress_bar_set_fraction (progress, 1.0);
+ return GHB_EVENT_SCAN_DONE;
+ }
switch( s.state )
{
case HB_STATE_IDLE:
@@ -1667,6 +1679,7 @@ ghb_backend_events(signal_user_data_t *ud, gint *unique_id)
case HB_STATE_SCANDONE:
{
+ scan_complete_count = hb_get_scancount(h);
status = g_strdup_printf ("Scan done");
gtk_progress_bar_set_text (progress, status);
g_free(status);