Diffstat (limited to 'noncore/apps/opie-sheet/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index 061748e..bb85a24 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp | |||
@@ -1,11 +1,30 @@ | |||
1 | /*************************************************************************** | 1 | /* |
2 | * * | 2 | =. This file is part of the Opie Project |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> |
4 | * it under the terms of the GNU General Public License as published by * | 4 | .>+-= |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | _;:, .> :=|. This program is free software; you can |
6 | * (at your option) any later version. * | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | * * | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | ***************************************************************************/ | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This program is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
9 | 28 | ||
10 | /* | 29 | /* |
11 | * Opie Sheet (formerly Sheet/Qt) | 30 | * Opie Sheet (formerly Sheet/Qt) |
@@ -14,12 +33,15 @@ | |||
14 | 33 | ||
15 | #include "mainwindow.h" | 34 | #include "mainwindow.h" |
16 | 35 | ||
36 | /* OPIE */ | ||
17 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
18 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
19 | 39 | ||
40 | /* QT */ | ||
20 | #include <qmessagebox.h> | 41 | #include <qmessagebox.h> |
21 | #include <qradiobutton.h> | 42 | #include <qradiobutton.h> |
22 | 43 | ||
44 | /* STD */ | ||
23 | #include "cellformat.h" | 45 | #include "cellformat.h" |
24 | #include "numberdlg.h" | 46 | #include "numberdlg.h" |
25 | #include "textdlg.h" | 47 | #include "textdlg.h" |
@@ -38,7 +60,7 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) | |||
38 | 60 | ||
39 | // construct objects | 61 | // construct objects |
40 | currentDoc=0; | 62 | currentDoc=0; |
41 | fileSelector=new FileSelector("application/sheet-qt", this, QString::null); | 63 | fileSelector=new FileSelector("application/opie-sheet", this, QString::null); |
42 | ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); | 64 | ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); |
43 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); | 65 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); |
44 | connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&))); | 66 | connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&))); |
@@ -46,7 +68,6 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) | |||
46 | connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&))); | 68 | connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&))); |
47 | connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide())); | 69 | connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide())); |
48 | 70 | ||
49 | |||
50 | listSheets.setAutoDelete(TRUE); | 71 | listSheets.setAutoDelete(TRUE); |
51 | 72 | ||
52 | initActions(); | 73 | initActions(); |
@@ -90,7 +111,7 @@ void MainWindow::documentSave(DocLnk *lnkDoc) | |||
90 | stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data; | 111 | stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data; |
91 | } | 112 | } |
92 | 113 | ||
93 | lnkDoc->setType("application/sheet-qt"); | 114 | lnkDoc->setType("application/opie-sheet"); |
94 | if (!fm.saveFile(*lnkDoc, streamBuffer)) | 115 | if (!fm.saveFile(*lnkDoc, streamBuffer)) |
95 | { | 116 | { |
96 | QMessageBox::critical(this, tr("Error"), tr("File cannot be saved!")); | 117 | QMessageBox::critical(this, tr("Error"), tr("File cannot be saved!")); |