Subversion Repositories Scribus

Rev

Rev 12577 | Rev 12713 | Go to most recent revision | Details | Compare with Previous | 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
 
12577 fschmid 29
PathDialog::PathDialog(QWidget* parent, int unitIndex, bool group) : QDialog(parent)
12066 fschmid 30
{
31
        setupUi(this);
32
        setModal(true);
33
        effectType = 0;
34
        gap = 0.0;
35
        offset = 0.0;
36
        offsetY = 0.0;
12597 fschmid 37
        rotate = 0;
12066 fschmid 38
        offsetXSpin->setNewUnit(unitIndex);
39
        offsetYSpin->setNewUnit(unitIndex);
40
        offsetYSpin->setMinimum(-1000);
41
        offsetYSpin->setMaximum(1000);
42
        gapSpin->setNewUnit(unitIndex);
12577 fschmid 43
        if (group)
44
        {
45
                label_3->hide();
46
                gapSpin->hide();
47
                typeCombo->removeItem(3);
48
                typeCombo->removeItem(2);
49
                resize(minimumSizeHint());
50
        }
12066 fschmid 51
        connect(offsetXSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffset(double)));
52
        connect(offsetYSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffsetY(double)));
53
        connect(gapSpin, SIGNAL(valueChanged(double)), this, SLOT(newGap(double)));
54
        connect(typeCombo, SIGNAL(activated(int)), this, SLOT(newType(int)));
55
        connect(previewCheck, SIGNAL(clicked()), this, SLOT(togglePreview()));
12597 fschmid 56
        connect(rotationCombo, SIGNAL(activated(int)), this, SLOT(toggleRotate(int)));
12066 fschmid 57
}
58
 
12597 fschmid 59
void PathDialog::toggleRotate(int rot)
12066 fschmid 60
{
12597 fschmid 61
        rotate = rot;
12066 fschmid 62
        if (previewCheck->isChecked())
63
                emit updateValues(effectType, offset, offsetY, gap, rotate);
64
}
65
 
66
void PathDialog::newOffsetY(double val)
67
{
68
        offsetY = val;
69
        if (previewCheck->isChecked())
70
                emit updateValues(effectType, offset, offsetY, gap, rotate);
71
}
72
 
73
void PathDialog::newOffset(double val)
74
{
75
        offset = val;
76
        if (previewCheck->isChecked())
77
                emit updateValues(effectType, offset, offsetY, gap, rotate);
78
}
79
 
80
void PathDialog::newGap(double val)
81
{
82
        gap = val;
83
        if (previewCheck->isChecked())
84
                emit updateValues(effectType, offset, offsetY, gap, rotate);
85
}
86
 
87
void PathDialog::newType(int val)
88
{
89
        effectType = val;
90
        if (previewCheck->isChecked())
91
                emit updateValues(effectType, offset, offsetY, gap, rotate);
92
}
93
 
94
void PathDialog::togglePreview()
95
{
96
        if (previewCheck->isChecked())
97
                emit updateValues(effectType, offset, offsetY, gap, rotate);
98
        else
99
                emit updateValues(-1, offset, offsetY, gap, rotate);
100
}