summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/progress.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:01 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:01 +0000
commit0a8e3465cb644e380ab0fc6d66f6d1f17363b34e (patch)
tree7bc1f7814b793e616fb516d130e26bae04f848cf /apt-pkg/contrib/progress.cc
parente1b74f61dfb6980d643cb7c666c761ff3bda2f1e (diff)
Sync
Author: jgg Date: 1998-10-02 04:39:42 GMT Sync
Diffstat (limited to 'apt-pkg/contrib/progress.cc')
-rw-r--r--apt-pkg/contrib/progress.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index 9a29c4b66..0f2218f3c 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: progress.cc,v 1.7 1998/09/07 05:28:38 jgg Exp $
+// $Id: progress.cc,v 1.8 1998/10/02 04:39:53 jgg Exp $
/* ######################################################################
OpProgress - Operation Progress
@@ -13,6 +13,7 @@
#endif
#include <apt-pkg/progress.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/configuration.h>
#include <stdio.h>
/*}}}*/
@@ -108,6 +109,18 @@ bool OpProgress::CheckChange(float Interval)
return true;
}
/*}}}*/
+// OpTextProgress::OpTextProgress - Constructor /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+OpTextProgress::OpTextProgress(Configuration &Config) :
+ NoUpdate(false), NoDisplay(false), LastLen(0)
+{
+ if (Config.FindI("quiet",0) >= 1)
+ NoUpdate = true;
+ if (Config.FindI("quiet",0) >= 2)
+ NoDisplay = true;
+};
+ /*}}}*/
// OpTextProgress::Done - Clean up the display /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -123,7 +136,13 @@ void OpTextProgress::Done()
Write(S);
cout << endl;
OldOp = string();
- }
+ }
+
+ if (NoUpdate == true && NoDisplay == false && OldOp.empty() == false)
+ {
+ OldOp = string();
+ cout << endl;
+ }
}
/*}}}*/
// OpTextProgress::Update - Simple text spinner /*{{{*/
@@ -139,7 +158,14 @@ void OpTextProgress::Update()
{
if (MajorChange == false)
return;
- cout << Op << endl;
+ if (NoDisplay == false)
+ {
+ if (OldOp.empty() == false)
+ cout << endl;
+ OldOp = "a";
+ cout << Op << "..." << flush;
+ }
+
return;
}