Subversion Repositories Scribus

Rev

Rev 8495 | Rev 8521 | 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"
8
#include "multipleduplicate.moc"
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
 
17
#include "mspinbox.h"
18
#include "units.h"
19
 
8501 cbradney 20
MultipleDuplicate::MultipleDuplicate( int unitIndex, QWidget* parent, const char* name, Qt::WFlags fl )
6441 cbradney 21
        : MultipleDuplicateBase(parent, name, fl),
22
        m_unitIndex(unitIndex)
23
{
6444 cbradney 24
 
25
        //set tab order
26
        QWidget::setTabOrder(createGapRadioButton, horizShiftMSpinBox);
27
        QWidget::setTabOrder(horizShiftMSpinBox, vertShiftMSpinBox);
28
        QWidget::setTabOrder(gridColsSpinBox, horizRCGapMSpinBox);
29
        QWidget::setTabOrder(horizRCGapMSpinBox, vertRCGapMSpinBox);
8146 fschmid 30
        QWidget::setTabOrder(vertRCGapMSpinBox, rotationMSpinBox);
6444 cbradney 31
 
32
        //set up mspinboxes
6441 cbradney 33
        int decimals = unitGetDecimalsFromIndex(unitIndex);
34
        QString unitSuffix(unitGetSuffixFromIndex(unitIndex));
6829 cbradney 35
        horizShiftMSpinBox->setValues(-1000.0, 1000.0, decimals, 0.0);
36
        vertShiftMSpinBox->setValues(-1000.0, 1000.0, decimals, 0.0);
37
        horizRCGapMSpinBox->setValues(-1000.0, 1000.0, decimals, 0.0);
38
        vertRCGapMSpinBox->setValues(-1000.0, 1000.0, decimals, 0.0);
8146 fschmid 39
        rotationMSpinBox->setValues(-180.0, 180.0, 10, 0.0);
6441 cbradney 40
        horizShiftMSpinBox->setSuffix(unitSuffix);
41
        vertShiftMSpinBox->setSuffix(unitSuffix);
42
        horizRCGapMSpinBox->setSuffix(unitSuffix);
43
        vertRCGapMSpinBox->setSuffix(unitSuffix);
44
 
45
        copiesCreateButtonGroup->setButton(0);
46
        // signals and slots connections
47
        connect(copiesCreateButtonGroup, SIGNAL(clicked(int)), this, SLOT(setCopiesShiftGap(int)));
48
}
49
 
50
MultipleDuplicate::~MultipleDuplicate()
51
{
52
}
53
 
54
void MultipleDuplicate::setCopiesShiftGap(int sel)
55
{
56
        if (sel==0)
57
        {
58
                horizShiftLabel->setText( tr("&Horizontal Shift:"));
59
                vertShiftLabel->setText( tr("&Vertical Shift:"));
60
        }
61
        else
62
        {
63
                horizShiftLabel->setText( tr("&Horizontal Gap:"));
64
                vertShiftLabel->setText( tr("&Vertical Gap:"));
65
        }
66
}
67
 
6657 cbradney 68
void MultipleDuplicate::getMultiplyData(ItemMultipleDuplicateData& mdData)
6441 cbradney 69
{
8146 fschmid 70
        mdData.type = tabWidget->currentPageIndex();
71
        mdData.copyCount = numberOfCopiesSpinBox->value();
72
        mdData.copyShiftOrGap = copiesCreateButtonGroup->selectedId();
73
        mdData.copyShiftGapH = horizShiftMSpinBox->value();
74
        mdData.copyShiftGapV = vertShiftMSpinBox->value();
75
        mdData.copyRotation = rotationMSpinBox->value();
76
        mdData.gridRows = gridRowsSpinBox->value();
77
        mdData.gridCols = gridColsSpinBox->value();
78
        mdData.gridGapH = horizRCGapMSpinBox->value();
79
        mdData.gridGapV = vertRCGapMSpinBox->value();
6441 cbradney 80
}