]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/install-progress.h
l10n: vi.po (623t): Update Vietnamese translation
[apt.git] / apt-pkg / install-progress.h
index 8bcc32927ddf8bfe57894b0b8eb01f4817809ec0..112b034fbbf8d7f0fdb71796fddb7e5d38aec5f3 100644 (file)
@@ -29,7 +29,7 @@ namespace Progress {
     virtual ~PackageManager() {};
 
     /* Global Start/Stop */
-    virtual void Start(int child_pty=-1) {};
+    virtual void Start(int /*child_pty*/=-1) {};
     virtual void Stop() {};
 
     /* When dpkg is invoked (may happen multiple times for each
@@ -48,14 +48,14 @@ namespace Progress {
                                unsigned int StepsDone,
                                unsigned int TotalSteps,
                                std::string HumanReadableAction);
-    virtual void Error(std::string PackageName,
-                       unsigned int StepsDone,
-                       unsigned int TotalSteps,
-                       std::string ErrorMessage) {}
-    virtual void ConffilePrompt(std::string PackageName,
-                                unsigned int StepsDone,
-                                unsigned int TotalSteps,
-                                std::string ConfMessage) {}
+    virtual void Error(std::string /*PackageName*/,
+                       unsigned int /*StepsDone*/,
+                       unsigned int /*TotalSteps*/,
+                       std::string /*ErrorMessage*/) {}
+    virtual void ConffilePrompt(std::string /*PackageName*/,
+                                unsigned int /*StepsDone*/,
+                                unsigned int /*TotalSteps*/,
+                                std::string /*ConfMessage*/) {}
  };
 
  class PackageManagerProgressFd : public PackageManager
@@ -125,7 +125,12 @@ namespace Progress {
     void SetupTerminalScrollArea(int nr_rows);
     void HandleSIGWINCH(int);
 
-    int GetNumberTerminalRows();
+    typedef struct {
+       int rows;
+       int columns;
+    } TermSize;
+    TermSize GetTerminalSize();
+
     sighandler_t old_SIGWINCH;
     int child_pty;
 
@@ -138,6 +143,10 @@ namespace Progress {
                                unsigned int StepsDone,
                                unsigned int TotalSteps,
                                std::string HumanReadableAction);
+
+    // return a progress bar of the given size for the given progress 
+    // percent between 0.0 and 1.0 in the form "[####...]"
+    static std::string GetTextProgressStr(float percent, int OutputSize);
  };
 
  class PackageManagerText : public PackageManager