Subversion Repositories Scribus

Rev

Rev 12577 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12066 fschmid 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
/**************************************************************************
8
*   Copyright (C) 2007 by Franz Schmid                                    *
9
*   franz.schmid@altmuehlnet.de                                           *
10
*                                                                         *
11
*   This program is free software; you can redistribute it and/or modify  *
12
*   it under the terms of the GNU General Public License as published by  *
13
*   the Free Software Foundation; either version 2 of the License, or     *
14
*   (at your option) any later version.                                   *
15
*                                                                         *
16
*   This program is distributed in the hope that it will be useful,       *
17
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
*   GNU General Public License for more details.                          *
20
*                                                                         *
21
*   You should have received a copy of the GNU General Public License     *
22
*   along with this program; if not, write to the                         *
23
*   Free Software Foundation, Inc.,                                       *
24
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
***************************************************************************/
26
 
27
#include "pathdialog.h"
28
 
29
PathDialog::PathDialog(QWidget* parent, int unitIndex) : QDialog(parent)
30
{
31
        setupUi(this);
32
        setModal(true);
33
        effectType = 0;
34
        gap = 0.0;
35
        offset = 0.0;
36
        offsetY = 0.0;
37
        rotate = false;
38
        offsetXSpin->setNewUnit(unitIndex);
39
        offsetYSpin->setNewUnit(unitIndex);
40
        offsetYSpin->setMinimum(-1000);
41
        offsetYSpin->setMaximum(1000);
42
        gapSpin->setNewUnit(unitIndex);
43
        connect(offsetXSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffset(double)));
44
        connect(offsetYSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffsetY(double)));
45
        connect(gapSpin, SIGNAL(valueChanged(double)), this, SLOT(newGap(double)));
46
        connect(typeCombo, SIGNAL(activated(int)), this, SLOT(newType(int)));
47
        connect(previewCheck, SIGNAL(clicked()), this, SLOT(togglePreview()));
48
        connect(rotateCheckBox, SIGNAL(clicked()), this, SLOT(toggleRotate()));
49
}
50
 
51
void PathDialog::toggleRotate()
52
{
53
        rotate = rotateCheckBox->isChecked();
54
        if (previewCheck->isChecked())
55
                emit updateValues(effectType, offset, offsetY, gap, rotate);
56
}
57
 
58
void PathDialog::newOffsetY(double val)
59
{
60
        offsetY = val;
61
        if (previewCheck->isChecked())
62
                emit updateValues(effectType, offset, offsetY, gap, rotate);
63
}
64
 
65
void PathDialog::newOffset(double val)
66
{
67
        offset = val;
68
        if (previewCheck->isChecked())
69
                emit updateValues(effectType, offset, offsetY, gap, rotate);
70
}
71
 
72
void PathDialog::newGap(double val)
73
{
74
        gap = val;
75
        if (previewCheck->isChecked())
76
                emit updateValues(effectType, offset, offsetY, gap, rotate);
77
}
78
 
79
void PathDialog::newType(int val)
80
{
81
        effectType = val;
82
        if (previewCheck->isChecked())
83
                emit updateValues(effectType, offset, offsetY, gap, rotate);
84
}
85
 
86
void PathDialog::togglePreview()
87
{
88
        if (previewCheck->isChecked())
89
                emit updateValues(effectType, offset, offsetY, gap, rotate);
90
        else
91
                emit updateValues(-1, offset, offsetY, gap, rotate);
92
}