# HG changeset patch # User Chris Cannam # Date 1171645035 0 # Node ID 99d44871334b28db72acc52fdffbd597cfc0975b # Parent 00309c07f7a9577e6eb11fcd2e7b72921b4c6ebc * better recollection of last opened remote location; remember to offer to save session if modified when opening a new remote location diff -r 00309c07f7a9 -r 99d44871334b main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Feb 16 13:00:17 2007 +0000 +++ b/main/MainWindow.cpp Fri Feb 16 16:57:15 2007 +0000 @@ -2570,12 +2570,21 @@ void MainWindow::openLocation() { + QSettings settings; + settings.beginGroup("MainWindow"); + QString lastLocation = settings.value("lastremote", "").toString(); + bool ok = false; QString text = QInputDialog::getText (this, tr("Open Location"), tr("Please enter the URL of the location to open:"), - QLineEdit::Normal, "", &ok); - if (!ok || text.isEmpty()) return; + QLineEdit::Normal, lastLocation, &ok); + + if (!ok) return; + + settings.setValue("lastremote", text); + + if (text.isEmpty()) return; if (openURL(QUrl(text)) == FileOpenFailed) { QMessageBox::critical(this, tr("Failed to open location"), @@ -2606,7 +2615,7 @@ if (path.endsWith("sv")) { - if (!checkSaveModified()) return ; + if (!checkSaveModified()) return; if (openSessionFile(path) == FileOpenFailed) { QMessageBox::critical(this, tr("Failed to open file"), @@ -2703,6 +2712,8 @@ return FileOpenFailed; } + if (!checkSaveModified()) return FileOpenCancelled; + QString error; closeSession(); createDocument();