void eom_statusbar_set_image_number (EomStatusbar *statusbar, gint num, gint tot) { gchar *msg; g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->img_num_statusbar), 0); /* Translators: This string is displayed in the statusbar. * The first token is the image number, the second is total image * count. * * Translate to "%Id" if you want to use localized digits, or * translate to "%d" otherwise. * * Note that translating this doesn't guarantee that you get localized * digits. That needs support from your system and locale definition * too.*/ msg = g_strdup_printf (_("%d / %d"), num, tot); gtk_statusbar_push (GTK_STATUSBAR (statusbar->priv->img_num_statusbar), 0, msg); g_free (msg); }
void eom_statusbar_set_image_number (EomStatusbar *statusbar, gint num, gint tot) { gchar *msg; g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); /* Hide number display if values don't make sense */ if (G_UNLIKELY (num <= 0 || tot <= 0)) return; /* Translators: This string is displayed in the statusbar. * The first token is the image number, the second is total image * count. * * Translate to "%Id" if you want to use localized digits, or * translate to "%d" otherwise. * * Note that translating this doesn't guarantee that you get localized * digits. That needs support from your system and locale definition * too.*/ msg = g_strdup_printf (_("%d / %d"), num, tot); gtk_label_set_text (GTK_LABEL (statusbar->priv->img_num_label), msg); g_free (msg); }
void eom_statusbar_set_has_resize_grip (EomStatusbar *statusbar, gboolean has_resize_grip) { g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), has_resize_grip); }
void eom_statusbar_set_progress (EomStatusbar *statusbar, gdouble progress) { g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (statusbar->priv->progressbar), progress); if (progress > 0 && progress < 1) { gtk_widget_show (statusbar->priv->progressbar); gtk_widget_hide (statusbar->priv->img_num_statusbar); } else { gtk_widget_hide (statusbar->priv->progressbar); gtk_widget_show (statusbar->priv->img_num_statusbar); } }