[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jun 4 21:52:40 CEST 2004


CVS commit by staikos: 

added CTRL+A, CTRL+SHIFT+A in layout mode, and make some cases more strict
for passthrough of events


  M +12 -0     kstviewobject.cpp   1.57
  M +2 -0      kstviewobject.h   1.46
  M +17 -6     kstviewwidget.cpp   1.35


--- kdeextragear-2/kst/kst/kstviewobject.cpp  #1.56:1.57
@@ -894,4 +894,16 @@ void KstViewObject::dropEvent(QWidget *v
 
 
+void KstViewObject::selectAll() {
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    (*i)->setSelected(true);
+  }
+}
+
+void KstViewObject::unselectAll() {
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    (*i)->setSelected(false);
+  }
+}
+
 #include "kstviewobject.moc"
 // vim: ts=2 sw=2 et

--- kdeextragear-2/kst/kst/kstviewobject.h  #1.45:1.46
@@ -134,4 +134,6 @@ class KstViewObject : public KstObject {
     virtual bool isSelected() const;
     virtual void setSelected(bool selected);
+    void selectAll();
+    void unselectAll();
 
     virtual void recursivelyQuery(bool (KstViewObject::*method)() const, KstViewObjectList& list, bool matchRecurse = false);

--- kdeextragear-2/kst/kst/kstviewwidget.cpp  #1.34:1.35
@@ -259,5 +259,5 @@ void KstViewWidget::dragEnterEvent(QDrag
       e->acceptAction(true);
     }
-  } else {
+  } else if (_view->viewMode() != KstTopLevelView::LayoutMode) {
     KstViewObjectPtr vo = findChildFor(e->pos());
     if (vo) {
@@ -274,5 +274,5 @@ void KstViewWidget::dragMoveEvent(QDragM
   if (_dragEnabled && e->provides(KstPlotDrag::mimeType())) {
     e->accept(true);
-  } else {
+  } else if (_view->viewMode() != KstTopLevelView::LayoutMode) {
     KstViewObjectPtr vo = findChildFor(e->pos());
     if (vo) {
@@ -303,5 +303,5 @@ void KstViewWidget::dropEvent(QDropEvent
     e->acceptAction(true);
     _view->paint();
-  } else {
+  } else if (_view->viewMode() != KstTopLevelView::LayoutMode) {
     KstViewObjectPtr vo = findChildFor(e->pos());
     if (vo) {
@@ -333,7 +333,18 @@ void KstViewWidget::keyPressEvent(QKeyEv
     }
     return;
-  } else if (e->key() == Qt::Key_Escape && _view->viewMode() == KstTopLevelView::LayoutMode) {
+  } else if (_view->viewMode() == KstTopLevelView::LayoutMode) {
+    ButtonState s = e->stateAfter();
+    if (e->key() == Qt::Key_Escape) {
     _view->cancelMouseOperations();
     return;
+    } else if (e->key() == Qt::Key_A && s & Qt::ControlButton) {
+      if (s & Qt::ShiftButton) {
+        _view->unselectAll();
+      } else {
+        _view->selectAll();
+      }
+      paint();
+      return;
+    }
   }
 





More information about the Kst mailing list