[Kst] branches/work/kst/portto4/kst/src
Barth Netterfield
netterfield at astro.utoronto.ca
Tue Mar 30 18:29:31 CEST 2010
SVN commit 1109128 by netterfield:
Make back and forward buttons work again, and fix dataVector::fileLength
M +1 -0 datasources/dirfilesource/dirfilesource.cpp
M +2 -1 libkst/datavector.cpp
M +13 -4 libkstapp/mainwindow.cpp
--- branches/work/kst/portto4/kst/src/datasources/dirfilesource/dirfilesource.cpp #1109127:1109128
@@ -86,6 +86,7 @@
opt.samplesPerFrame = dir.samplesPerFrame(field);
opt.frameCount = dir._frameCount;
+
return opt;
}
--- branches/work/kst/portto4/kst/src/libkst/datavector.cpp #1109127:1109128
@@ -574,8 +574,9 @@
int DataVector::fileLength() const {
+
if (_file) {
- int rc = opt(_field).vectorframeCount;
+ int rc = opt(_field).frameCount;
return rc;
}
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1109127:1109128
@@ -210,10 +210,21 @@
void MainWindow::newDoc() {
- if (!_doc->isChanged() || promptSave()) {
+ bool clearApproved = false;
+ if (_doc->isChanged()) {
+ clearApproved = promptSave();
+ } else {
+ int rc = QMessageBox::warning(this, tr("Kst"), tr("Delete everything?"), QMessageBox::Ok, QMessageBox::Cancel);
+ clearApproved = (rc == QMessageBox::Ok);
+ }
+
+ if (clearApproved) {
delete _doc;
_doc = new Document(this);
+ } else {
+ return;
}
+
tabWidget()->createView();
int i=tabWidget()->count()-1;
@@ -777,9 +788,8 @@
_openAct->setShortcut(tr("Ctrl+O"));
connect(_openAct, SIGNAL(triggered()), this, SLOT(open()));
- _newAct = new QAction(tr("&New..."), this);
+ _newAct = new QAction(tr("&Clear Session"), this);
_newAct->setStatusTip(tr("Clear current session"));
- _newAct->setShortcut(tr("Ctrl+N"));
connect(_newAct, SIGNAL(triggered()), this, SLOT(newDoc()));
_printAct = new QAction(tr("&Print..."), this);
@@ -1147,7 +1157,6 @@
if (f0<0) {
f0 = 0;
}
-
v->writeLock();
v->changeFrames(f0, nf, skip, do_skip, do_filter);
v->registerChange();
More information about the Kst
mailing list