author | ar <ar> | 2004-06-18 23:10:32 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-18 23:10:32 (UTC) |
commit | 48ec0fc077b7834c49c1af1b1279f943ef58de41 (patch) (side-by-side diff) | |
tree | eb740524cb80edcbc6ac68739bb6fbf48355017b | |
parent | d45caef648bce4a73f6f847bc6e9aad125977deb (diff) | |
download | opie-48ec0fc077b7834c49c1af1b1279f943ef58de41.zip opie-48ec0fc077b7834c49c1af1b1279f943ef58de41.tar.gz opie-48ec0fc077b7834c49c1af1b1279f943ef58de41.tar.bz2 |
- BUGFIX: 0001292 - opie sheet not saving correctly
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index bb85a24..7394623 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp @@ -168,129 +168,129 @@ void MainWindow::documentOpen(const DocLnk &lnkDoc) listSheets.append(newSheet); if (i==0) { sheet->setName(newSheet->name); sheet->setSheetData(&newSheet->data); } } } int MainWindow::saveCurrentFile(bool ask) { if (ask) { int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel); if (result!=QMessageBox::Yes) return result; } if (!currentDoc->isValid()) { TextDialog dialogText(this); if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; currentDoc->setName(dialogText.getValue()); currentDoc->setFile(QString::null); currentDoc->setLinkFile(QString::null); } documentSave(currentDoc); return QMessageBox::Yes; } void MainWindow::selectorFileNew(const DocLnk &lnkDoc) { selectorHide(); if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; if (currentDoc) delete currentDoc; currentDoc = new DocLnk(lnkDoc); editData->clear(); listSheets.clear(); comboSheets->clear(); typeSheet *newSheet=createNewSheet(); newSheet->data.setAutoDelete(TRUE); sheet->setName(newSheet->name); sheet->setSheetData(&newSheet->data); for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) createNewSheet(); documentModified=FALSE; } void MainWindow::closeEvent(QCloseEvent *e) { if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); else e->accept(); } void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) { selectorHide(); if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; if (currentDoc) delete currentDoc; - currentDoc = new DocLnk(); + currentDoc = new DocLnk( lnkDoc ); listSheets.clear(); comboSheets->clear(); documentOpen(lnkDoc); documentModified=FALSE; } void MainWindow::selectorShow() { sheet->hide(); setCentralWidget(fileSelector); fileSelector->show(); fileSelector->reread(); } void MainWindow::selectorHide() { fileSelector->hide(); setCentralWidget(sheet); sheet->show(); } void MainWindow::slotFileNew() { selectorFileNew(DocLnk()); } void MainWindow::slotFileOpen() { selectorShow(); } void MainWindow::slotImportExcelOpen() { sheet->hide(); setCentralWidget(ExcelSelector); ExcelSelector->show(); ExcelSelector->reread(); } void MainWindow::ExcelSelectorHide() { ExcelSelector->hide(); setCentralWidget(sheet); sheet->show(); } void MainWindow::slotFileSave() { saveCurrentFile(FALSE); } void MainWindow::setDocument(const QString &applnk_filename) { selectorFileOpen(DocLnk(applnk_filename)); } void MainWindow::initActions() { fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); |