Rev 9672 | 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 | |||
9719 | fschmid | 46 | rotationSpinBox->setValues(-180.0, 180.0, 6, 0.0); |
47 | rotationSpinBox->setDecimals(1); |
||
48 | rotationSpinBox->setNewUnit(6); |
||
6441 | cbradney | 49 | |
50 | copiesCreateButtonGroup->setButton(0); |
||
51 | // signals and slots connections |
||
52 | connect(copiesCreateButtonGroup, SIGNAL(clicked(int)), this, SLOT(setCopiesShiftGap(int))); |
||
53 | } |
||
54 | |||
55 | MultipleDuplicate::~MultipleDuplicate() |
||
56 | { |
||
57 | } |
||
58 | |||
59 | void MultipleDuplicate::setCopiesShiftGap(int sel) |
||
60 | { |
||
61 | if (sel==0) |
||
62 | { |
||
63 | horizShiftLabel->setText( tr("&Horizontal Shift:")); |
||
64 | vertShiftLabel->setText( tr("&Vertical Shift:")); |
||
65 | } |
||
66 | else |
||
67 | { |
||
68 | horizShiftLabel->setText( tr("&Horizontal Gap:")); |
||
69 | vertShiftLabel->setText( tr("&Vertical Gap:")); |
||
70 | } |
||
71 | } |
||
72 | |||
6657 | cbradney | 73 | void MultipleDuplicate::getMultiplyData(ItemMultipleDuplicateData& mdData) |
6441 | cbradney | 74 | { |
8146 | fschmid | 75 | mdData.type = tabWidget->currentPageIndex(); |
76 | mdData.copyCount = numberOfCopiesSpinBox->value(); |
||
77 | mdData.copyShiftOrGap = copiesCreateButtonGroup->selectedId(); |
||
8602 | cbradney | 78 | mdData.copyShiftGapH = horizShiftSpinBox->value(); |
79 | mdData.copyShiftGapV = vertShiftSpinBox->value(); |
||
80 | mdData.copyRotation = rotationSpinBox->value(); |
||
8146 | fschmid | 81 | mdData.gridRows = gridRowsSpinBox->value(); |
82 | mdData.gridCols = gridColsSpinBox->value(); |
||
8602 | cbradney | 83 | mdData.gridGapH = horizRCGapSpinBox->value(); |
84 | mdData.gridGapV = vertRCGapSpinBox->value(); |
||
6441 | cbradney | 85 | } |