3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 06/12/2010 Created this file. :-)
17 #include "dlgrotate2.h"
19 #include "modification.h"
22 DlgRotate2::DlgRotate2(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
23 QDialog(parent, flags)
27 settings.beginGroup("Modify");
28 copies = settings.value("Rotate2Copies", "10").toString();
29 numberMode = settings.value("Rotate2Mode", 0).toInt();
30 useCurrentLayer = settings.value("Rotate2UseCurrentLayer", false).toBool();
31 useCurrentAttributes = settings.value("MoveRotate2UseCurrentAttributes", false).toBool();
32 angle1 = settings.value("Rotate2Angle1", "30.0").toString();
33 angle2 = settings.value("Rotate2Angle2", "-30.0").toString();
39 ui.rbMove->setChecked(true);
43 ui.rbCopy->setChecked(true);
47 ui.rbMultiCopy->setChecked(true);
54 ui.leNumber->setText(copies);
55 ui.leAngle1->setText(angle1);
56 ui.leAngle2->setText(angle2);
57 ui.cbCurrentAttributes->setChecked(useCurrentAttributes);
58 ui.cbCurrentLayer->setChecked(useCurrentLayer);
61 DlgRotate2::~DlgRotate2()
63 settings.beginGroup("Modify");
64 settings.setValue("Rotate2Copies", ui.leNumber->text());
66 if (ui.rbMove->isChecked())
68 else if (ui.rbCopy->isChecked())
73 settings.setValue("Rotate2Mode", numberMode);
74 settings.setValue("Rotate2Angle1", ui.leAngle1->text());
75 settings.setValue("Rotate2Angle2", ui.leAngle2->text());
76 settings.setValue("Rotate2UseCurrentLayer", ui.cbCurrentLayer->isChecked());
77 settings.setValue("Rotate2UseCurrentAttributes", ui.cbCurrentAttributes->isChecked());
81 void DlgRotate2::setData(Rotate2Data * d)
85 //leAngle1->setText(QString("%1").arg(Math::rad2deg(data->angle1)));
86 //leAngle2->setText(QString("%1").arg(Math::rad2deg(data->angle2)));
89 void DlgRotate2::updateData()
91 if (ui.rbMove->isChecked())
93 else if (ui.rbCopy->isChecked())
96 data->number = ui.leNumber->text().toInt();
98 data->angle1 = Math::deg2rad(Math::eval(ui.leAngle1->text()));
99 data->angle2 = Math::deg2rad(Math::eval(ui.leAngle2->text()));
100 data->useCurrentAttributes = ui.cbCurrentAttributes->isChecked();
101 data->useCurrentLayer = ui.cbCurrentLayer->isChecked();