6 changes: 6 additions & 0 deletions src/libkstapp/scalardialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ ObjectPtr ScalarDialog::createNewGeneratedScalar(){

_dataObjectName = scalar->Name();

//UpdateServer::self()->requestUpdateSignal();

return static_cast<ObjectPtr>(scalar);
}

Expand Down Expand Up @@ -375,6 +377,8 @@ ObjectPtr ScalarDialog::createNewDataScalar() {

_dataObjectName = scalar->Name();

//UpdateServer::self()->requestUpdateSignal();

return scalar;
}

Expand Down Expand Up @@ -406,6 +410,8 @@ ObjectPtr ScalarDialog::createNewVScalar() {

_dataObjectName = scalar->Name();

//UpdateServer::self()->requestUpdateSignal();

return scalar;
}

Expand Down
6 changes: 5 additions & 1 deletion src/libkstapp/scriptserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "viewitemscriptinterface.h"

#include "sessionmodel.h"
#include "updateserver.h"
#include "datagui.h"

//viewitems
Expand Down Expand Up @@ -613,6 +614,7 @@ QByteArray ScriptServer::newEditableVectorAndGetHandle(QByteArray&, QLocalSocket
objectPtr->setDescriptiveName("Script Vector");
objectPtr->unlock();
UpdateManager::self()->doUpdates(1);
UpdateServer::self()->requestUpdateSignal();
return handleResponse("Finished editing "+objectPtr->Name().toLatin1(),s,ifMode,ifEqual,_if,var);
}

Expand Down Expand Up @@ -663,6 +665,7 @@ QByteArray ScriptServer::newEditableMatrixAndGetHandle(QByteArray&, QLocalSocket
objectPtr->setDescriptiveName("Script Matrix");
objectPtr->unlock();
UpdateManager::self()->doUpdates(1);
UpdateServer::self()->requestUpdateSignal();
return handleResponse("Finished editing "+objectPtr->Name().toLatin1(),s,ifMode,ifEqual,_if,var);
}

Expand Down Expand Up @@ -1065,7 +1068,8 @@ QByteArray ScriptServer::eliminate(QByteArray&command, QLocalSocket* s,ObjectSto
Data::self()->removeCurveFromPlots(relation);
}
_store->removeObject(o);
kstApp->mainWindow()->document()->session()->triggerReset();
UpdateServer::self()->requestUpdateSignal();

return handleResponse("It died a peaceful death.",s,ifMode,ifEqual,_if,var);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/libkstapp/sessionmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
***************************************************************************/

#include "sessionmodel.h"
#include "updateserver.h"

#include <assert.h>
#include <objectstore.h>
Expand All @@ -28,6 +29,8 @@ namespace Kst {
SessionModel::SessionModel(ObjectStore *store)
: QAbstractItemModel(), _store(store) {
generateObjectList();

connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(triggerReset()));
}


Expand Down
7 changes: 6 additions & 1 deletion src/libkstapp/sessionmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ObjectStore;

class SessionModel : public QAbstractItemModel
{
Q_OBJECT

public:
SessionModel(ObjectStore *store);
~SessionModel();
Expand All @@ -36,8 +38,11 @@ class SessionModel : public QAbstractItemModel
QModelIndex parent(const QModelIndex& index) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
void generateObjectList();
void triggerReset();
ObjectList<Object> *objectList() {return &_objectList;}

public Q_SLOTS:
void triggerReset();

private:
QVariant dataObjectOutputData(DataObjectPtr parent, const QModelIndex& index) const;
QVariant primitiveData(PrimitivePtr parent, const QModelIndex& index) const;
Expand Down
4 changes: 4 additions & 0 deletions src/libkstapp/stringdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ ObjectPtr StringDialog::createNewGeneratedString(){

_dataObjectName = string->Name();

//UpdateServer::self()->requestUpdateSignal();

return static_cast<ObjectPtr>(string);
}

Expand Down Expand Up @@ -311,6 +313,8 @@ ObjectPtr StringDialog::createNewDataString() {

_dataObjectName = string->Name();

//UpdateServer::self()->requestUpdateSignal();

return string;
}

Expand Down
3 changes: 2 additions & 1 deletion src/libkstapp/stringscriptinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "scriptinterface.h"
#include "string_kst.h"
#include "updatemanager.h"
#include "updateserver.h"
typedef QList<QByteArray> QByteArrayList;

namespace Kst {
Expand All @@ -35,7 +36,7 @@ class StringGenSI : public ScriptInterface
QString doCommand(QString);
bool isValid();
QByteArray getHandle();
void endEditUpdate() { UpdateManager::self()->doUpdates(true); }
void endEditUpdate() { UpdateManager::self()->doUpdates(true); UpdateServer::self()->requestUpdateSignal();}
};

}
Expand Down
2 changes: 2 additions & 0 deletions src/libkstapp/vectordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ ObjectPtr VectorDialog::createNewDataVector() {

_dataObjectName = vector->Name();

//UpdateServer::self()->requestUpdateSignal();
return vector;
}

Expand All @@ -514,6 +515,7 @@ ObjectPtr VectorDialog::createNewGeneratedVector() {

_dataObjectName = vector->Name();

//UpdateServer::self()->requestUpdateSignal();
return vector;
}

Expand Down
14 changes: 3 additions & 11 deletions src/libkstapp/viewvectordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "document.h"
#include "vectormodel.h"
#include "editmultiplewidget.h"
#include "updateserver.h"

#include <datacollection.h>
#include <objectstore.h>
Expand Down Expand Up @@ -85,7 +86,8 @@ ViewVectorDialog::ViewVectorDialog(QWidget *parent, Document *doc)
connect(_showVectorList, SIGNAL(clicked()), this, SLOT(showVectorList()));
connect(_hideVectorList, SIGNAL(clicked()), this, SLOT(hideVectorList()));

// setAttribute(Qt::WA_DeleteOnClose);
connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(update()));

}


Expand All @@ -96,16 +98,6 @@ ViewVectorDialog::~ViewVectorDialog() {
delete _removeButton;
}


bool ViewVectorDialog::event(QEvent * event) {
if ((event->type() == QEvent::WindowActivate) || (event->type() == QEvent::Resize)) {
update();
}
return QWidget::event(event);
}



void ViewVectorDialog::show() {
// vectorSelected();
QDialog::show();
Expand Down
1 change: 0 additions & 1 deletion src/libkstapp/viewvectordialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ViewVectorDialog : public QDialog, Ui::ViewVectorDialog
virtual ~ViewVectorDialog();

virtual void show();
virtual bool event(QEvent * event);

public Q_SLOTS:
void contextMenu(const QPoint& position);
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/vectorselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "objectstore.h"
#include "dialogdefaults.h"
#include "curve.h"
#include "updateserver.h"

namespace Kst {

Expand All @@ -39,6 +40,7 @@ VectorSelector::VectorSelector(QWidget *parent, ObjectStore *store)
connect(_editVector, SIGNAL(pressed()), this, SLOT(editVector()));
connect(_vector, SIGNAL(activated(int)), this, SLOT(emitSelectionChanged()));
connect(_vector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDescriptionTip()));
connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(fillVectors()));
}


Expand Down Expand Up @@ -240,7 +242,7 @@ void VectorSelector::fillVectors() {

bool VectorSelector::event(QEvent * event) {
if ((event->type() == QEvent::WindowActivate) || (event->type() == QEvent::Resize)) {
fillVectors();
//fillVectors();
}
return QWidget::event(event);
}
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/vectorselector.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ class KSTWIDGETS_EXPORT VectorSelector : public QWidget, public Ui::VectorSelect

void clearSelection();

void fillVectors();
void setToLastX(QString field = QString());

void setIsX(bool is_x) {_isX = is_x;}
int count() {return _vector->count();}

virtual bool event(QEvent * event);

public Q_SLOTS:
void fillVectors();

Q_SIGNALS:
void selectionChanged(const QString&);
void contentChanged(); // something in the combo changed (new or edit)
Expand Down