void KstPlotGroup::copyObject() {
  if (_parent) {
    KstApp::inst()->document()->setModified();
    _parent->appendChild(new KstPlotGroup(*this), true);
    QTimer::singleShot(0, KstApp::inst(), SLOT(updateDialogs()));
  }
}
BinnedMapDialogI::BinnedMapDialogI(QWidget* parent, const char* name, bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new BinnedMapDialogWidget(_contents);
  setMultiple(false);

  connect(_w->_X, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_Y, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_Z, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(this, SIGNAL(modified()), _w->_X, SLOT(update()));
  connect(this, SIGNAL(modified()), _w->_Y, SLOT(update()));
  connect(this, SIGNAL(modified()), _w->_Z, SLOT(update()));
  connect(_w->_AutoBin, SIGNAL(clicked()), this, SLOT(fillAutoRange()));
  connect(KstApp::inst()->document(), SIGNAL(updateDialogs()), this, SLOT(update()));
}
Ejemplo n.º 3
0
KstApp::KstApp(QWidget *parent, const char* name)
: KMainWindow(parent, name) {

  clearWFlags(WDestructiveClose);

  stopping = false;
  config = kapp->config();
  initStatusBar();

  initDocument();
  initView();

  /* create dialogs */
  debugDialog = new KstDebugDialogI(this);
  plotDialog = new KstPlotDialogI(doc, this);
  dataManager = new KstDataManagerI(doc, this);
  filterListEditor = new FilterListEditor(this);
  viewScalarsDialog = new KstViewScalarsDialogI(this);
  viewVectorsDialog = new KstViewVectorsDialogI(this);
  changeFileDialog = new KstChangeFileDialogI(this);
  changeNptsDialog = new KstChangeNptsDialogI(this);
  quickCurvesDialog = new KstQuickCurvesDialogI(this);
  quickPSDDialog = new KstQuickPSDDialogI(this);
  graphFileDialog = new KstGraphFileDialogI(this);
  vectorSaveDialog = new VectorSaveDialog(this);
  
  connect(KstVectorDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstCurveDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstEqDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstHsDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstPsdDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstPluginDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  connect(KstEventMonitorI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified()));
  
  initActions();

  readOptions();

  _updateThread = new UpdateThread(doc);
  _updateThread->setUpdateTime(KstSettings::globalSettings()->plotUpdateTimer);
  _updateThread->start();

  connect(doc,  SIGNAL(newFrameMsg(int)),
          this, SLOT(slotUpdateFrameMsg(int)));
  connect(view, SIGNAL(newStatusMsg(const QString &)),
          this, SLOT(slotUpdateStatusMsg(const QString &)));
  connect(view, SIGNAL(newDataMsg(const QString &)),
          this, SLOT(slotUpdateDataMsg(const QString &)));

  /*** Plot Dialog signals */
  connect(changeFileDialog, SIGNAL(docChanged()),
          this,             SLOT(registerDocChange()));
  connect(changeNptsDialog, SIGNAL(docChanged()),
          this,             SLOT(registerDocChange()));
  connect(quickCurvesDialog,SIGNAL(docChanged()),
          this,             SLOT(registerDocChange()));
  connect(quickPSDDialog,   SIGNAL(docChanged()),
          this,             SLOT(registerDocChange()));
  connect(filterListEditor, SIGNAL(docChanged()),
          this,             SLOT(registerDocChange()));
  connect(graphFileDialog,  SIGNAL(graphFileReq(const QString &,int,int)),
          view,             SLOT(printToGraphicsFile(const QString &,int,int)));

  /*** label dialog ***/
  connect(view->labelDialog, SIGNAL(applied()),
          this, SLOT(registerDocChange()));

  /*** plot dialog ***/
  connect(plotDialog, SIGNAL(docChanged()), this, SLOT(registerDocChange()));

  /*** ***/
  connect(doc, SIGNAL(dataChanged()), this, SLOT(updateDialogs()));

  connect(dataManager, SIGNAL(editDataVector(const QString &)),
          KstVectorDialogI::globalInstance(), SLOT(show_I(const QString &)));

  connect(dataManager->OpenPlotDialog, SIGNAL(clicked()),
          this, SLOT(showPlotDialog()));

  setAutoSaveSettings("KST-KMainWindow", true);
  _dcopIface = new KstIfaceImpl(doc, this);
  view->forceUpdate();

  connect(this, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));

  QTimer::singleShot(0, this, SLOT(updateActions()));

  // Load any extensions
  ExtensionMgr *mgr = ExtensionMgr::self();
  mgr->setWindow(this);
  KService::List sl = KServiceType::offers("Kst Extension");
  for (KService::List::ConstIterator it = sl.begin(); it != sl.end(); ++it) {
    KService::Ptr service = *it;
    QString name = service->property("Name").toString();
    if (!mgr->enabled(name) && !service->property("X-Kst-Enabled").toBool()) {
      continue;
    }
    mgr->loadExtension(service);
  }
}
Ejemplo n.º 4
0
void KstApp::forceUpdate() {
  _updateThread->forceUpdate();
  QTimer::singleShot(0, doc, SLOT(updateDialogs()));
}