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,28 +1,50 @@ | |||
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) |
12 | * by Serdar Ozler <sozler@sitebest.com> | 31 | * by Serdar Ozler <sozler@sitebest.com> |
13 | */ | 32 | */ |
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" |
26 | #include "sortdlg.h" | 48 | #include "sortdlg.h" |
27 | #include "finddlg.h" | 49 | #include "finddlg.h" |
28 | 50 | ||
@@ -35,21 +57,20 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) | |||
35 | { | 57 | { |
36 | // initialize variables | 58 | // initialize variables |
37 | documentModified=FALSE; | 59 | documentModified=FALSE; |
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&))); |
45 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&))); | 67 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&))); |
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(); |
53 | initMenu(); | 74 | initMenu(); |
54 | initEditToolbar(); | 75 | initEditToolbar(); |
55 | initFunctionsToolbar(); | 76 | initFunctionsToolbar(); |
@@ -87,13 +108,13 @@ void MainWindow::documentSave(DocLnk *lnkDoc) | |||
87 | { | 108 | { |
88 | stream << tempSheet->name << (Q_UINT32)tempSheet->data.count(); | 109 | stream << tempSheet->name << (Q_UINT32)tempSheet->data.count(); |
89 | for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next()) | 110 | for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next()) |
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!")); |
97 | return; | 118 | return; |
98 | } | 119 | } |
99 | documentModified=FALSE; | 120 | documentModified=FALSE; |