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 "dlgrotate.h"
19 #include "modification.h"
22 DlgRotate::DlgRotate(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
23 QDialog(parent, flags)
27 settings.beginGroup("Modify");
28 copies = settings.value("RotateCopies", "10").toString();
29 numberMode = settings.value("RotateMode", 0).toInt();
30 angle = settings.value("RotateAngle", "90.0").toString();
31 useCurrentLayer = settings.value("RotateUseCurrentLayer", false).toBool();
32 useCurrentAttributes = settings.value("RotateUseCurrentAttributes", false).toBool();
38 ui.rbMove->setChecked(true);
42 ui.rbCopy->setChecked(true);
46 ui.rbMultiCopy->setChecked(true);
53 ui.leNumber->setText(copies);
54 ui.leAngle->setText(angle);
55 ui.cbCurrentAttributes->setChecked(useCurrentAttributes);
56 ui.cbCurrentLayer->setChecked(useCurrentLayer);
59 DlgRotate::~DlgRotate()
61 settings.beginGroup("Modify");
62 settings.setValue("RotateCopies", ui.leNumber->text());
64 if (ui.rbMove->isChecked())
66 else if (ui.rbCopy->isChecked())
71 settings.setValue("RotateMode", numberMode);
72 settings.setValue("RotateAngle", ui.leAngle->text());
73 settings.setValue("RotateUseCurrentLayer", ui.cbCurrentLayer->isChecked());
74 settings.setValue("RotateUseCurrentAttributes", ui.cbCurrentAttributes->isChecked());
78 void DlgRotate::setData(RotateData * d)
83 void DlgRotate::updateData()
85 if (ui.rbMove->isChecked())
87 else if (ui.rbCopy->isChecked())
90 data->number = ui.leNumber->text().toInt();
92 data->angle = Math::deg2rad(Math::eval(ui.leAngle->text()));
93 data->useCurrentAttributes = ui.cbCurrentAttributes->isChecked();
94 data->useCurrentLayer = ui.cbCurrentLayer->isChecked();