author | ar <ar> | 2004-06-18 23:10:32 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-18 23:10:32 (UTC) |
commit | 48ec0fc077b7834c49c1af1b1279f943ef58de41 (patch) (unidiff) | |
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 | |||
@@ -184,97 +184,97 @@ int MainWindow::saveCurrentFile(bool ask) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | if (!currentDoc->isValid()) | 186 | if (!currentDoc->isValid()) |
187 | { | 187 | { |
188 | TextDialog dialogText(this); | 188 | TextDialog dialogText(this); |
189 | if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; | 189 | if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; |
190 | 190 | ||
191 | currentDoc->setName(dialogText.getValue()); | 191 | currentDoc->setName(dialogText.getValue()); |
192 | currentDoc->setFile(QString::null); | 192 | currentDoc->setFile(QString::null); |
193 | currentDoc->setLinkFile(QString::null); | 193 | currentDoc->setLinkFile(QString::null); |
194 | } | 194 | } |
195 | 195 | ||
196 | documentSave(currentDoc); | 196 | documentSave(currentDoc); |
197 | return QMessageBox::Yes; | 197 | return QMessageBox::Yes; |
198 | } | 198 | } |
199 | 199 | ||
200 | void MainWindow::selectorFileNew(const DocLnk &lnkDoc) | 200 | void MainWindow::selectorFileNew(const DocLnk &lnkDoc) |
201 | { | 201 | { |
202 | selectorHide(); | 202 | selectorHide(); |
203 | 203 | ||
204 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; | 204 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; |
205 | if (currentDoc) delete currentDoc; | 205 | if (currentDoc) delete currentDoc; |
206 | currentDoc = new DocLnk(lnkDoc); | 206 | currentDoc = new DocLnk(lnkDoc); |
207 | editData->clear(); | 207 | editData->clear(); |
208 | listSheets.clear(); | 208 | listSheets.clear(); |
209 | comboSheets->clear(); | 209 | comboSheets->clear(); |
210 | 210 | ||
211 | typeSheet *newSheet=createNewSheet(); | 211 | typeSheet *newSheet=createNewSheet(); |
212 | newSheet->data.setAutoDelete(TRUE); | 212 | newSheet->data.setAutoDelete(TRUE); |
213 | sheet->setName(newSheet->name); | 213 | sheet->setName(newSheet->name); |
214 | sheet->setSheetData(&newSheet->data); | 214 | sheet->setSheetData(&newSheet->data); |
215 | for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) | 215 | for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) |
216 | createNewSheet(); | 216 | createNewSheet(); |
217 | documentModified=FALSE; | 217 | documentModified=FALSE; |
218 | } | 218 | } |
219 | 219 | ||
220 | void MainWindow::closeEvent(QCloseEvent *e) | 220 | void MainWindow::closeEvent(QCloseEvent *e) |
221 | { | 221 | { |
222 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); | 222 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); |
223 | else e->accept(); | 223 | else e->accept(); |
224 | } | 224 | } |
225 | 225 | ||
226 | void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) | 226 | void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) |
227 | { | 227 | { |
228 | selectorHide(); | 228 | selectorHide(); |
229 | 229 | ||
230 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; | 230 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; |
231 | if (currentDoc) delete currentDoc; | 231 | if (currentDoc) delete currentDoc; |
232 | currentDoc = new DocLnk(); | 232 | currentDoc = new DocLnk( lnkDoc ); |
233 | listSheets.clear(); | 233 | listSheets.clear(); |
234 | comboSheets->clear(); | 234 | comboSheets->clear(); |
235 | 235 | ||
236 | documentOpen(lnkDoc); | 236 | documentOpen(lnkDoc); |
237 | documentModified=FALSE; | 237 | documentModified=FALSE; |
238 | } | 238 | } |
239 | 239 | ||
240 | void MainWindow::selectorShow() | 240 | void MainWindow::selectorShow() |
241 | { | 241 | { |
242 | sheet->hide(); | 242 | sheet->hide(); |
243 | setCentralWidget(fileSelector); | 243 | setCentralWidget(fileSelector); |
244 | fileSelector->show(); | 244 | fileSelector->show(); |
245 | fileSelector->reread(); | 245 | fileSelector->reread(); |
246 | } | 246 | } |
247 | 247 | ||
248 | void MainWindow::selectorHide() | 248 | void MainWindow::selectorHide() |
249 | { | 249 | { |
250 | fileSelector->hide(); | 250 | fileSelector->hide(); |
251 | setCentralWidget(sheet); | 251 | setCentralWidget(sheet); |
252 | sheet->show(); | 252 | sheet->show(); |
253 | } | 253 | } |
254 | 254 | ||
255 | void MainWindow::slotFileNew() | 255 | void MainWindow::slotFileNew() |
256 | { | 256 | { |
257 | selectorFileNew(DocLnk()); | 257 | selectorFileNew(DocLnk()); |
258 | } | 258 | } |
259 | 259 | ||
260 | void MainWindow::slotFileOpen() | 260 | void MainWindow::slotFileOpen() |
261 | { | 261 | { |
262 | selectorShow(); | 262 | selectorShow(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void MainWindow::slotImportExcelOpen() | 265 | void MainWindow::slotImportExcelOpen() |
266 | { | 266 | { |
267 | sheet->hide(); | 267 | sheet->hide(); |
268 | setCentralWidget(ExcelSelector); | 268 | setCentralWidget(ExcelSelector); |
269 | ExcelSelector->show(); | 269 | ExcelSelector->show(); |
270 | ExcelSelector->reread(); | 270 | ExcelSelector->reread(); |
271 | } | 271 | } |
272 | 272 | ||
273 | void MainWindow::ExcelSelectorHide() | 273 | void MainWindow::ExcelSelectorHide() |
274 | { | 274 | { |
275 | ExcelSelector->hide(); | 275 | ExcelSelector->hide(); |
276 | setCentralWidget(sheet); | 276 | setCentralWidget(sheet); |
277 | sheet->show(); | 277 | sheet->show(); |
278 | } | 278 | } |
279 | 279 | ||
280 | void MainWindow::slotFileSave() | 280 | void MainWindow::slotFileSave() |