summaryrefslogtreecommitdiff
path: root/src/fr-window.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-21 16:35:18 +0100
committerinfirit <[email protected]>2014-11-22 20:25:30 +0100
commit37badab513ccac69db427207c1cd38ee57997449 (patch)
tree7cffd3a0579d28eb631923a2c561119a2084fc00 /src/fr-window.c
parent012914111652a7ee64abe08f457cd9eb77bc5f35 (diff)
downloadengrampa-37badab513ccac69db427207c1cd38ee57997449.tar.bz2
engrampa-37badab513ccac69db427207c1cd38ee57997449.tar.xz
progress dialog: show the number of remaining files to complete the operation
instead of the name of the file added/removed/extracted. Based on FR commit: bf2b5d2352cfcd9d4345dda7976208672838dce1 From: Paolo Bacchilega <[email protected]>
Diffstat (limited to 'src/fr-window.c')
-rw-r--r--src/fr-window.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/fr-window.c b/src/fr-window.c
index 7f2dddf..7e2c6a7 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -2671,9 +2671,9 @@ open_progress_dialog (FrWindow *window,
static gboolean
-fr_window_progress_cb (FrCommand *command,
- double fraction,
- FrWindow *window)
+fr_window_progress_cb (FrArchive *archive,
+ double fraction,
+ FrWindow *window)
{
window->priv->progress_pulse = (fraction < 0.0);
if (! window->priv->progress_pulse) {
@@ -2681,6 +2681,29 @@ fr_window_progress_cb (FrCommand *command,
if (window->priv->progress_dialog != NULL)
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (window->priv->pd_progress_bar), fraction);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (window->priv->progress_bar), fraction);
+
+ if ((archive != NULL) && (archive->command->n_files > 0)) {
+ char *message = NULL;
+ int remaining_files;
+
+ remaining_files = archive->command->n_files - archive->command->n_file + 1;
+
+ switch (window->priv->action) {
+ case FR_ACTION_ADDING_FILES:
+ case FR_ACTION_EXTRACTING_FILES:
+ case FR_ACTION_DELETING_FILES:
+ message = g_strdup_printf (ngettext (_("%d file remaining"),
+ _("%'d files remaining"),
+ remaining_files), remaining_files);
+ break;
+ default:
+ break;
+ }
+
+ if (message != NULL)
+ fr_command_message (archive->command, message);
+ }
+
#ifdef LOG_PROGRESS
g_print ("progress > %2.2f\n", fraction);
#endif