]> Shamusworld >> Repos - architektonas/blob - src/forms/snapdistoptions.cpp
9f932cff4a57a6bd780f0a84330108fb85369fe5
[architektonas] / src / forms / snapdistoptions.cpp
1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
3 **
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
9
10 void QG_SnapDistOptions::destroy()
11 {
12         RS_SETTINGS->beginGroup("/Snap");
13         RS_SETTINGS->writeEntry("/Distance", leDist->text());
14         RS_SETTINGS->endGroup();
15 }
16
17 void QG_SnapDistOptions::setDist(double * d)
18 {
19         dist = d;
20
21         RS_SETTINGS->beginGroup("/Snap");
22         QString r = RS_SETTINGS->readEntry("/Distance", "1.0");
23         RS_SETTINGS->endGroup();
24
25         leDist->setText(r);
26 }
27
28 void QG_SnapDistOptions::updateDist(const QString & d)
29 {
30         if (dist != NULL)
31                 *dist = RS_Math::eval(d, 1.0);
32 }
33