#define FEATURE_TITLE_PROGRESS
/* should the history indicator [+-] be shown in status bar after url */
#define FEATURE_HISTORY_INDICATOR
+/* show wget style progressbar in status bar */
+#define FEATURE_WGET_PROGRESS_BAR
/* time in seconds after that message will be removed from inputbox if the
#define WIN_WIDTH 800
#define WIN_HEIGHT 600
+#ifdef FEATURE_WGET_PROGRESS_BAR
+/* chars to use for the progressbar */
+#define PROGRESS_BAR "=> "
+#define PROGRESS_BAR_LEN 20
+#endif
+
/* template to run shell command for vimb command :shellcmd */
#define SHELL_CMD "/bin/sh -c '%s'"
static void download_progress_cp(WebKitDownload *download, GParamSpec *pspec);
/* functions */
+#ifdef FEATURE_WGET_PROGRESS_BAR
+static void wget_bar(int len, int progress, char *string);
+#endif
static void update_title(void);
static void init_core(void);
static void marks_clear(void);
VB_WIDGET_OVERRIDE_BACKGROUND(widget, VB_GTK_STATE_NORMAL, bg);
}
+#ifdef FEATURE_WGET_PROGRESS_BAR
+static void wget_bar(int len, int progress, char *string)
+{
+ int i, state;
+
+ state = progress * len / 100;
+ for (i = 0; i < state; i++) {
+ string[i] = PROGRESS_BAR[0];
+ }
+ string[i++] = PROGRESS_BAR[1];
+ for (; i < len; i++) {
+ string[i] = PROGRESS_BAR[2];
+ }
+ string[i] = '\0';
+}
+#endif
+
void vb_update_statusbar()
{
int max, val, num;
/* show load status of page or the downloads */
if (vb.state.progress != 100) {
+#ifdef FEATURE_WGET_PROGRESS_BAR
+ char bar[PROGRESS_BAR_LEN + 1];
+ wget_bar(PROGRESS_BAR_LEN, vb.state.progress, bar);
+ g_string_append_printf(status, " [%s]", bar);
+#else
g_string_append_printf(status, " [%i%%]", vb.state.progress);
+#endif
}
/* show the scroll status */