Subversion Repositories Scribus

Rev

Rev 8524 | Rev 9672 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6441 cbradney 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
#include "multipleduplicate.h"
8521 cbradney 8
//#include "multipleduplicate.moc"
6441 cbradney 9
 
8501 cbradney 10
#include <q3buttongroup.h>
6441 cbradney 11
#include <qlabel.h>
12
#include <qpushbutton.h>
6444 cbradney 13
#include <qradiobutton.h>
6441 cbradney 14
#include <qspinbox.h>
15
#include <qtabwidget.h>
16
 
8602 cbradney 17
#include "scrspinbox.h"
6441 cbradney 18
#include "units.h"
19
 
8501 cbradney 20
MultipleDuplicate::MultipleDuplicate( int unitIndex, QWidget* parent, const char* name, Qt::WFlags fl )
8524 subik 21
        : QDialog(parent, name, fl),
6441 cbradney 22
        m_unitIndex(unitIndex)
23
{
8524 subik 24
        setupUi(this);
6444 cbradney 25
        //set tab order
8602 cbradney 26
        QWidget::setTabOrder(createGapRadioButton, horizShiftSpinBox);
27
        QWidget::setTabOrder(horizShiftSpinBox, vertShiftSpinBox);
28
        QWidget::setTabOrder(gridColsSpinBox, horizRCGapSpinBox);
29
        QWidget::setTabOrder(horizRCGapSpinBox, vertRCGapSpinBox);
30
        QWidget::setTabOrder(vertRCGapSpinBox, rotationSpinBox);
6444 cbradney 31
 
32
        //set up mspinboxes
8602 cbradney 33
        horizShiftSpinBox->setNewUnit(unitIndex);
34
        vertShiftSpinBox->setNewUnit(unitIndex);
35
        horizRCGapSpinBox->setNewUnit(unitIndex);
36
        vertRCGapSpinBox->setNewUnit(unitIndex);
37
        horizShiftSpinBox->setMinimum(-1000);
38
        vertShiftSpinBox->setMinimum(-1000);
39
        horizRCGapSpinBox->setMinimum(-1000);
40
        vertRCGapSpinBox->setMinimum(-1000);
41
        horizShiftSpinBox->setMaximum(1000);
42
        vertShiftSpinBox->setMaximum(1000);
43
        horizRCGapSpinBox->setMaximum(1000);
44
        vertRCGapSpinBox->setMaximum(1000);
45
 
46
        rotationSpinBox->setValues(-180.0, 180.0, 10, 0.0);
6441 cbradney 47
 
48
        copiesCreateButtonGroup->setButton(0);
49
        // signals and slots connections
50
        connect(copiesCreateButtonGroup, SIGNAL(clicked(int)), this, SLOT(setCopiesShiftGap(int)));
51
}
52
 
53
MultipleDuplicate::~MultipleDuplicate()
54
{
55
}
56
 
57
void MultipleDuplicate::setCopiesShiftGap(int sel)
58
{
59
        if (sel==0)
60
        {
61
                horizShiftLabel->setText( tr("&Horizontal Shift:"));
62
                vertShiftLabel->setText( tr("&Vertical Shift:"));
63
        }
64
        else
65
        {
66
                horizShiftLabel->setText( tr("&Horizontal Gap:"));
67
                vertShiftLabel->setText( tr("&Vertical Gap:"));
68
        }
69
}
70
 
6657 cbradney 71
void MultipleDuplicate::getMultiplyData(ItemMultipleDuplicateData& mdData)
6441 cbradney 72
{
8146 fschmid 73
        mdData.type = tabWidget->currentPageIndex();
74
        mdData.copyCount = numberOfCopiesSpinBox->value();
75
        mdData.copyShiftOrGap = copiesCreateButtonGroup->selectedId();
8602 cbradney 76
        mdData.copyShiftGapH = horizShiftSpinBox->value();
77
        mdData.copyShiftGapV = vertShiftSpinBox->value();
78
        mdData.copyRotation = rotationSpinBox->value();
8146 fschmid 79
        mdData.gridRows = gridRowsSpinBox->value();
80
        mdData.gridCols = gridColsSpinBox->value();
8602 cbradney 81
        mdData.gridGapH = horizRCGapSpinBox->value();
82
        mdData.gridGapV = vertRCGapSpinBox->value();
6441 cbradney 83
}