[Kst] [Bug 130278] Optionally remember settings for view object creation
Andrew Walker
arwalker at sumusltd.com
Wed Aug 29 01:33:58 CEST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=130278
------- Additional Comments From arwalker sumusltd com 2007-08-29 01:33 -------
SVN commit 705937 by arwalker:
CCBUG:130278 Add set defaults and restore defaults button to the edit view object dialog. This allows the user to create session defaults for each of the view objects.
M +10 -4 kstgfxmousehandler.cpp
--- branches/work/kst/1.5/kst/src/libkstapp/kstgfxmousehandler.cpp #705936:705937
@ -36,6 +36,7 @
void KstGfxMouseHandler::handlePress(KstTopLevelViewPtr view, const QPoint& pos, bool shift) {
Q_UNUSED(view)
Q_UNUSED(shift)
+
_mouseOrigin = pos;
_mouseMoved = false;
_cancelled = false;
@ -44,16 +45,21 @
void KstGfxMouseHandler::saveDefaults(KstViewObjectPtr obj) {
- _defaultObject = obj;
+ _currentDefaultObject = obj;
}
+void KstGfxMouseHandler::restoreDefaults() {
+ _currentDefaultObject = _defaultObject;
+}
+
+
void KstGfxMouseHandler::copyDefaults(KstViewObjectPtr newObj) {
if (_defaultObject) {
- int numProperties = _defaultObject->metaObject()->numProperties(true);
+ int numProperties = _currentDefaultObject->metaObject()->numProperties(true);
for (int i = 0; i < numProperties; i++) {
- const QMetaProperty* property = _defaultObject->metaObject()->property(i, true);
- newObj->setProperty(property->name(), _defaultObject->property(property->name()));
+ const QMetaProperty* property = _currentDefaultObject->metaObject()->property(i, true);
+ newObj->setProperty(property->name(), _currentDefaultObject->property(property->name()));
}
}
}
More information about the Kst
mailing list