[Kst] branches/work/kst/portto4/kst/src/libkstapp
Barth Netterfield
netterfield at astro.utoronto.ca
Mon Jun 18 16:42:44 UTC 2012
SVN commit 1301720 by netterfield:
Save/use arrow head property defaults.
M +13 -0 arrowitem.cpp
M +1 -0 arrowitem.h
M +11 -0 arrowitemdialog.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/arrowitem.cpp #1301719:1301720
@@ -14,6 +14,7 @@
#include "view.h"
#include "arrowitemdialog.h"
+#include "dialogdefaults.h"
#include "math_kst.h"
@@ -38,6 +39,7 @@
applyDialogDefaultsStroke();
applyDialogDefaultsLockPosToData();
+ applyDialogDefaultsHeads();
}
@@ -201,6 +203,17 @@
return rc;
}
+void ArrowItem::applyDialogDefaultsHeads() {
+ _endArrowHead = _dialogDefaults->value("arrow/hasEndHead",true).toBool();
+ if (_endArrowHead) {
+ _endArrowScale = _dialogDefaults->value("arrow/endHeadScale",12).toDouble();
}
+ _startArrowHead = _dialogDefaults->value("arrow/hasStartHead",false).toBool();
+ if (_startArrowHead) {
+ _startArrowScale = _dialogDefaults->value("arrow/startHeadScale",12).toDouble();
+ }
+}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/arrowitem.h #1301719:1301720
@@ -50,6 +50,7 @@
virtual QPainterPath shape() const;
virtual bool customDimensionsTab() {return true;}
+ void applyDialogDefaultsHeads();
public Q_SLOTS:
virtual void edit();
--- branches/work/kst/portto4/kst/src/libkstapp/arrowitemdialog.cpp #1301719:1301720
@@ -15,6 +15,7 @@
#include "arrowitem.h"
#include "arrowpropertiestab.h"
#include "dialogpage.h"
+#include "dialogdefaults.h"
#include "application.h"
#include "objectstore.h"
#include "mainwindow.h"
@@ -55,7 +56,17 @@
_arrowItem->setStartArrowScale(_propertiesTab->startArrowScale());
_arrowItem->setEndArrowScale(_propertiesTab->endArrowScale());
+ if (_saveAsDefault->isChecked()) {
+ _dialogDefaults->setValue("arrow/hasEndHead", QVariant(_arrowItem->endArrowHead()).toString());
+ if (_arrowItem->endArrowHead()) {
+ _dialogDefaults->setValue("arrow/endHeadScale", _arrowItem->endArrowScale());
}
+ _dialogDefaults->setValue("arrow/hasStartHead", QVariant(_arrowItem->startArrowHead()).toString());
+ if (_arrowItem->startArrowHead()) {
+ _dialogDefaults->setValue("arrow/startHeadScale", _arrowItem->startArrowScale());
+ }
+ }
+}
}
More information about the Kst
mailing list