Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5369 → Rev 5370

/branches/Version13x/Scribus/scribus/multiprogressdialog.h
30,15 → 30,18
#include "scribusapi.h"
#include "multiprogressdialogbase.h"
 
#include <qprogressbar.h>
#include <qpushbutton.h>
#include "scprogressbar.h"
#include <qdialog.h>
 
#include <qlabel.h>
#include <qlayout.h>
#include <qmap.h>
#include <qpushbutton.h>
#include <qstringlist.h>
#include <qstring.h>
#include <qdialog.h>
#include <qmap.h>
#include <qvaluelist.h>
 
 
class SCRIBUS_API MultiProgressDialog : public MultiProgressDialogBase
{
Q_OBJECT
65,15 → 68,16
void removeExtraProgressBars();
/**
* Add a list of progress bars, where barsList contains a list of references and barTexts
* contains the labels for the bars.
* contains the labels for the bars. Set the bools in barsNumerical to true to get a "X of Y" indicator
* Eg:
* "MYBAR1" -> "My Bar 1:"
* "MYBAR2" -> "My Bar 2:"
* @param barsList
* @param barsTexts
* @param barsList
* @param barsTexts
* @param barsNumerical
* @return Success
*/
bool addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts);
bool addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts, const QValueList<bool>& barsNumerical);
/**
* Set a new label for a user defined progress bar
* @param barName Progress bar name
136,7 → 140,7
protected:
QStringList progressBarTitles;
QMap<QString, QProgressBar*> progressBars;
QMap<QString, ScProgressBar*> progressBars;
QMap<QString, QLabel*> progressLabels;
};
 
/branches/Version13x/Scribus/scribus/Makefile.am
184,6 → 184,7
scpaths.cpp \
scplugin.cpp \
scpreview.cpp \
scprogressbar.cpp \
scraction.cpp \
scrap.cpp \
scribusdoc.cpp \
/branches/Version13x/Scribus/scribus/pdflib.cpp
119,8 → 119,10
Q_CHECK_PTR(progressDialog);
QStringList barNames, barTexts;
barNames << "EMP" << "EP" << "ECPI";
barTexts << tr("Exporting Master Pages:") << tr("Exporting Pages:") << tr("Exporting Items on Current Page:");
progressDialog->addExtraProgressBars(barNames, barTexts);
barTexts << tr("Exporting Master Page:") << tr("Exporting Page:") << tr("Exporting Items on Current Page:");
QValueList<bool> barsNumeric;
barsNumeric << true << true << false;
progressDialog->addExtraProgressBars(barNames, barTexts, barsNumeric);
connect(progressDialog->buttonCancel, SIGNAL(clicked()), this, SLOT(cancelRequested()));
}
}
/branches/Version13x/Scribus/scribus/scprogressbar.cpp
0,0 → 1,61
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
scrpogressbar.cpp - description
-------------------
begin : Sat Jan 19 2002
copyright : (C) 2006 by Craig Bradney
email : cbradney@zip.com.au
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "scprogressbar.h"
#include "scprogressbar.moc"
 
ScProgressBar::ScProgressBar( bool showNumbers, QWidget *parent, const char *name, WFlags f ) :
QProgressBar( parent, name, f ),
m_useNumeric(showNumbers)
{
}
 
ScProgressBar::ScProgressBar( bool showNumbers, int totalSteps, QWidget* parent, const char* name, WFlags f ) :
QProgressBar( totalSteps, parent, name, f ),
m_useNumeric(showNumbers)
{
}
 
 
ScProgressBar::~ScProgressBar()
{
}
 
bool ScProgressBar::setIndicator( QString & indicator, int progress, int totalSteps )
{
if ( !totalSteps )
return FALSE;
if ( progress < 0 ) {
indicator = QString::fromLatin1("");
return TRUE;
} else {
if (!m_useNumeric)
return QProgressBar::setIndicator(indicator, progress, totalSteps);
else
{
indicator = tr("%1 of %2").arg(progress).arg(totalSteps);
return true;
}
}
}
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/multiprogressdialog.cpp
===================================================================
--- Scribus/scribus/multiprogressdialog.cpp (revision 5369)
+++ Scribus/scribus/multiprogressdialog.cpp (revision 5370)
@@ -49,7 +49,7 @@
progressLabels.clear();
}
-bool MultiProgressDialog::addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts)
+bool MultiProgressDialog::addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts, const QValueList<bool>& barsNumerical)
{
uint barCount=barsList.count();
if (barCount==0)
@@ -61,7 +61,7 @@
if(progressBarTitles.contains(barName))
continue;
progressBarTitles.append(barName);
- progressBars.insert(barName, new QProgressBar(this, barName));
+ progressBars.insert(barName, new ScProgressBar(barsNumerical[i], this, barName));
progressLabels.insert(barName, new QLabel(barsTexts[i], this, barName));
gridLayout->addWidget(progressLabels[barName], gridLayoutRow, 0);
gridLayout->addWidget(progressBars[barName], gridLayoutRow, 1);
/branches/Version13x/Scribus/scribus/pdflib.h
24,7 → 24,7
#ifndef PDFLIB_H
#define PDFLIB_H
 
#include "qvaluelist.h"
#include <qvaluelist.h>
#include <qfile.h>
#include <string>
#include <vector>
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
55,7 → 55,9
QStringList barNames, barTexts;
barNames << "GI";
barTexts << tr("Analyzing PostScript:");
progressDialog->addExtraProgressBars(barNames, barTexts);
QValueList<bool> barsNumeric;
barsNumeric << false;
progressDialog->addExtraProgressBars(barNames, barTexts, barsNumeric);
progressDialog->setOverallTotalSteps(3);
progressDialog->setOverallProgress(0);
progressDialog->setProgress("GI", 0);
/branches/Version13x/Scribus/scribus/scprogressbar.h
0,0 → 1,47
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
scrpogressbar.cpp - description
-------------------
begin : Sat Jan 19 2002
copyright : (C) 2006 by Craig Bradney
email : cbradney@zip.com.au
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SCPROGRESSBAR_H
#define SCPROGRESSBAR_H
 
#include <qprogressbar.h>
 
/*!
* @brief A Progress Bar that allows a number (X of Y) style or standard % indicator
*/
class ScProgressBar : public QProgressBar
{
Q_OBJECT
public:
ScProgressBar( bool showNumbers, QWidget *parent=0, const char *name=0, WFlags f=0 );
ScProgressBar( bool showNumbers, int totalSteps, QWidget* parent=0, const char* name=0, WFlags f=0 );
virtual bool setIndicator( QString & indicator, int progress, int totalSteps );
 
~ScProgressBar();
protected:
bool m_useNumeric;
 
};
 
#endif
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/pslib.cpp
===================================================================
--- Scribus/scribus/pslib.cpp (revision 5369)
+++ Scribus/scribus/pslib.cpp (revision 5370)
@@ -1099,8 +1099,10 @@
{
QStringList barNames, barTexts;
barNames << "EMP" << "EP";
- barTexts << tr("Processing Master Pages:") << tr("Exporting Pages:");
- progressDialog->addExtraProgressBars(barNames, barTexts);
+ barTexts << tr("Processing Master Page:") << tr("Exporting Page:");
+ QValueList<bool> barsNumeric;
+ barsNumeric << true << true;
+ progressDialog->addExtraProgressBars(barNames, barTexts, barsNumeric);
progressDialog->setOverallTotalSteps(pageNs.size()+Doc->MasterPages.count());
progressDialog->setTotalSteps("EMP", Doc->MasterPages.count());
progressDialog->setTotalSteps("EP", pageNs.size());