Subversion Repositories Scribus

Rev

Rev 12066 | Rev 12597 | 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;
37
        rotate = false;
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
//              rotateCheckBox->hide();
46
                label_3->hide();
47
                gapSpin->hide();
48
                typeCombo->removeItem(3);
49
                typeCombo->removeItem(2);
50
                resize(minimumSizeHint());
51
        }
12066 fschmid 52
        connect(offsetXSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffset(double)));
53
        connect(offsetYSpin, SIGNAL(valueChanged(double)), this, SLOT(newOffsetY(double)));
54
        connect(gapSpin, SIGNAL(valueChanged(double)), this, SLOT(newGap(double)));
55
        connect(typeCombo, SIGNAL(activated(int)), this, SLOT(newType(int)));
56
        connect(previewCheck, SIGNAL(clicked()), this, SLOT(togglePreview()));
57
        connect(rotateCheckBox, SIGNAL(clicked()), this, SLOT(toggleRotate()));
58
}
59
 
60
void PathDialog::toggleRotate()
61
{
62
        rotate = rotateCheckBox->isChecked();
63
        if (previewCheck->isChecked())
64
                emit updateValues(effectType, offset, offsetY, gap, rotate);
65
}
66
 
67
void PathDialog::newOffsetY(double val)
68
{
69
        offsetY = val;
70
        if (previewCheck->isChecked())
71
                emit updateValues(effectType, offset, offsetY, gap, rotate);
72
}
73
 
74
void PathDialog::newOffset(double val)
75
{
76
        offset = val;
77
        if (previewCheck->isChecked())
78
                emit updateValues(effectType, offset, offsetY, gap, rotate);
79
}
80
 
81
void PathDialog::newGap(double val)
82
{
83
        gap = val;
84
        if (previewCheck->isChecked())
85
                emit updateValues(effectType, offset, offsetY, gap, rotate);
86
}
87
 
88
void PathDialog::newType(int val)
89
{
90
        effectType = val;
91
        if (previewCheck->isChecked())
92
                emit updateValues(effectType, offset, offsetY, gap, rotate);
93
}
94
 
95
void PathDialog::togglePreview()
96
{
97
        if (previewCheck->isChecked())
98
                emit updateValues(effectType, offset, offsetY, gap, rotate);
99
        else
100
                emit updateValues(-1, offset, offsetY, gap, rotate);
101
}