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

Adam Treat treat at kde.org
Thu May 24 19:33:36 CEST 2007


SVN commit 667988 by treat:

* Default to current plotview


 M  +5 -0      kstmainwindow.cpp  
 M  +1 -0      kstmainwindow.h  
 M  +6 -0      kstplotcommand.cpp  
 M  +1 -0      kstplotcommand.h  


--- branches/work/kst/portto4/kst/src/libkstapp/kstmainwindow.cpp #667987:667988
@@ -48,6 +48,11 @@
 }
 
 
+KstPlotView *KstMainWindow::currentPlotView() const {
+  return qobject_cast<KstPlotView*>(_tabWidget->currentWidget());
+}
+
+
 KstPlotView *KstMainWindow::createPlotView() {
   KstPlotView *plotView = new KstPlotView;
   connect(plotView, SIGNAL(destroyed(QObject*)),
--- branches/work/kst/portto4/kst/src/libkstapp/kstmainwindow.h #667987:667988
@@ -30,6 +30,7 @@
 
   QUndoGroup *undoGroup() const;
   QTabWidget *tabWidget() const;
+  KstPlotView *currentPlotView() const;
 
   KstPlotView *createPlotView();
 
--- branches/work/kst/portto4/kst/src/libkstapp/kstplotcommand.cpp #667987:667988
@@ -10,8 +10,14 @@
  ***************************************************************************/
 
 #include "kstplotcommand.h"
+#include "kstapplication.h"
 #include "kstplotview.h"
 
+KstPlotCommand::KstPlotCommand(const QString &text, QUndoCommand *parent)
+    : QUndoCommand(text, parent), _view(kstApp->mainWindow()->currentPlotView()) {
+}
+
+
 KstPlotCommand::KstPlotCommand(KstPlotView *view, const QString &text, QUndoCommand *parent)
     : QUndoCommand(text, parent), _view(view) {
 }
--- branches/work/kst/portto4/kst/src/libkstapp/kstplotcommand.h #667987:667988
@@ -22,6 +22,7 @@
 class KST_EXPORT KstPlotCommand : public QUndoCommand
 {
 public:
+  KstPlotCommand(const QString &text, QUndoCommand *parent = 0);
   KstPlotCommand(KstPlotView *view, const QString &text, QUndoCommand *parent = 0);
   virtual ~KstPlotCommand();
 


More information about the Kst mailing list