~kaozilon/totem/test

« back to all changes in this revision

Viewing changes to src/totem-statusbar.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-26 00:07:51 UTC
  • mfrom: (1.6.1) (24.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130526000751-kv8ap3x1di4qq8j2
Tags: 3.8.2-0ubuntu1
* Sync with Debian. Remaining changes: 
* debian/control.in:
  - Drop build-depends on libepc-ui-dev and libgrilo-0.2-dev (in universe)
  - Drop libxtst-dev build-depends so that the (redundant) fake key presses
    for inhibiting the screensaver are disabled (LP: #1007438)
  - Build-depend on libzeitgeist-dev
  - Suggest rather than recommend gstreamer components in universe
  - Add totem-plugins-extra
  - Add XB-Npp-Description and XB-Npp-Filename header to the 
    totem-mozilla package to improve ubufox/ubuntu plugin db integration 
  - Refer to Firefox in totem-mozilla description instead of Iceweasel
  - Don't have totem-mozilla recommend any particular browser
  - Drop obsolete python library dependencies since iplayer is no longer
    included
* debian/totem-common.install, debian/source_totem.py:
  - Install Ubuntu apport debugging hook
* debian/totem-plugins-extra.install:
  - Universe plugins split out of totem-plugins (currently only gromit)
* debian/totem-plugins.install:    
  - Skip the plugins split to -extra and add the zeitgeist plugin
* debian/rules:
  - Build with --fail-missing, to ensure we install everything. 
    + Ignore libtotem.{,l}a since we delibrately don't install these.
  - Re-enable hardening, make sure both PIE and BINDNOW are used
    by setting hardening=+all. (LP: #1039604)
* debian/patches/91_quicklist_entries.patch:
  - Add static quicklist
* debian/patches/92_gst-plugins-good.patch:
  - Build without unnecessary gstreamer1.0-bad dependency
* debian/patches/93_grilo_optional.patch:
  - Allow building without grilo while grilo MIR is still pending
* debian/patches/correct_desktop_mimetypes.patch:
  - Don't list the mimetypes after the unity lists
* debian/patches/revert_shell_menu.patch: 
  - revert the use of a shell menu until indicator-appmenu can handle
    the mixed shell/traditional menus itself
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "config.h"
29
29
 
 
30
#include <math.h>
30
31
#include <glib/gi18n.h>
31
 
 
32
32
#include <gtk/gtk.h>
33
33
 
34
34
#include "totem-statusbar.h"
35
 
#include "video-utils.h"
 
35
#include "totem-time-helpers.h"
36
36
 
37
37
#define SPACING 4
38
38
#define NORMAL_CONTEXT "text"
49
49
  gint time;
50
50
  gint length;
51
51
  guint timeout;
52
 
  guint percentage;
 
52
  gdouble percentage;
53
53
 
54
54
  guint pushed : 1;
55
55
  guint seeking : 1;
225
225
}
226
226
 
227
227
void
228
 
totem_statusbar_push (TotemStatusbar *statusbar, guint percentage)
 
228
totem_statusbar_push (TotemStatusbar *statusbar, gdouble percentage)
229
229
{
230
230
  TotemStatusbarPrivate *priv = statusbar->priv;
231
231
  GtkStatusbar *gstatusbar = GTK_STATUSBAR (statusbar);
247
247
    priv->percentage = percentage;
248
248
 
249
249
    /* eg: 75 % */
250
 
    label = g_strdup_printf (_("%d %%"), percentage);
 
250
    label = g_strdup_printf (_("%lf %%"), floorf (percentage));
251
251
    gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress), label);
252
252
    g_free (label);
253
253
    gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress),
254
 
                                  percentage / 100.);
 
254
                                  percentage);
255
255
    gtk_widget_show (priv->progress);
256
256
 
257
257
    need_update = TRUE;
327
327
        gtk_label_get_text (GTK_LABEL (statusbar->priv->time_label)));
328
328
  } else {
329
329
    /* eg: Buffering, 75 % */
330
 
    text = g_strdup_printf (_("%s, %d %%"),
 
330
    text = g_strdup_printf (_("%s, %f %%"),
331
331
        gtk_label_get_text (GTK_LABEL (label)),
332
 
        statusbar->priv->percentage);
 
332
        floorf (statusbar->priv->percentage));
333
333
  }
334
334
 
335
335
  atk_object_set_name (obj, text);