Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200609
b: refs/heads/master
c: 174787c
h: refs/heads/master
i:
  200607: fef3d55
v: v3
  • Loading branch information
Ingo Molnar committed Jun 11, 2010
1 parent 04d8331 commit cda4f98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8fb2608053547bc3152ea61a5ec7cdfce5d942c
refs/heads/master: 174787cb5144e5a45141ec7cb9d95ea29bbe22bb
15 changes: 13 additions & 2 deletions trunk/tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ struct ui_progress *ui_progress__new(const char *title, u64 total)

if (self != NULL) {
int cols;

if (use_browser <= 0)
return self;
newtGetScreenSize(&cols, NULL);
cols -= 4;
newtCenteredWindow(cols, 1, title);
Expand All @@ -67,14 +70,22 @@ struct ui_progress *ui_progress__new(const char *title, u64 total)

void ui_progress__update(struct ui_progress *self, u64 curr)
{
/*
* FIXME: We should have a per UI backend way of showing progress,
* stdio will just show a percentage as NN%, etc.
*/
if (use_browser <= 0)
return;
newtScaleSet(self->scale, curr);
newtRefresh();
}

void ui_progress__delete(struct ui_progress *self)
{
newtFormDestroy(self->form);
newtPopWindow();
if (use_browser > 0) {
newtFormDestroy(self->form);
newtPopWindow();
}
free(self);
}

Expand Down

0 comments on commit cda4f98

Please sign in to comment.