[Kst] branches/work/kst/1.5/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Wed Aug 29 01:33:54 CEST 2007


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