[Kst] branches/work/kst/portto4/kst/src/libkstapp
Barth Netterfield
netterfield at astro.utoronto.ca
Tue Jan 5 01:11:48 CET 2010
SVN commit 1070147 by netterfield:
BUG: 219847
Minor fixes for loading a file from the command line.
M +9 -0 document.cpp
M +7 -0 mainwindow.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #1070146:1070147
@@ -134,6 +134,8 @@
bool Document::initFromCommandLine(CommandLineParser *P) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+
bool ok;
bool dataPlotted = P->processCommandLine(&ok);
@@ -141,8 +143,15 @@
QString kstfile = P->kstFileName();
if (!kstfile.isEmpty()) {
dataPlotted = open(kstfile);
+
+ if (dataPlotted) {
+ UpdateManager::self()->doUpdates(true);
+ setChanged(false);
+ }
}
}
+ QApplication::restoreOverrideCursor();
+
return ok;
}
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1070146:1070147
@@ -241,22 +241,29 @@
printFromCommandLine(P.printFile());
ok = false;
}
+ if (!P.kstFileName().isEmpty()) {
+ setWindowTitle("Kst - " + P.kstFileName());
+ }
_doc->setChanged(false);
return ok;
}
void MainWindow::openFile(const QString &file) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
delete _doc;
_doc = new Document(this);
bool ok = _doc->open(file);
if (!ok) {
+ QApplication::restoreOverrideCursor();
+
QMessageBox::critical(this, tr("Kst"), tr("Error opening document '%1':\n%2").arg(file, _doc->lastError()));
delete _doc;
_doc = new Document(this);
} else {
UpdateManager::self()->doUpdates(true);
_doc->setChanged(false);
+ QApplication::restoreOverrideCursor();
}
}
More information about the Kst
mailing list