[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Mon Sep 24 17:29:59 CEST 2007
SVN commit 716360 by treat:
* Implement bits of datamanager and cleanup
some other files.
M +78 -9 datamanager.cpp
M +16 -3 datamanager.h
M +35 -36 datamanager.ui
M +4 -4 debugdialog.cpp
M +5 -5 debugdialog.h
M +2 -2 exportgraphicsdialog.cpp
M +6 -6 exportgraphicsdialog.h
M +3 -0 libkstapp.pro
M +3 -1 mainwindow.cpp
A vectordialog.cpp [License: GPL (v2+)]
A vectordialog.h [License: GPL (v2+)]
M +0 -3 vectordialog.ui
M +4 -4 vectoreditordialog.cpp
M +6 -3 vectoreditordialog.h
M +1 -1 vectoreditordialog.ui
M +5 -4 viewmanager.cpp
M +6 -6 viewmanager.h
M +1 -1 viewmanager.ui
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.cpp #716359:716360
@@ -11,27 +11,96 @@
#include "datamanager.h"
+#include "vectordialog.h"
+
#include "document.h"
#include "sessionmodel.h"
+#include <QToolBar>
+
namespace Kst {
DataManager::DataManager(QWidget *parent, Document *doc)
-: QDialog(parent), _doc(doc) {
- ui.setupUi(this);
- ui.session->setModel(doc->session());
- QWidget *w = new QWidget(ui.objects);
- ui.objects->addItem(w, tr("Data"));
- w = new QWidget(ui.objects);
- ui.objects->addItem(w, tr("Objects"));
- w = new QWidget(ui.objects);
- ui.objects->addItem(w, tr("Plugins"));
+ : QDialog(parent), _doc(doc) {
+
+ setupUi(this);
+ _session->setModel(doc->session());
+
+ _primitives = new QToolBar(_objects);
+ _primitives->setOrientation(Qt::Vertical);
+ _primitives->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ _dataObjects = new QToolBar(_objects);
+ _dataObjects->setOrientation(Qt::Vertical);
+ _dataObjects->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ _fits = new QToolBar(_objects);
+ _fits->setOrientation(Qt::Vertical);
+ _fits->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ _filters = new QToolBar(_objects);
+ _filters->setOrientation(Qt::Vertical);
+ _filters->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ _objects->addItem(_primitives, tr("Create Primitive"));
+ _objects->addItem(_dataObjects, tr("Create Data Object"));
+ _objects->addItem(_fits, tr("Create Fit"));
+ _objects->addItem(_filters, tr("Create Filter"));
+
+// Create canonical items...
+
+//FIXME "Scalar"
+
+ QAction *action = _primitives->addAction(tr("Vector"));
+ connect(action, SIGNAL(triggered()), this, SLOT(showVectorDialog()));
+ QWidget *widget = _primitives->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _primitives->addAction(tr("Matrix"));
+ widget = _primitives->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+//FIXME "String"
+
+ action = _dataObjects->addAction(tr("Curve"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("Equation"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("Histogram"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("Power Spectrum"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("Event Monitor"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("Image"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ action = _dataObjects->addAction(tr("CSD"));
+ widget = _dataObjects->widgetForAction(action);
+ widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
}
DataManager::~DataManager() {
}
+
+void DataManager::showVectorDialog() {
+ VectorDialog dialog(this);
+ dialog.exec();
}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.h #716359:716360
@@ -13,21 +13,34 @@
#define DATAMANAGER_H
#include <QDialog>
+
#include "ui_datamanager.h"
+#include "kst_export.h"
+
+class QToolBar;
+
namespace Kst {
+
class Document;
-class DataManager : public QDialog
+class KST_EXPORT DataManager : public QDialog, Ui::DataManager
{
Q_OBJECT
public:
DataManager(QWidget *parent, Document *doc);
- ~DataManager();
+ virtual ~DataManager();
+ private Q_SLOTS:
+ void showVectorDialog();
+
private:
- Ui::DataManager ui;
Document *_doc;
+
+ QToolBar *_primitives;
+ QToolBar *_dataObjects;
+ QToolBar *_fits;
+ QToolBar *_filters;
};
}
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.ui #716359:716360
@@ -12,48 +12,47 @@
<property name="windowTitle" >
<string>Data Manager</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" colspan="2" >
- <widget class="QDialogButtonBox" name="buttonBox" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QSplitter" name="_splitter" >
+ <property name="layoutDirection" >
+ <enum>Qt::LeftToRight</enum>
+ </property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton</set>
+ <property name="childrenCollapsible" >
+ <bool>false</bool>
</property>
+ <widget class="QToolBox" name="_objects" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex" >
+ <number>-1</number>
+ </property>
+ </widget>
+ <widget class="QTreeView" name="_session" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QTreeView" name="session" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item>
+ <widget class="QDialogButtonBox" name="_buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QToolBox" name="objects" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Close</set>
</property>
- <property name="currentIndex" >
- <number>0</number>
- </property>
</widget>
</item>
</layout>
@@ -61,7 +60,7 @@
<resources/>
<connections>
<connection>
- <sender>buttonBox</sender>
+ <sender>_buttonBox</sender>
<signal>accepted()</signal>
<receiver>DataManager</receiver>
<slot>accept()</slot>
@@ -77,7 +76,7 @@
</hints>
</connection>
<connection>
- <sender>buttonBox</sender>
+ <sender>_buttonBox</sender>
<signal>rejected()</signal>
<receiver>DataManager</receiver>
<slot>reject()</slot>
--- branches/work/kst/portto4/kst/src/libkstapp/debugdialog.cpp #716359:716360
@@ -17,8 +17,8 @@
namespace Kst {
DebugDialog::DebugDialog(QWidget *parent)
-: QDialog(parent) {
- ui.setupUi(this);
+ : QDialog(parent) {
+ setupUi(this);
}
@@ -32,13 +32,13 @@
if (le) {
switch (le->_eventType) {
case LogEvent::LogAdded:
- ui._log->append(le->_msg.msg);
+ _log->append(le->_msg.msg);
if (le->_msg.level == KstDebug::Error) {
emit notifyOfError();
}
break;
case LogEvent::LogCleared:
- ui._log->clear();
+ _log->clear();
emit notifyAllClear();
break;
default:
--- branches/work/kst/portto4/kst/src/libkstapp/debugdialog.h #716359:716360
@@ -13,16 +13,19 @@
#define DEBUGDIALOG_H
#include <QDialog>
+
#include "ui_debugdialog.h"
+#include "kst_export.h"
+
namespace Kst {
-class DebugDialog : public QDialog
+class KST_EXPORT DebugDialog : public QDialog, Ui::DebugDialog
{
Q_OBJECT
public:
DebugDialog(QWidget *parent);
- ~DebugDialog();
+ virtual ~DebugDialog();
Q_SIGNALS:
void notifyOfError();
@@ -30,9 +33,6 @@
protected:
bool event(QEvent *e);
-
- private:
- Ui::DebugDialog ui;
};
}
--- branches/work/kst/portto4/kst/src/libkstapp/exportgraphicsdialog.cpp #716359:716360
@@ -16,8 +16,8 @@
namespace Kst {
ExportGraphicsDialog::ExportGraphicsDialog(MainWindow *parent)
-: QDialog(parent), _win(parent) {
- ui.setupUi(this);
+ : QDialog(parent) {
+ setupUi(this);
}
--- branches/work/kst/portto4/kst/src/libkstapp/exportgraphicsdialog.h #716359:716360
@@ -13,21 +13,21 @@
#define EXPORTGRAPHICSDIALOG_H
#include <QDialog>
+
#include "ui_exportgraphicsdialog.h"
+#include "kst_export.h"
+
namespace Kst {
+
class MainWindow;
-class ExportGraphicsDialog : public QDialog
+class KST_EXPORT ExportGraphicsDialog : public QDialog, Ui::ExportGraphicsDialog
{
Q_OBJECT
public:
ExportGraphicsDialog(MainWindow *win);
- ~ExportGraphicsDialog();
-
- private:
- Ui::ExportGraphicsDialog ui;
- MainWindow *_win;
+ virtual ~ExportGraphicsDialog();
};
}
--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #716359:716360
@@ -55,6 +55,7 @@
stroketab.cpp \
svgitem.cpp \
tabwidget.cpp \
+ vectordialog.cpp \
vectoreditordialog.cpp \
vectorcurverenderitem.cpp \
vectormodel.cpp \
@@ -104,6 +105,7 @@
svgitem.h \
stroketab.h \
tabwidget.h \
+ vectordialog.h \
vectoreditordialog.h \
vectormodel.h \
vectorcurverenderitem.h \
@@ -126,6 +128,7 @@
gridtab.ui \
layouttab.ui \
stroketab.ui \
+ vectordialog.ui \
vectoreditordialog.ui \
viewmanager.ui
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #716359:716360
@@ -486,7 +486,7 @@
_viewManagerAct->setIcon(QPixmap(":kst_viewmanager.png"));
connect(_viewManagerAct, SIGNAL(triggered()), this, SLOT(showViewManager()));
- _vectorEditorAct = new QAction(tr("&Vectors..."), this);
+ _vectorEditorAct = new QAction(tr("&Edit Vectors..."), this);
_vectorEditorAct->setStatusTip(tr("Show all vectors in a spreadsheet"));
connect(_vectorEditorAct, SIGNAL(triggered()), this, SLOT(showVectorEditor()));
@@ -527,10 +527,12 @@
_dataMenu = menuBar()->addMenu(tr("&Data"));
_dataMenu->addAction(_dataManagerAct);
+ _dataMenu->addSeparator();
_dataMenu->addAction(_vectorEditorAct);
_viewMenu = menuBar()->addMenu(tr("&View"));
_viewMenu->addAction(_viewManagerAct);
+ _viewMenu->addSeparator();
_layoutMenu = _viewMenu->addMenu(tr("&Layout"));
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.ui #716359:716360
@@ -386,9 +386,6 @@
<tabstop>_xMin</tabstop>
<tabstop>_xMax</tabstop>
</tabstops>
- <includes>
- <include location="local" >kstdatarange.h</include>
- </includes>
<resources/>
<connections/>
</ui>
--- branches/work/kst/portto4/kst/src/libkstapp/vectoreditordialog.cpp #716359:716360
@@ -19,7 +19,7 @@
namespace Kst {
VectorEditorDialog::VectorEditorDialog(QWidget *parent, Document *doc)
-: QDialog(parent), _doc(doc) {
+ : QDialog(parent), _doc(doc) {
_model = new VectorTableModel;
// TODO: Extract this model so the dialog can be reused, and make a new model
// or modification to the model so that it tracks all the vector creates and
@@ -30,13 +30,13 @@
_model->vectors().append(vm);
}
KST::vectorList.lock().unlock();
- ui.setupUi(this);
- ui.vectors->setModel(_model);
+ setupUi(this);
+ _vectors->setModel(_model);
}
VectorEditorDialog::~VectorEditorDialog() {
- ui.vectors->setModel(0);
+ _vectors->setModel(0);
qDeleteAll(_model->vectors());
_model->vectors().clear();
delete _model;
--- branches/work/kst/portto4/kst/src/libkstapp/vectoreditordialog.h #716359:716360
@@ -13,21 +13,24 @@
#define VECTOREDITORDIALOG_H
#include <QDialog>
+
#include "ui_vectoreditordialog.h"
+#include "kst_export.h"
+
namespace Kst {
+
class Document;
class VectorTableModel;
-class VectorEditorDialog : public QDialog
+class KST_EXPORT VectorEditorDialog : public QDialog, Ui::VectorEditorDialog
{
Q_OBJECT
public:
VectorEditorDialog(QWidget *parent, Document *doc);
- ~VectorEditorDialog();
+ virtual ~VectorEditorDialog();
private:
- Ui::VectorEditorDialog ui;
Document *_doc;
VectorTableModel *_model;
};
--- branches/work/kst/portto4/kst/src/libkstapp/vectoreditordialog.ui #716359:716360
@@ -20,7 +20,7 @@
<number>6</number>
</property>
<item row="0" column="0" >
- <widget class="QTableView" name="vectors" />
+ <widget class="QTableView" name="_vectors" />
</item>
<item row="1" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
--- branches/work/kst/portto4/kst/src/libkstapp/viewmanager.cpp #716359:716360
@@ -11,6 +11,7 @@
#include "viewmanager.h"
+#include "application.h"
#include "mainwindow.h"
#include "sessionmodel.h"
#include "tabwidget.h"
@@ -21,13 +22,13 @@
namespace Kst {
ViewManager::ViewManager(MainWindow *parent)
-: QDialog(parent), _win(parent) {
- ui.setupUi(this);
- View *v = _win->tabWidget()->currentView();
+ : QDialog(parent) {
+ setupUi(this);
+ View *v = kstApp->mainWindow()->tabWidget()->currentView();
if (v) {
QGraphicsScene *scene = v->scene();
// Setup a model for the scene
- //ui.view->setModel(scene);
+ //_view->setModel(scene);
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/viewmanager.h #716359:716360
@@ -13,21 +13,21 @@
#define VIEWMANAGER_H
#include <QDialog>
+
#include "ui_viewmanager.h"
+#include "kst_export.h"
+
namespace Kst {
+
class MainWindow;
-class ViewManager : public QDialog
+class KST_EXPORT ViewManager : public QDialog, Ui::ViewManager
{
Q_OBJECT
public:
ViewManager(MainWindow *parent);
- ~ViewManager();
-
- private:
- Ui::ViewManager ui;
- MainWindow *_win;
+ virtual ~ViewManager();
};
}
--- branches/work/kst/portto4/kst/src/libkstapp/viewmanager.ui #716359:716360
@@ -14,7 +14,7 @@
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QTreeView" name="view" />
+ <widget class="QTreeView" name="_view" />
</item>
<item row="1" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
More information about the Kst
mailing list