Subversion Repositories Scribus

Rev

Rev 6444 | Go to most recent revision | Details | 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
 
10
#include <qbuttongroup.h>
11
#include <qlabel.h>
12
#include <qpushbutton.h>
13
#include <qspinbox.h>
14
#include <qtabwidget.h>
15
 
16
#include "mspinbox.h"
17
#include "units.h"
18
 
19
MultipleDuplicate::MultipleDuplicate( int unitIndex, QWidget* parent, const char* name, WFlags fl )
20
        : MultipleDuplicateBase(parent, name, fl),
21
        m_unitIndex(unitIndex)
22
{
23
        int decimals = unitGetDecimalsFromIndex(unitIndex);
24
        QString unitSuffix(unitGetSuffixFromIndex(unitIndex));
25
        horizShiftMSpinBox->setValues(0.0, 1000.0, decimals, 0.0);
26
        vertShiftMSpinBox->setValues(0.0, 1000.0, decimals, 0.0);
27
        horizRCGapMSpinBox->setValues(0.0, 1000.0, decimals, 0.0);
28
        vertRCGapMSpinBox->setValues(0.0, 1000.0, decimals, 0.0);
29
        horizShiftMSpinBox->setSuffix(unitSuffix);
30
        vertShiftMSpinBox->setSuffix(unitSuffix);
31
        horizRCGapMSpinBox->setSuffix(unitSuffix);
32
        vertRCGapMSpinBox->setSuffix(unitSuffix);
33
 
34
        copiesCreateButtonGroup->setButton(0);
35
        // signals and slots connections
36
        connect(copiesCreateButtonGroup, SIGNAL(clicked(int)), this, SLOT(setCopiesShiftGap(int)));
37
}
38
 
39
MultipleDuplicate::~MultipleDuplicate()
40
{
41
}
42
 
43
void MultipleDuplicate::setCopiesShiftGap(int sel)
44
{
45
        if (sel==0)
46
        {
47
                horizShiftLabel->setText( tr("&Horizontal Shift:"));
48
                vertShiftLabel->setText( tr("&Vertical Shift:"));
49
        }
50
        else
51
        {
52
                horizShiftLabel->setText( tr("&Horizontal Gap:"));
53
                vertShiftLabel->setText( tr("&Vertical Gap:"));
54
        }
55
}
56
 
57
void MultipleDuplicate::getMultiplyData(itemMultipleDuplicateData& mdData)
58
{
59
        mdData.duplicateType=tabWidget->currentPageIndex();
60
        mdData.copyCount=numberOfCopiesSpinBox->value();
61
        mdData.copyShiftOrGap=copiesCreateButtonGroup->selectedId();
62
        mdData.copyShiftGapH=horizShiftMSpinBox->value();
63
        mdData.copyShiftGapV=vertShiftMSpinBox->value();
64
        mdData.gridRows=gridRowsSpinBox->value();
65
        mdData.gridCols=gridColsSpinBox->value();
66
        mdData.gridGapH=horizRCGapMSpinBox->value();
67
        mdData.gridGapV=vertRCGapMSpinBox->value();
68
}