Scribus
Open source desktop publishing at your fingertips
multiprogressdialog.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8 * Copyright (C) 2005 by Craig Bradney *
9 * cbradney@zip.com.au *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25 ***************************************************************************/
26 
27 #ifndef MULTIPROGRESSDIALOG_H
28 #define MULTIPROGRESSDIALOG_H
29 
30 #include "scribusapi.h"
31 #include "ui_multiprogressdialog.h"
32 
33 #include <QProgressBar>
34 #include <QDialog>
35 #include <QLabel>
36 #include <QLayout>
37 #include <QMap>
38 #include <QPushButton>
39 #include <QStringList>
40 #include <QString>
41 #include <QList>
42 
43 
44 class SCRIBUS_API MultiProgressDialog : public QDialog, Ui::MultiProgressDialog
45 {
46  Q_OBJECT
47 
48  public:
49  MultiProgressDialog(QWidget* parent=0);
58  MultiProgressDialog(const QString& titleText, const QString & cancelButtonText, QWidget* parent=0);
60 
64  void removeExtraProgressBars();
76  bool addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts, const QList<bool>& barsNumerical);
81  int overallProgress() const;
87  int progress(const QString &barName) const;
94  bool setLabel(const QString &barName, const QString & newLabel);
100  bool setBusyIndicator(const QString &barName);
107  bool setTotalSteps(const QString &barName, int totalSteps);
114  bool setProgress(const QString &barName, int progress);
122  bool setProgress(const QString &barName, int progress, int totalSteps);
127  void setOverallTotalSteps(int totalSteps);
132  void setOverallProgress(int progress);
138  void setOverallProgress(int progress, int totalSteps);
147  bool setupBar(const QString &barName, const QString &barText, int progress, int totalSteps);
152  void setCancelButtonText(const QString & cancelButtonText);
153 
154  signals:
155  void canceled();
156 
157  protected:
158  QStringList progressBarTitles;
159  QMap<QString, QProgressBar*> progressBars;
160  QMap<QString, QLabel*> progressLabels;
161 
162  private slots:
163  void emitCancel();
164 };
165 
166 #endif
Definition: multiprogressdialog.h:44