summaryrefslogtreecommitdiff
authorhayzel <hayzel>2004-01-09 21:34:15 (UTC)
committer hayzel <hayzel>2004-01-09 21:34:15 (UTC)
commit6a5b22e96544806b7d08454071bad435ac237f10 (patch) (unidiff)
treeba63be3f240919aea54368cac150ad67b654bf29
parent29961a27e46a5ebf000690339243ec51e55a6b5a (diff)
downloadopie-6a5b22e96544806b7d08454071bad435ac237f10.zip
opie-6a5b22e96544806b7d08454071bad435ac237f10.tar.gz
opie-6a5b22e96544806b7d08454071bad435ac237f10.tar.bz2
corrected resource names for icons.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/ChangeLog2
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp20
2 files changed, 12 insertions, 10 deletions
diff --git a/noncore/apps/opie-sheet/ChangeLog b/noncore/apps/opie-sheet/ChangeLog
index 0370156..69c96f8 100644
--- a/noncore/apps/opie-sheet/ChangeLog
+++ b/noncore/apps/opie-sheet/ChangeLog
@@ -1,73 +1,75 @@
1January 9, 2004 corrected the names of the resource icons in mainwindow.cpp.... So now they are loaded fine.
2
1January 8, 2004 3January 8, 2004
2 - converted icons from xpm to png and moved them to $OPIEDIR/pics/opie-sheet 4 - converted icons from xpm to png and moved them to $OPIEDIR/pics/opie-sheet
3 - modified mainwindow.cpp to load pixmaps with Resource::loadPixmap(resourcename) in contrast to the old QPixmap(nameofthe_xpm_included_in_the_opie-sheet_dir) 5 - modified mainwindow.cpp to load pixmaps with Resource::loadPixmap(resourcename) in contrast to the old QPixmap(nameofthe_xpm_included_in_the_opie-sheet_dir)
4 - changed pics/opie-sheet/sheetqt.png entry in control file to pics/opie-sheet/*.png 6 - changed pics/opie-sheet/sheetqt.png entry in control file to pics/opie-sheet/*.png
5 7
6January 8, 2004 8January 8, 2004
7 - fixed issue : "-if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence." 9 - fixed issue : "-if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence."
8 now the text is handled correctly. 10 now the text is handled correctly.
9 11
10January 7, 2004 12January 7, 2004
11 * Release by hayzel (koppermind@panafonet.gr) 13 * Release by hayzel (koppermind@panafonet.gr)
12 This version has many valuable changes, though It may have some annoying bugs. Please if you are interested in opie-sheet try it hard, so I can fix some of them. Also If you want some other functions that must be here and are missing feel free to ask them. (no financial functions please. :) I really hate them ) 14 This version has many valuable changes, though It may have some annoying bugs. Please if you are interested in opie-sheet try it hard, so I can fix some of them. Also If you want some other functions that must be here and are missing feel free to ask them. (no financial functions please. :) I really hate them )
13 -Fixed a bug with non closed parenthesis editing&recalculation infinite loop. 15 -Fixed a bug with non closed parenthesis editing&recalculation infinite loop.
14 -Added support for functions that can parse parameters not ONLY as numbers but also as strings. 16 -Added support for functions that can parse parameters not ONLY as numbers but also as strings.
15 -Added many functions that cover many computational topics rendering opie-sheet a computational tool-spreadsheet at last. (total 90 functions!) 17 -Added many functions that cover many computational topics rendering opie-sheet a computational tool-spreadsheet at last. (total 90 functions!)
16 -Maintained compatibility with the opie-fileformat. 18 -Maintained compatibility with the opie-fileformat.
17 -New icons. 19 -New icons.
18 -Found that the DataParser was not a real RPN compiler of the expressions. In fact it was returning faulty results in calculations, in both binary or unary operations. A1-A2-A3 was parsed as A1-(A2-A3). -A1 was parsed as A1. 20 -Found that the DataParser was not a real RPN compiler of the expressions. In fact it was returning faulty results in calculations, in both binary or unary operations. A1-A2-A3 was parsed as A1-(A2-A3). -A1 was parsed as A1.
19 -Added new class "Expression" a general Parser for spreadsheet-expression. Imported from an old C# project of mine. 21 -Added new class "Expression" a general Parser for spreadsheet-expression. Imported from an old C# project of mine.
20 -Now can also parse <>=!%&^|"" in expressions. 22 -Now can also parse <>=!%&^|"" in expressions.
21 -Added experimental Excel File format import!. The opie-sheet can import any excel file in BIFF7/BIFF8 format. These formats are used in Excel XP,2000,95. The Excel Importer class is in a good coding level.. BUT it is not complete. Only strings,numbers,formulas are imported. Not formatting rules. Not all the functions are converted in the functions of opie-sheet. Infact FEW functions are converted. 23 -Added experimental Excel File format import!. The opie-sheet can import any excel file in BIFF7/BIFF8 format. These formats are used in Excel XP,2000,95. The Excel Importer class is in a good coding level.. BUT it is not complete. Only strings,numbers,formulas are imported. Not formatting rules. Not all the functions are converted in the functions of opie-sheet. Infact FEW functions are converted.
22 -Fixed a bug with Sheet Recalculation. Added ReCalc() function. Opie-sheet was calculating wrong the values of expression in opening/importing. if a value needed was not loaded yet in the time of calculation. Solved with ReCalc() each time the active sheet is changing. 24 -Fixed a bug with Sheet Recalculation. Added ReCalc() function. Opie-sheet was calculating wrong the values of expression in opening/importing. if a value needed was not loaded yet in the time of calculation. Solved with ReCalc() each time the active sheet is changing.
23 25
24 26
25 *known issues: 27 *known issues:
26 -if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence. 28 -if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence.
27 -randbetween return only integer part random... if both limit numbers are integers. 29 -randbetween return only integer part random... if both limit numbers are integers.
28 -skew and kurt function give different results compared to kspread-oofice equivalents. 30 -skew and kurt function give different results compared to kspread-oofice equivalents.
29 -unstable parser Excel Class 31 -unstable parser Excel Class
30 -string vars and string functions are not correctly handled by excel importer. 32 -string vars and string functions are not correctly handled by excel importer.
31 -unicode strings are converted FINE in QString unicode format, but cannot be rendered fine if a suitable unicode font is not setuped as the default string. So the string is junked in the opie-sheet and may crash the parser. 33 -unicode strings are converted FINE in QString unicode format, but cannot be rendered fine if a suitable unicode font is not setuped as the default string. So the string is junked in the opie-sheet and may crash the parser.
32 34
33 *TODOs: 35 *TODOs:
34 -surelly a much full-stable excel importer. 36 -surelly a much full-stable excel importer.
35 -Cell Manipulation of many Data is really slow.... must change the QList data type. To a structure more efficient. 37 -Cell Manipulation of many Data is really slow.... must change the QList data type. To a structure more efficient.
36 -maybe some more functions. 38 -maybe some more functions.
37 -maybe some kind of charts drawing? 39 -maybe some kind of charts drawing?
38 -maybe kspread or ooffice files import/export. 40 -maybe kspread or ooffice files import/export.
39 41
40October 08, 2002 42October 08, 2002
41 43
42 * Release 1.0.2 (by thufir) 44 * Release 1.0.2 (by thufir)
43 - Fixed bug #250 (exhibiting re-calculation error in multi-level calculation). (by thufir) 45 - Fixed bug #250 (exhibiting re-calculation error in multi-level calculation). (by thufir)
44 46
45October 06, 2002 47October 06, 2002
46 48
47 - Fixed data edit box clear problem. (by thufir) 49 - Fixed data edit box clear problem. (by thufir)
48 50
49October 05, 2002 51October 05, 2002
50 52
51 - Fixed bug #252 (starting up in 'mouse button' mode). (by thufir) 53 - Fixed bug #252 (starting up in 'mouse button' mode). (by thufir)
52 54
53August 31, 2002 55August 31, 2002
54 56
55 - Fixed and updated opie-sheet.pro file. (by cniehaus) 57 - Fixed and updated opie-sheet.pro file. (by cniehaus)
56 58
57August 01, 2002 59August 01, 2002
58 60
59 - Fixed gcc3 compile problems. (by harlekin) 61 - Fixed gcc3 compile problems. (by harlekin)
60 62
61July 06, 2002 63July 06, 2002
62 64
63 - Fixed DocLnk management to save documents correctly. (by leseb) 65 - Fixed DocLnk management to save documents correctly. (by leseb)
64 66
65July 04, 2002 67July 04, 2002
66 68
67 * Release 1.0.1 (by thufir) 69 * Release 1.0.1 (by thufir)
68 - Sheet/Qt is now a part of Opie, so its name is changed to Opie Sheet. (by thufir) 70 - Sheet/Qt is now a part of Opie, so its name is changed to Opie Sheet. (by thufir)
69 - Fixed sorting bug. (by thufir) 71 - Fixed sorting bug. (by thufir)
70 72
71April 14, 2002 73April 14, 2002
72 74
73 * Release 1.0.0 (by thufir) 75 * Release 1.0.0 (by thufir)
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 07e581a..bd98aca 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -103,693 +103,693 @@ void MainWindow::documentSave(DocLnk *lnkDoc)
103void MainWindow::documentOpen(const DocLnk &lnkDoc) 103void MainWindow::documentOpen(const DocLnk &lnkDoc)
104{ 104{
105 FileManager fm; 105 FileManager fm;
106 QByteArray streamBuffer; 106 QByteArray streamBuffer;
107 if (!lnkDoc.isValid() || !fm.loadFile(lnkDoc, streamBuffer)) 107 if (!lnkDoc.isValid() || !fm.loadFile(lnkDoc, streamBuffer))
108 { 108 {
109 QMessageBox::critical(this, tr("Error"), tr("File cannot be opened!")); 109 QMessageBox::critical(this, tr("Error"), tr("File cannot be opened!"));
110 documentModified=FALSE; 110 documentModified=FALSE;
111 selectorFileNew(DocLnk()); 111 selectorFileNew(DocLnk());
112 return; 112 return;
113 } 113 }
114 QDataStream stream(streamBuffer, IO_ReadOnly); 114 QDataStream stream(streamBuffer, IO_ReadOnly);
115 115
116 Q_UINT32 countSheet, countCell, i, j, row, col, alignment; 116 Q_UINT32 countSheet, countCell, i, j, row, col, alignment;
117 typeSheet *newSheet; 117 typeSheet *newSheet;
118 typeCellData *newCell; 118 typeCellData *newCell;
119 119
120 char fileFormat[7]; 120 char fileFormat[7];
121 stream.readRawBytes(fileFormat, 6); 121 stream.readRawBytes(fileFormat, 6);
122 fileFormat[6]=0; 122 fileFormat[6]=0;
123 if ((QString)fileFormat!="SQT100") 123 if ((QString)fileFormat!="SQT100")
124 { 124 {
125 QMessageBox::critical(this, tr("Error"), tr("Invalid file format!")); 125 QMessageBox::critical(this, tr("Error"), tr("Invalid file format!"));
126 documentModified=FALSE; 126 documentModified=FALSE;
127 selectorFileNew(DocLnk()); 127 selectorFileNew(DocLnk());
128 return; 128 return;
129 } 129 }
130 130
131 stream >> countSheet; 131 stream >> countSheet;
132 for (i=0; i<countSheet; ++i) 132 for (i=0; i<countSheet; ++i)
133 { 133 {
134 newSheet=new typeSheet; 134 newSheet=new typeSheet;
135 newSheet->data.setAutoDelete(TRUE); 135 newSheet->data.setAutoDelete(TRUE);
136 stream >> newSheet->name >> countCell; 136 stream >> newSheet->name >> countCell;
137 comboSheets->insertItem(newSheet->name); 137 comboSheets->insertItem(newSheet->name);
138 138
139 for (j=0; j<countCell; ++j) 139 for (j=0; j<countCell; ++j)
140 { 140 {
141 newCell=new typeCellData; 141 newCell=new typeCellData;
142 stream >> col >> row >> newCell->borders.right >> newCell->borders.bottom >> newCell->background >> alignment >> newCell->fontColor >> newCell->font >> newCell->data; 142 stream >> col >> row >> newCell->borders.right >> newCell->borders.bottom >> newCell->background >> alignment >> newCell->fontColor >> newCell->font >> newCell->data;
143 newCell->col=col; 143 newCell->col=col;
144 newCell->row=row; 144 newCell->row=row;
145 newCell->alignment=(Qt::AlignmentFlags)alignment; 145 newCell->alignment=(Qt::AlignmentFlags)alignment;
146 newSheet->data.append(newCell); 146 newSheet->data.append(newCell);
147 } 147 }
148 listSheets.append(newSheet); 148 listSheets.append(newSheet);
149 149
150 if (i==0) 150 if (i==0)
151 { 151 {
152 sheet->setName(newSheet->name); 152 sheet->setName(newSheet->name);
153 sheet->setSheetData(&newSheet->data); 153 sheet->setSheetData(&newSheet->data);
154 } 154 }
155 } 155 }
156} 156}
157 157
158int MainWindow::saveCurrentFile(bool ask) 158int MainWindow::saveCurrentFile(bool ask)
159{ 159{
160 if (ask) 160 if (ask)
161 { 161 {
162 int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel); 162 int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel);
163 if (result!=QMessageBox::Yes) return result; 163 if (result!=QMessageBox::Yes) return result;
164 } 164 }
165 165
166 if (!currentDoc->isValid()) 166 if (!currentDoc->isValid())
167 { 167 {
168 TextDialog dialogText(this); 168 TextDialog dialogText(this);
169 if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; 169 if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel;
170 170
171 currentDoc->setName(dialogText.getValue()); 171 currentDoc->setName(dialogText.getValue());
172 currentDoc->setFile(QString::null); 172 currentDoc->setFile(QString::null);
173 currentDoc->setLinkFile(QString::null); 173 currentDoc->setLinkFile(QString::null);
174 } 174 }
175 175
176 documentSave(currentDoc); 176 documentSave(currentDoc);
177 return QMessageBox::Yes; 177 return QMessageBox::Yes;
178} 178}
179 179
180void MainWindow::selectorFileNew(const DocLnk &lnkDoc) 180void MainWindow::selectorFileNew(const DocLnk &lnkDoc)
181{ 181{
182 selectorHide(); 182 selectorHide();
183 183
184 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; 184 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return;
185 if (currentDoc) delete currentDoc; 185 if (currentDoc) delete currentDoc;
186 currentDoc = new DocLnk(lnkDoc); 186 currentDoc = new DocLnk(lnkDoc);
187 editData->clear(); 187 editData->clear();
188 listSheets.clear(); 188 listSheets.clear();
189 comboSheets->clear(); 189 comboSheets->clear();
190 190
191 typeSheet *newSheet=createNewSheet(); 191 typeSheet *newSheet=createNewSheet();
192 newSheet->data.setAutoDelete(TRUE); 192 newSheet->data.setAutoDelete(TRUE);
193 sheet->setName(newSheet->name); 193 sheet->setName(newSheet->name);
194 sheet->setSheetData(&newSheet->data); 194 sheet->setSheetData(&newSheet->data);
195 for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) 195 for (int i=1; i<DEFAULT_NUM_SHEETS; ++i)
196 createNewSheet(); 196 createNewSheet();
197 documentModified=FALSE; 197 documentModified=FALSE;
198} 198}
199 199
200void MainWindow::closeEvent(QCloseEvent *e) 200void MainWindow::closeEvent(QCloseEvent *e)
201{ 201{
202 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); 202 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore();
203 else e->accept(); 203 else e->accept();
204} 204}
205 205
206void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) 206void MainWindow::selectorFileOpen(const DocLnk &lnkDoc)
207{ 207{
208 selectorHide(); 208 selectorHide();
209 209
210 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; 210 if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return;
211 if (currentDoc) delete currentDoc; 211 if (currentDoc) delete currentDoc;
212 currentDoc = new DocLnk(); 212 currentDoc = new DocLnk();
213 listSheets.clear(); 213 listSheets.clear();
214 comboSheets->clear(); 214 comboSheets->clear();
215 215
216 documentOpen(lnkDoc); 216 documentOpen(lnkDoc);
217 documentModified=FALSE; 217 documentModified=FALSE;
218} 218}
219 219
220void MainWindow::selectorShow() 220void MainWindow::selectorShow()
221{ 221{
222 sheet->hide(); 222 sheet->hide();
223 setCentralWidget(fileSelector); 223 setCentralWidget(fileSelector);
224 fileSelector->show(); 224 fileSelector->show();
225 fileSelector->reread(); 225 fileSelector->reread();
226} 226}
227 227
228void MainWindow::selectorHide() 228void MainWindow::selectorHide()
229{ 229{
230 fileSelector->hide(); 230 fileSelector->hide();
231 setCentralWidget(sheet); 231 setCentralWidget(sheet);
232 sheet->show(); 232 sheet->show();
233} 233}
234 234
235void MainWindow::slotFileNew() 235void MainWindow::slotFileNew()
236{ 236{
237 selectorFileNew(DocLnk()); 237 selectorFileNew(DocLnk());
238} 238}
239 239
240void MainWindow::slotFileOpen() 240void MainWindow::slotFileOpen()
241{ 241{
242 selectorShow(); 242 selectorShow();
243} 243}
244 244
245void MainWindow::slotImportExcelOpen() 245void MainWindow::slotImportExcelOpen()
246{ 246{
247 sheet->hide(); 247 sheet->hide();
248 setCentralWidget(ExcelSelector); 248 setCentralWidget(ExcelSelector);
249 ExcelSelector->show(); 249 ExcelSelector->show();
250 ExcelSelector->reread(); 250 ExcelSelector->reread();
251} 251}
252 252
253void MainWindow::ExcelSelectorHide() 253void MainWindow::ExcelSelectorHide()
254{ 254{
255 ExcelSelector->hide(); 255 ExcelSelector->hide();
256 setCentralWidget(sheet); 256 setCentralWidget(sheet);
257 sheet->show(); 257 sheet->show();
258} 258}
259 259
260void MainWindow::slotFileSave() 260void MainWindow::slotFileSave()
261{ 261{
262 saveCurrentFile(FALSE); 262 saveCurrentFile(FALSE);
263} 263}
264 264
265void MainWindow::setDocument(const QString &applnk_filename) 265void MainWindow::setDocument(const QString &applnk_filename)
266{ 266{
267 selectorFileOpen(DocLnk(applnk_filename)); 267 selectorFileOpen(DocLnk(applnk_filename));
268} 268}
269 269
270void MainWindow::initActions() 270void MainWindow::initActions()
271{ 271{
272 fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); 272 fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this);
273 connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); 273 connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew()));
274 fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); 274 fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this);
275 connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); 275 connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen()));
276 fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); 276 fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this);
277 connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); 277 connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave()));
278 fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); 278 fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this);
279 connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); 279 connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs()));
280 280
281 //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); 281 //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this);
282 //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); 282 //connect(fileQuit, SIGNAL(activated()), this, SLOT(close()));
283 fileExcelImport=new QAction(tr("Import Excel file"),Resource::loadPixmap( "opie-sheet/excel16" ),tr("Import E&xcel file"),0,this); 283 fileExcelImport=new QAction(tr("Import Excel file"),Resource::loadPixmap( "opie-sheet/excel16" ),tr("Import E&xcel file"),0,this);
284 connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen())); 284 connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen()));
285 285
286 // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); 286 // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this);
287 //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); 287 //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral()));
288 //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); 288 //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this);
289 //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); 289 //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout()));
290 290
291 editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); 291 editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this);
292 connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); 292 connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept()));
293 editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); 293 editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this);
294 connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); 294 connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel()));
295 editCellSelect=new QAction(tr("Cell Selector"), Resource::loadPixmap( "opie-sheet/cell_select" ), tr("Cell &Selector"), 0, this); 295 editCellSelect=new QAction(tr("Cell Selector"), Resource::loadPixmap( "opie-sheet/cell-select" ), tr("Cell &Selector"), 0, this);
296 editCellSelect->setToggleAction(TRUE); 296 editCellSelect->setToggleAction(TRUE);
297 connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); 297 connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool)));
298 editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); 298 editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this);
299 editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); 299 editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this);
300 editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); 300 editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this);
301 connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); 301 connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste()));
302 editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); 302 editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this);
303 connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); 303 connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents()));
304 editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); 304 editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this);
305 305
306 insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); 306 insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this);
307 connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); 307 connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells()));
308 insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); 308 insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this);
309 connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); 309 connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows()));
310 insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); 310 insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this);
311 connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); 311 connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols()));
312 insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); 312 insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this);
313 connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); 313 connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets()));
314 314
315 formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); 315 formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this);
316 connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); 316 connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells()));
317 317
318 rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this); 318 rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this);
319 connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight())); 319 connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight()));
320 rowAdjust=new QAction(tr("Adjust Row"), tr("&Adjust"), 0, this); 320 rowAdjust=new QAction(tr("Adjust Row"), tr("&Adjust"), 0, this);
321 connect(rowAdjust, SIGNAL(activated()), this, SLOT(slotRowAdjust())); 321 connect(rowAdjust, SIGNAL(activated()), this, SLOT(slotRowAdjust()));
322 rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this); 322 rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this);
323 connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow())); 323 connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow()));
324 rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this); 324 rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this);
325 connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide())); 325 connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide()));
326 326
327 colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this); 327 colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this);
328 connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth())); 328 connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth()));
329 colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this); 329 colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this);
330 connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust())); 330 connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust()));
331 colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this); 331 colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this);
332 connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow())); 332 connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow()));
333 colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this); 333 colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this);
334 connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide())); 334 connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide()));
335 335
336 sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this); 336 sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this);
337 connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename())); 337 connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename()));
338 sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this); 338 sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this);
339 connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove())); 339 connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove()));
340 340
341 dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this); 341 dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this);
342 connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort())); 342 connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort()));
343 dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this); 343 dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this);
344 connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace())); 344 connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace()));
345 345
346 funcEqual=new QAction(tr("Equal To"), Resource::loadPixmap( "opie-sheet/func_equal" ), tr("&Equal To"), 0, this); 346 funcEqual=new QAction(tr("Equal To"), Resource::loadPixmap( "opie-sheet/func-equal" ), tr("&Equal To"), 0, this);
347 funcEqual->setToolTip("="); 347 funcEqual->setToolTip("=");
348 connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 348 connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
349 funcPlus=new QAction(tr("Addition"), Resource::loadPixmap( "opie-sheet/func_plus" ), tr("&Addition"), 0, this); 349 funcPlus=new QAction(tr("Addition"), Resource::loadPixmap( "opie-sheet/func-plus" ), tr("&Addition"), 0, this);
350 funcPlus->setToolTip("+"); 350 funcPlus->setToolTip("+");
351 connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 351 connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
352 funcMinus=new QAction(tr("Subtraction"), Resource::loadPixmap( "opie-sheet/func_minus" ), tr("&Subtraction"), 0, this); 352 funcMinus=new QAction(tr("Subtraction"), Resource::loadPixmap( "opie-sheet/func-minus" ), tr("&Subtraction"), 0, this);
353 funcMinus->setToolTip("-"); 353 funcMinus->setToolTip("-");
354 connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 354 connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
355 funcCross=new QAction(tr("Multiplication"), Resource::loadPixmap ("opie-sheet/func_cross" ), tr("&Multiplication"), 0, this); 355 funcCross=new QAction(tr("Multiplication"), Resource::loadPixmap ("opie-sheet/func-cross" ), tr("&Multiplication"), 0, this);
356 funcCross->setToolTip("*"); 356 funcCross->setToolTip("*");
357 connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 357 connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
358 funcDivide=new QAction(tr("Division"), Resource::loadPixmap( "opie-sheet/func_divide" ), tr("&Division"), 0, this); 358 funcDivide=new QAction(tr("Division"), Resource::loadPixmap( "opie-sheet/func-divide" ), tr("&Division"), 0, this);
359 funcDivide->setToolTip("/"); 359 funcDivide->setToolTip("/");
360 connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 360 connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
361 funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), Resource::loadPixmap( "opie-sheet/func_paran_open" ), tr("&Open Paranthesis"), 0, this); 361 funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), Resource::loadPixmap( "opie-sheet/func-paran-open" ), tr("&Open Paranthesis"), 0, this);
362 funcParanOpen->setToolTip("("); 362 funcParanOpen->setToolTip("(");
363 connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 363 connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
364 funcParanClose=new QAction(tr("Close Paranthesis"), Resource::loadPixmap( "opie-sheet/func_paran_close" ), tr("&Close Paranthesis"), 0, this); 364 funcParanClose=new QAction(tr("Close Paranthesis"), Resource::loadPixmap( "opie-sheet/func-paran-close" ), tr("&Close Paranthesis"), 0, this);
365 funcParanClose->setToolTip(")"); 365 funcParanClose->setToolTip(")");
366 connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 366 connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
367 funcComma=new QAction(tr("Comma"), Resource::loadPixmap( "opie-sheet/func_comma" ), tr("&Comma"), 0, this); 367 funcComma=new QAction(tr("Comma"), Resource::loadPixmap( "opie-sheet/func-comma" ), tr("&Comma"), 0, this);
368 funcComma->setToolTip(","); 368 funcComma->setToolTip(",");
369 connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 369 connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
370} 370}
371 371
372void MainWindow::initMenu() 372void MainWindow::initMenu()
373{ 373{
374 menu=new QMenuBar(this); 374 menu=new QMenuBar(this);
375 375
376 menuFile=new QPopupMenu; 376 menuFile=new QPopupMenu;
377 fileNew->addTo(menuFile); 377 fileNew->addTo(menuFile);
378 fileOpen->addTo(menuFile); 378 fileOpen->addTo(menuFile);
379 fileSave->addTo(menuFile); 379 fileSave->addTo(menuFile);
380 fileSaveAs->addTo(menuFile); 380 fileSaveAs->addTo(menuFile);
381// menuFile->insertSeparator(); 381// menuFile->insertSeparator();
382// fileQuit->addTo(menuFile); 382// fileQuit->addTo(menuFile);
383 menuFile->insertSeparator(); 383 menuFile->insertSeparator();
384 fileExcelImport->addTo(menuFile); 384 fileExcelImport->addTo(menuFile);
385 menu->insertItem(tr("&File"), menuFile); 385 menu->insertItem(tr("&File"), menuFile);
386 386
387 menuEdit=new QPopupMenu; 387 menuEdit=new QPopupMenu;
388 editAccept->addTo(menuEdit); 388 editAccept->addTo(menuEdit);
389 editCancel->addTo(menuEdit); 389 editCancel->addTo(menuEdit);
390 editCellSelect->addTo(menuEdit); 390 editCellSelect->addTo(menuEdit);
391 menuEdit->insertSeparator(); 391 menuEdit->insertSeparator();
392 editCut->addTo(menuEdit); 392 editCut->addTo(menuEdit);
393 editCopy->addTo(menuEdit); 393 editCopy->addTo(menuEdit);
394 editPaste->addTo(menuEdit); 394 editPaste->addTo(menuEdit);
395 editPasteContents->addTo(menuEdit); 395 editPasteContents->addTo(menuEdit);
396 editClear->addTo(menuEdit); 396 editClear->addTo(menuEdit);
397 menu->insertItem(tr("&Edit"), menuEdit); 397 menu->insertItem(tr("&Edit"), menuEdit);
398 398
399 menuInsert=new QPopupMenu; 399 menuInsert=new QPopupMenu;
400 menu->insertItem(tr("&Insert"), menuInsert); 400 menu->insertItem(tr("&Insert"), menuInsert);
401 401
402 menuFormat=new QPopupMenu; 402 menuFormat=new QPopupMenu;
403 formatCells->addTo(menuFormat); 403 formatCells->addTo(menuFormat);
404 menu->insertItem(tr("&Format"), menuFormat); 404 menu->insertItem(tr("&Format"), menuFormat);
405 405
406 menuData=new QPopupMenu; 406 menuData=new QPopupMenu;
407 dataSort->addTo(menuData); 407 dataSort->addTo(menuData);
408 dataFindReplace->addTo(menuData); 408 dataFindReplace->addTo(menuData);
409 menu->insertItem(tr("&Data"), menuData); 409 menu->insertItem(tr("&Data"), menuData);
410 410
411// menuHelp=new QPopupMenu; 411// menuHelp=new QPopupMenu;
412// helpGeneral->addTo(menuHelp); 412// helpGeneral->addTo(menuHelp);
413// helpAbout->addTo(menuHelp); 413// helpAbout->addTo(menuHelp);
414// menu->insertItem(tr("&Help"), menuHelp); 414// menu->insertItem(tr("&Help"), menuHelp);
415 415
416 submenuRow=new QPopupMenu; 416 submenuRow=new QPopupMenu;
417 rowHeight->addTo(submenuRow); 417 rowHeight->addTo(submenuRow);
418 rowAdjust->addTo(submenuRow); 418 rowAdjust->addTo(submenuRow);
419 rowShow->addTo(submenuRow); 419 rowShow->addTo(submenuRow);
420 rowHide->addTo(submenuRow); 420 rowHide->addTo(submenuRow);
421 menuFormat->insertItem(tr("&Row"), submenuRow); 421 menuFormat->insertItem(tr("&Row"), submenuRow);
422 422
423 submenuCol=new QPopupMenu; 423 submenuCol=new QPopupMenu;
424 colWidth->addTo(submenuCol); 424 colWidth->addTo(submenuCol);
425 colAdjust->addTo(submenuCol); 425 colAdjust->addTo(submenuCol);
426 colShow->addTo(submenuCol); 426 colShow->addTo(submenuCol);
427 colHide->addTo(submenuCol); 427 colHide->addTo(submenuCol);
428 menuFormat->insertItem(tr("Colum&n"), submenuCol); 428 menuFormat->insertItem(tr("Colum&n"), submenuCol);
429 429
430 submenuSheet=new QPopupMenu; 430 submenuSheet=new QPopupMenu;
431 sheetRename->addTo(submenuSheet); 431 sheetRename->addTo(submenuSheet);
432 sheetRemove->addTo(submenuSheet); 432 sheetRemove->addTo(submenuSheet);
433 menuFormat->insertItem(tr("&Sheet"), submenuSheet); 433 menuFormat->insertItem(tr("&Sheet"), submenuSheet);
434 434
435 submenuFunc=new QPopupMenu; 435 submenuFunc=new QPopupMenu;
436 menuInsert->insertItem(tr("&Function"), submenuFunc); 436 menuInsert->insertItem(tr("&Function"), submenuFunc);
437 437
438 submenuFuncStd=new QPopupMenu; 438 submenuFuncStd=new QPopupMenu;
439 funcPlus->addTo(submenuFuncStd); 439 funcPlus->addTo(submenuFuncStd);
440 funcMinus->addTo(submenuFuncStd); 440 funcMinus->addTo(submenuFuncStd);
441 funcCross->addTo(submenuFuncStd); 441 funcCross->addTo(submenuFuncStd);
442 funcDivide->addTo(submenuFuncStd); 442 funcDivide->addTo(submenuFuncStd);
443 submenuFunc->insertItem(tr("&Simple"), submenuFuncStd); 443 submenuFunc->insertItem(tr("&Simple"), submenuFuncStd);
444 444
445 445
446 446
447 submenuFuncStandard=new QPopupMenu; 447 submenuFuncStandard=new QPopupMenu;
448 addFlyAction(tr("ABS(x)"), tr("ABS(x)"), "ABS(", submenuFuncStandard); 448 addFlyAction(tr("ABS(x)"), tr("ABS(x)"), "ABS(", submenuFuncStandard);
449 addFlyAction(tr("CEILING(x,acc)"), tr("CEILING(x,acc)"), "CEILING(", submenuFuncStandard); 449 addFlyAction(tr("CEILING(x,acc)"), tr("CEILING(x,acc)"), "CEILING(", submenuFuncStandard);
450 addFlyAction(tr("FACT(x)"), tr("FACT(x)"), "FACT(", submenuFuncStandard); 450 addFlyAction(tr("FACT(x)"), tr("FACT(x)"), "FACT(", submenuFuncStandard);
451 addFlyAction(tr("FLOOR(x,acc)"), tr("FLOOR(x,acc)"), "FLOOR(", submenuFuncStandard); 451 addFlyAction(tr("FLOOR(x,acc)"), tr("FLOOR(x,acc)"), "FLOOR(", submenuFuncStandard);
452 addFlyAction(tr("INT(x)"), tr("INT(x)"), "INT(", submenuFuncStandard); 452 addFlyAction(tr("INT(x)"), tr("INT(x)"), "INT(", submenuFuncStandard);
453 addFlyAction(tr("MOD(x,y)"), tr("MOD(x,y)"), "MOD(", submenuFuncStandard); 453 addFlyAction(tr("MOD(x,y)"), tr("MOD(x,y)"), "MOD(", submenuFuncStandard);
454 addFlyAction(tr("ROUND(x,digits)"), tr("ROUND(x,digits)"), "ROUND(", submenuFuncStandard); 454 addFlyAction(tr("ROUND(x,digits)"), tr("ROUND(x,digits)"), "ROUND(", submenuFuncStandard);
455 addFlyAction(tr("SIGN(x)"), tr("SIGN(x)"), "SIGN(", submenuFuncStandard); 455 addFlyAction(tr("SIGN(x)"), tr("SIGN(x)"), "SIGN(", submenuFuncStandard);
456 submenuFuncStandard->insertSeparator(); 456 submenuFuncStandard->insertSeparator();
457 addFlyAction(tr("EXP(x)"), tr("EXP(x)"), "EXP(", submenuFuncStandard); 457 addFlyAction(tr("EXP(x)"), tr("EXP(x)"), "EXP(", submenuFuncStandard);
458 addFlyAction(tr("LN(x)"), tr("LN(x)"), "LN(", submenuFuncStandard); 458 addFlyAction(tr("LN(x)"), tr("LN(x)"), "LN(", submenuFuncStandard);
459 addFlyAction(tr("LOG(x,b)"), tr("LOG(x,b)"), "LOG(", submenuFuncStandard); 459 addFlyAction(tr("LOG(x,b)"), tr("LOG(x,b)"), "LOG(", submenuFuncStandard);
460 addFlyAction(tr("LOG10(x)"), tr("LOG10(x)"), "LOG10(", submenuFuncStandard); 460 addFlyAction(tr("LOG10(x)"), tr("LOG10(x)"), "LOG10(", submenuFuncStandard);
461 addFlyAction(tr("POWER(x,y)"), tr("POWER(x,y)"), "POWER(", submenuFuncStandard); 461 addFlyAction(tr("POWER(x,y)"), tr("POWER(x,y)"), "POWER(", submenuFuncStandard);
462 addFlyAction(tr("SQRT(x)"), tr("SQRT(x)"), "SQRT(", submenuFuncStandard); 462 addFlyAction(tr("SQRT(x)"), tr("SQRT(x)"), "SQRT(", submenuFuncStandard);
463 submenuFuncStandard->insertSeparator(); 463 submenuFuncStandard->insertSeparator();
464 addFlyAction(tr("DEGREES(x)"), tr("DEGREES(x)"), "DEGREES(", submenuFuncStandard); 464 addFlyAction(tr("DEGREES(x)"), tr("DEGREES(x)"), "DEGREES(", submenuFuncStandard);
465 addFlyAction(tr("RADIANS(x)"), tr("RADIANS(x)"), "RADIANS(", submenuFuncStandard); 465 addFlyAction(tr("RADIANS(x)"), tr("RADIANS(x)"), "RADIANS(", submenuFuncStandard);
466 addFlyAction(tr("PI()"), tr("PI()"), "PI()", submenuFuncStandard); 466 addFlyAction(tr("PI()"), tr("PI()"), "PI()", submenuFuncStandard);
467 addFlyAction(tr("RAND()"), tr("RAND()"), "RAND(", submenuFuncStandard); 467 addFlyAction(tr("RAND()"), tr("RAND()"), "RAND(", submenuFuncStandard);
468 addFlyAction(tr("RANDBETWEEN(a,b)"), tr("RANDBETWEEN(a,b)"), "RANDBETWEEN(", submenuFuncStandard); 468 addFlyAction(tr("RANDBETWEEN(a,b)"), tr("RANDBETWEEN(a,b)"), "RANDBETWEEN(", submenuFuncStandard);
469 submenuFunc->insertItem(tr("S&tandard"), submenuFuncStandard); 469 submenuFunc->insertItem(tr("S&tandard"), submenuFuncStandard);
470 470
471 submenuFuncLogic=new QPopupMenu; 471 submenuFuncLogic=new QPopupMenu;
472 addFlyAction(tr("AND(x1,x2)"), tr("AND(x1,x2)"), "AND(", submenuFuncLogic); 472 addFlyAction(tr("AND(x1,x2)"), tr("AND(x1,x2)"), "AND(", submenuFuncLogic);
473 addFlyAction(tr("NOT(x)"), tr("NOT(x)"), "NOT(", submenuFuncLogic); 473 addFlyAction(tr("NOT(x)"), tr("NOT(x)"), "NOT(", submenuFuncLogic);
474 addFlyAction(tr("OR(x1,x2)"), tr("OR(x1,x2)"), "OR(", submenuFuncLogic); 474 addFlyAction(tr("OR(x1,x2)"), tr("OR(x1,x2)"), "OR(", submenuFuncLogic);
475 submenuFuncLogic->insertSeparator(); 475 submenuFuncLogic->insertSeparator();
476 addFlyAction(tr("IF(compare,val1,val2)"), tr("IF(compare,val1,val2)"), "IF(", submenuFuncLogic); 476 addFlyAction(tr("IF(compare,val1,val2)"), tr("IF(compare,val1,val2)"), "IF(", submenuFuncLogic);
477 addFlyAction(tr("INDEX(range,index)"),tr("INDEX(range,index)"), "INDEX(", submenuFuncLogic); 477 addFlyAction(tr("INDEX(range,index)"),tr("INDEX(range,index)"), "INDEX(", submenuFuncLogic);
478 addFlyAction(tr("ISBLANK(x)"), tr("ISBLANK(x)"), "ISBLANK(", submenuFuncLogic); 478 addFlyAction(tr("ISBLANK(x)"), tr("ISBLANK(x)"), "ISBLANK(", submenuFuncLogic);
479 addFlyAction(tr("ISNUMBER(x)"), tr("ISNUMBER(x)"), "ISNUMBER(", submenuFuncLogic); 479 addFlyAction(tr("ISNUMBER(x)"), tr("ISNUMBER(x)"), "ISNUMBER(", submenuFuncLogic);
480 addFlyAction(tr("EVEN(x)"), tr("EVEN(x)"), "EVEN(", submenuFuncLogic); 480 addFlyAction(tr("EVEN(x)"), tr("EVEN(x)"), "EVEN(", submenuFuncLogic);
481 addFlyAction(tr("ISEVEN(x)"), tr("ISEVEN(x)"), "ISEVEN(", submenuFuncLogic); 481 addFlyAction(tr("ISEVEN(x)"), tr("ISEVEN(x)"), "ISEVEN(", submenuFuncLogic);
482 addFlyAction(tr("ODD(x)"), tr("ODD(x)"), "ODD(", submenuFuncLogic); 482 addFlyAction(tr("ODD(x)"), tr("ODD(x)"), "ODD(", submenuFuncLogic);
483 addFlyAction(tr("ISODD(x)"), tr("ISODD(x)"), "ISODD(", submenuFuncLogic); 483 addFlyAction(tr("ISODD(x)"), tr("ISODD(x)"), "ISODD(", submenuFuncLogic);
484 submenuFunc->insertItem(tr("Logical-&Information"), submenuFuncLogic); 484 submenuFunc->insertItem(tr("Logical-&Information"), submenuFuncLogic);
485 485
486 submenuFuncTrig=new QPopupMenu; 486 submenuFuncTrig=new QPopupMenu;
487 addFlyAction(tr("SIN(x)"), tr("SIN(x)"), "SIN(", submenuFuncTrig); 487 addFlyAction(tr("SIN(x)"), tr("SIN(x)"), "SIN(", submenuFuncTrig);
488 addFlyAction(tr("COS(x)"), tr("COS(x)"), "COS(", submenuFuncTrig); 488 addFlyAction(tr("COS(x)"), tr("COS(x)"), "COS(", submenuFuncTrig);
489 addFlyAction(tr("TAN(x)"), tr("TAN(x)"), "TAN(", submenuFuncTrig); 489 addFlyAction(tr("TAN(x)"), tr("TAN(x)"), "TAN(", submenuFuncTrig);
490 addFlyAction(tr("ASIN(x)"), tr("ASIN(x)"), "ASIN(", submenuFuncTrig); 490 addFlyAction(tr("ASIN(x)"), tr("ASIN(x)"), "ASIN(", submenuFuncTrig);
491 addFlyAction(tr("ACOS(x)"), tr("ACOS(x)"), "ACOS(", submenuFuncTrig); 491 addFlyAction(tr("ACOS(x)"), tr("ACOS(x)"), "ACOS(", submenuFuncTrig);
492 addFlyAction(tr("ATAN(x)"), tr("ATAN(x)"), "ATAN(", submenuFuncTrig); 492 addFlyAction(tr("ATAN(x)"), tr("ATAN(x)"), "ATAN(", submenuFuncTrig);
493 addFlyAction(tr("ATAN2(x,y)"), tr("ATAN2(x,y)"), "ATAN2(", submenuFuncTrig); 493 addFlyAction(tr("ATAN2(x,y)"), tr("ATAN2(x,y)"), "ATAN2(", submenuFuncTrig);
494 submenuFuncTrig->insertSeparator(); 494 submenuFuncTrig->insertSeparator();
495 addFlyAction(tr("SINH(x)"), tr("SINH(x)"), "SINH(", submenuFuncTrig); 495 addFlyAction(tr("SINH(x)"), tr("SINH(x)"), "SINH(", submenuFuncTrig);
496 addFlyAction(tr("COSH(x)"), tr("COSH(x)"), "COSH(", submenuFuncTrig); 496 addFlyAction(tr("COSH(x)"), tr("COSH(x)"), "COSH(", submenuFuncTrig);
497 addFlyAction(tr("TANH(x)"), tr("TANH(x)"), "TANH(", submenuFuncTrig); 497 addFlyAction(tr("TANH(x)"), tr("TANH(x)"), "TANH(", submenuFuncTrig);
498 addFlyAction(tr("ACOSH(x)"), tr("ACOSH(x)"), "ACOSH(", submenuFuncTrig); 498 addFlyAction(tr("ACOSH(x)"), tr("ACOSH(x)"), "ACOSH(", submenuFuncTrig);
499 addFlyAction(tr("ASINH(x)"), tr("ASINH(x)"), "ASINH(", submenuFuncTrig); 499 addFlyAction(tr("ASINH(x)"), tr("ASINH(x)"), "ASINH(", submenuFuncTrig);
500 addFlyAction(tr("ATANH(x)"), tr("ATANH(x)"), "ATANH(", submenuFuncTrig); 500 addFlyAction(tr("ATANH(x)"), tr("ATANH(x)"), "ATANH(", submenuFuncTrig);
501 submenuFunc->insertItem(tr("&Trigonometric"), submenuFuncTrig); 501 submenuFunc->insertItem(tr("&Trigonometric"), submenuFuncTrig);
502 502
503 submenuFuncString=new QPopupMenu; 503 submenuFuncString=new QPopupMenu;
504 addFlyAction(tr("LEN(s)"), tr("LEN(s)"), "LEN(",submenuFuncString); 504 addFlyAction(tr("LEN(s)"), tr("LEN(s)"), "LEN(",submenuFuncString);
505 addFlyAction(tr("LEFT(s,num)"), tr("LEFT(s,num)"), "LEFT(",submenuFuncString); 505 addFlyAction(tr("LEFT(s,num)"), tr("LEFT(s,num)"), "LEFT(",submenuFuncString);
506 addFlyAction(tr("RIGHT(s,num)"), tr("RIGHT(s,num)"), "RIGHT(",submenuFuncString); 506 addFlyAction(tr("RIGHT(s,num)"), tr("RIGHT(s,num)"), "RIGHT(",submenuFuncString);
507 addFlyAction(tr("MID(s,pos,len)"), tr("MID(s,pos,len)"), "MID(",submenuFuncString); 507 addFlyAction(tr("MID(s,pos,len)"), tr("MID(s,pos,len)"), "MID(",submenuFuncString);
508 submenuFuncString->insertSeparator(); 508 submenuFuncString->insertSeparator();
509 addFlyAction(tr("CONCATENATE(s1,s2..)"), tr("CONCATENATE(s1,s2..)"), "CONCATENATE(",submenuFuncString); 509 addFlyAction(tr("CONCATENATE(s1,s2..)"), tr("CONCATENATE(s1,s2..)"), "CONCATENATE(",submenuFuncString);
510 addFlyAction(tr("EXACT(s1,s2)"), tr("EXACT(s1,s2)"), "EXACT(",submenuFuncString); 510 addFlyAction(tr("EXACT(s1,s2)"), tr("EXACT(s1,s2)"), "EXACT(",submenuFuncString);
511 addFlyAction(tr("FIND(what,where,pos)"), 511 addFlyAction(tr("FIND(what,where,pos)"),
512 tr("FIND(what,where,pos)"), "FIND(",submenuFuncString); 512 tr("FIND(what,where,pos)"), "FIND(",submenuFuncString);
513 addFlyAction(tr("REPLACE(s,pos,len,ns)"), tr("REPLACE(s,pos,len,ns)"), "REPLACE(",submenuFuncString); 513 addFlyAction(tr("REPLACE(s,pos,len,ns)"), tr("REPLACE(s,pos,len,ns)"), "REPLACE(",submenuFuncString);
514 addFlyAction(tr("REPT(s,n)"), tr("REPT(s,n)"), "REPT(",submenuFuncString); 514 addFlyAction(tr("REPT(s,n)"), tr("REPT(s,n)"), "REPT(",submenuFuncString);
515 submenuFuncString->insertSeparator(); 515 submenuFuncString->insertSeparator();
516 addFlyAction(tr("UPPER(s)"), tr("UPPER(s)"), "UPPER(",submenuFuncString); 516 addFlyAction(tr("UPPER(s)"), tr("UPPER(s)"), "UPPER(",submenuFuncString);
517 addFlyAction(tr("LOWER(s)"), tr("LOWER(s)"), "LOWER(",submenuFuncString); 517 addFlyAction(tr("LOWER(s)"), tr("LOWER(s)"), "LOWER(",submenuFuncString);
518 submenuFunc->insertItem(tr("&Strings"), submenuFuncString); 518 submenuFunc->insertItem(tr("&Strings"), submenuFuncString);
519 519
520 submenuFuncStat=new QPopupMenu; 520 submenuFuncStat=new QPopupMenu;
521 addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat); 521 addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat);
522 addFlyAction(tr("COUNT(range)"), tr("COUNT(range)"), "COUNT(",submenuFuncStat); 522 addFlyAction(tr("COUNT(range)"), tr("COUNT(range)"), "COUNT(",submenuFuncStat);
523 addFlyAction(tr("COUNTIF(range,eqls)"), tr("COUNTIF(range,eqls)"), "COUNTIF(",submenuFuncStat); 523 addFlyAction(tr("COUNTIF(range,eqls)"), tr("COUNTIF(range,eqls)"), "COUNTIF(",submenuFuncStat);
524 addFlyAction(tr("MAX(range)"), tr("MAX(range)"), "MAX(",submenuFuncStat); 524 addFlyAction(tr("MAX(range)"), tr("MAX(range)"), "MAX(",submenuFuncStat);
525 addFlyAction(tr("MIN(range)"), tr("MIN(range)"), "MIN(",submenuFuncStat); 525 addFlyAction(tr("MIN(range)"), tr("MIN(range)"), "MIN(",submenuFuncStat);
526 addFlyAction(tr("SUM(range)"), tr("SUM(range)"), "SUM(",submenuFuncStat); 526 addFlyAction(tr("SUM(range)"), tr("SUM(range)"), "SUM(",submenuFuncStat);
527 addFlyAction(tr("SUMSQ(range)"), tr("SUMSQ(range)"), "SUMSQ(",submenuFuncStat); 527 addFlyAction(tr("SUMSQ(range)"), tr("SUMSQ(range)"), "SUMSQ(",submenuFuncStat);
528 submenuFuncStat->insertSeparator(); 528 submenuFuncStat->insertSeparator();
529 addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat); 529 addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat);
530 addFlyAction(tr("VAR(range)"), tr("VAR(range)"), "VAR(",submenuFuncStat); 530 addFlyAction(tr("VAR(range)"), tr("VAR(range)"), "VAR(",submenuFuncStat);
531 addFlyAction(tr("VARP(range)"), tr("VARP(range)"), "VARP(",submenuFuncStat); 531 addFlyAction(tr("VARP(range)"), tr("VARP(range)"), "VARP(",submenuFuncStat);
532 addFlyAction(tr("STDEV(range)"), tr("STDEV(range)"), "STDEV(",submenuFuncStat); 532 addFlyAction(tr("STDEV(range)"), tr("STDEV(range)"), "STDEV(",submenuFuncStat);
533 addFlyAction(tr("STDEVP(range)"), tr("STDEVP(range)"), "STDEVP(",submenuFuncStat); 533 addFlyAction(tr("STDEVP(range)"), tr("STDEVP(range)"), "STDEVP(",submenuFuncStat);
534 addFlyAction(tr("SKEW(range)"), tr("SKEW(range)"), "SKEW(",submenuFuncStat); 534 addFlyAction(tr("SKEW(range)"), tr("SKEW(range)"), "SKEW(",submenuFuncStat);
535 addFlyAction(tr("KURT(range)"), tr("KURT(range)"), "KURT(",submenuFuncStat); 535 addFlyAction(tr("KURT(range)"), tr("KURT(range)"), "KURT(",submenuFuncStat);
536 submenuFunc->insertItem(tr("Sta&tistical"), submenuFuncStat); 536 submenuFunc->insertItem(tr("Sta&tistical"), submenuFuncStat);
537 537
538 submenuFuncScientific=new QPopupMenu; 538 submenuFuncScientific=new QPopupMenu;
539 addFlyAction(tr("BESSELI(x,n)"), tr("BESSELI(x,n)"), "BESSELI(",submenuFuncScientific); 539 addFlyAction(tr("BESSELI(x,n)"), tr("BESSELI(x,n)"), "BESSELI(",submenuFuncScientific);
540 addFlyAction(tr("BESSELJ(x,n)"), tr("BESSELJ(x,n)"), "BESSELJ(",submenuFuncScientific); 540 addFlyAction(tr("BESSELJ(x,n)"), tr("BESSELJ(x,n)"), "BESSELJ(",submenuFuncScientific);
541 addFlyAction(tr("BESSELK(x,n)"), tr("BESSELK(x,n)"), "BESSELK(",submenuFuncScientific); 541 addFlyAction(tr("BESSELK(x,n)"), tr("BESSELK(x,n)"), "BESSELK(",submenuFuncScientific);
542 addFlyAction(tr("BESSELY(x,n)"), tr("BESSELY(x,n)"), "BESSELY(",submenuFuncScientific); 542 addFlyAction(tr("BESSELY(x,n)"), tr("BESSELY(x,n)"), "BESSELY(",submenuFuncScientific);
543 submenuFuncScientific->insertSeparator(); 543 submenuFuncScientific->insertSeparator();
544 addFlyAction(tr("BETAI(x,a,b)"), tr("BETAI(x,a,b)"), "BETAI(",submenuFuncScientific); 544 addFlyAction(tr("BETAI(x,a,b)"), tr("BETAI(x,a,b)"), "BETAI(",submenuFuncScientific);
545 addFlyAction(tr("ERF(a,b)"), tr("ERF(a,b)"), "ERF(",submenuFuncScientific); 545 addFlyAction(tr("ERF(a,b)"), tr("ERF(a,b)"), "ERF(",submenuFuncScientific);
546 addFlyAction(tr("ERFC(a,b)"), tr("ERFC(a,b)"), "ERFC(",submenuFuncScientific); 546 addFlyAction(tr("ERFC(a,b)"), tr("ERFC(a,b)"), "ERFC(",submenuFuncScientific);
547 addFlyAction(tr("GAMMALN(x)"), tr("GAMMALN(x)"), "GAMMALN(",submenuFuncScientific); 547 addFlyAction(tr("GAMMALN(x)"), tr("GAMMALN(x)"), "GAMMALN(",submenuFuncScientific);
548 addFlyAction(tr("GAMMAP(x,a)"), tr("GAMMAP(x,a)"), "GAMMAP(",submenuFuncScientific); 548 addFlyAction(tr("GAMMAP(x,a)"), tr("GAMMAP(x,a)"), "GAMMAP(",submenuFuncScientific);
549 addFlyAction(tr("GAMMAQ(x,a)"), tr("GAMMAQ(x,a)"), "GAMMAQ(",submenuFuncScientific); 549 addFlyAction(tr("GAMMAQ(x,a)"), tr("GAMMAQ(x,a)"), "GAMMAQ(",submenuFuncScientific);
550 submenuFunc->insertItem(tr("Scienti&fic"), submenuFuncScientific); 550 submenuFunc->insertItem(tr("Scienti&fic"), submenuFuncScientific);
551 551
552 submenuFuncDistr=new QPopupMenu; 552 submenuFuncDistr=new QPopupMenu;
553 addFlyAction(tr("BETADIST(z,a,b,Q?)"), tr("BETADIST(z,a,b,Q?)"), "BETADIST(",submenuFuncDistr); 553 addFlyAction(tr("BETADIST(z,a,b,Q?)"), tr("BETADIST(z,a,b,Q?)"), "BETADIST(",submenuFuncDistr);
554 addFlyAction(tr("CHI2DIST(x,n,Q?)"), tr("CHI2DIST(x,n,Q?)"), "CHI2DIST(",submenuFuncDistr); 554 addFlyAction(tr("CHI2DIST(x,n,Q?)"), tr("CHI2DIST(x,n,Q?)"), "CHI2DIST(",submenuFuncDistr);
555 addFlyAction(tr("CHIDIST(x,n,Q?)"), tr("CHIDIST(x,n,Q?)"), "CHIDIST(",submenuFuncDistr); 555 addFlyAction(tr("CHIDIST(x,n,Q?)"), tr("CHIDIST(x,n,Q?)"), "CHIDIST(",submenuFuncDistr);
556 addFlyAction(tr("FDIST(z,deg1,deg2,Q?)"), tr("FDIST(z,deg1,deg2,Q?)"), "FDIST(",submenuFuncDistr); 556 addFlyAction(tr("FDIST(z,deg1,deg2,Q?)"), tr("FDIST(z,deg1,deg2,Q?)"), "FDIST(",submenuFuncDistr);
557 addFlyAction(tr("GAMMADIST(x,a,b,Q?)"), tr("GAMMADIST(x,a,b,Q?)"), "GAMMADIST(",submenuFuncDistr); 557 addFlyAction(tr("GAMMADIST(x,a,b,Q?)"), tr("GAMMADIST(x,a,b,Q?)"), "GAMMADIST(",submenuFuncDistr);
558 addFlyAction(tr("NORMALDIST(x,m,s,Q?)"), tr("NORMALDIST(x,m,s,Q?)"), "NORMALDIST(",submenuFuncDistr); 558 addFlyAction(tr("NORMALDIST(x,m,s,Q?)"), tr("NORMALDIST(x,m,s,Q?)"), "NORMALDIST(",submenuFuncDistr);
559 addFlyAction(tr("PHI(x,Q?)"), tr("PHI(x,Q?)"), "PHI(",submenuFuncDistr); 559 addFlyAction(tr("PHI(x,Q?)"), tr("PHI(x,Q?)"), "PHI(",submenuFuncDistr);
560 addFlyAction(tr("POISSON(x,n,Q?)"), tr("POISSON(x,n,Q?)"), "POISSON(",submenuFuncDistr); 560 addFlyAction(tr("POISSON(x,n,Q?)"), tr("POISSON(x,n,Q?)"), "POISSON(",submenuFuncDistr);
561 submenuFunc->insertItem(tr("&Distributions"), submenuFuncDistr); 561 submenuFunc->insertItem(tr("&Distributions"), submenuFuncDistr);
562 562
563 563
564 564
565 menuInsert->insertSeparator(); 565 menuInsert->insertSeparator();
566 insertCells->addTo(menuInsert); 566 insertCells->addTo(menuInsert);
567 insertRows->addTo(menuInsert); 567 insertRows->addTo(menuInsert);
568 insertCols->addTo(menuInsert); 568 insertCols->addTo(menuInsert);
569 insertSheets->addTo(menuInsert); 569 insertSheets->addTo(menuInsert);
570} 570}
571 571
572void MainWindow::initStandardToolbar() 572void MainWindow::initStandardToolbar()
573{ 573{
574 toolbarStandard=new QToolBar(this); 574 toolbarStandard=new QToolBar(this);
575 toolbarStandard->setHorizontalStretchable(TRUE); 575 toolbarStandard->setHorizontalStretchable(TRUE);
576 moveToolBar(toolbarStandard, Top); 576 moveToolBar(toolbarStandard, Top);
577 577
578 fileNew->addTo(toolbarStandard); 578 fileNew->addTo(toolbarStandard);
579 fileOpen->addTo(toolbarStandard); 579 fileOpen->addTo(toolbarStandard);
580 fileSave->addTo(toolbarStandard); 580 fileSave->addTo(toolbarStandard);
581 581
582 comboSheets=new QComboBox(toolbarStandard); 582 comboSheets=new QComboBox(toolbarStandard);
583 toolbarStandard->setStretchableWidget(comboSheets); 583 toolbarStandard->setStretchableWidget(comboSheets);
584 connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &))); 584 connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &)));
585} 585}
586 586
587void MainWindow::initFunctionsToolbar() 587void MainWindow::initFunctionsToolbar()
588{ 588{
589 toolbarFunctions=new QToolBar(this); 589 toolbarFunctions=new QToolBar(this);
590 toolbarFunctions->setHorizontalStretchable(TRUE); 590 toolbarFunctions->setHorizontalStretchable(TRUE);
591 moveToolBar(toolbarFunctions, Bottom); 591 moveToolBar(toolbarFunctions, Bottom);
592 592
593 funcEqual->addTo(toolbarFunctions); 593 funcEqual->addTo(toolbarFunctions);
594 funcPlus->addTo(toolbarFunctions); 594 funcPlus->addTo(toolbarFunctions);
595 funcMinus->addTo(toolbarFunctions); 595 funcMinus->addTo(toolbarFunctions);
596 funcCross->addTo(toolbarFunctions); 596 funcCross->addTo(toolbarFunctions);
597 funcDivide->addTo(toolbarFunctions); 597 funcDivide->addTo(toolbarFunctions);
598 funcParanOpen->addTo(toolbarFunctions); 598 funcParanOpen->addTo(toolbarFunctions);
599 funcParanClose->addTo(toolbarFunctions); 599 funcParanClose->addTo(toolbarFunctions);
600 funcComma->addTo(toolbarFunctions); 600 funcComma->addTo(toolbarFunctions);
601 601
602 toolFunction=new QToolButton(toolbarFunctions); 602 toolFunction=new QToolButton(toolbarFunctions);
603 toolFunction->setPixmap(Resource::loadPixmap( "opie-sheet/func_func" )); 603 toolFunction->setPixmap(Resource::loadPixmap( "opie-sheet/func-func" ));
604 toolFunction->setTextLabel(tr("Functions")); 604 toolFunction->setTextLabel(tr("Functions"));
605 toolFunction->setPopup(submenuFunc); 605 toolFunction->setPopup(submenuFunc);
606 toolFunction->setPopupDelay(0); 606 toolFunction->setPopupDelay(0);
607} 607}
608 608
609void MainWindow::initEditToolbar() 609void MainWindow::initEditToolbar()
610{ 610{
611 toolbarEdit=new QToolBar(this); 611 toolbarEdit=new QToolBar(this);
612 toolbarEdit->setHorizontalStretchable(TRUE); 612 toolbarEdit->setHorizontalStretchable(TRUE);
613 moveToolBar(toolbarEdit, Bottom); 613 moveToolBar(toolbarEdit, Bottom);
614 614
615 editAccept->addTo(toolbarEdit); 615 editAccept->addTo(toolbarEdit);
616 editCancel->addTo(toolbarEdit); 616 editCancel->addTo(toolbarEdit);
617 617
618 editData=new QLineEdit(toolbarEdit); 618 editData=new QLineEdit(toolbarEdit);
619 toolbarEdit->setStretchableWidget(editData); 619 toolbarEdit->setStretchableWidget(editData);
620 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); 620 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept()));
621 621
622 editCellSelect->addTo(toolbarEdit); 622 editCellSelect->addTo(toolbarEdit);
623} 623}
624 624
625void MainWindow::slotHelpAbout() 625void MainWindow::slotHelpAbout()
626{ 626{
627 QDialog dialogAbout(this, 0, TRUE); 627 QDialog dialogAbout(this, 0, TRUE);
628 dialogAbout.resize(width()-40, height()-80); 628 dialogAbout.resize(width()-40, height()-80);
629 dialogAbout.setCaption(tr("About Opie Sheet")); 629 dialogAbout.setCaption(tr("About Opie Sheet"));
630 630
631 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); 631 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout);
632 label.setGeometry(dialogAbout.rect()); 632 label.setGeometry(dialogAbout.rect());
633 label.setAlignment(Qt::AlignCenter | Qt::WordBreak); 633 label.setAlignment(Qt::AlignCenter | Qt::WordBreak);
634 634
635 dialogAbout.exec(); 635 dialogAbout.exec();
636} 636}
637 637
638void MainWindow::initSheet() 638void MainWindow::initSheet()
639{ 639{
640 sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); 640 sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this);
641 setCentralWidget(sheet); 641 setCentralWidget(sheet);
642 642
643 connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); 643 connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &)));
644 connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); 644 connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &)));
645 connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); 645 connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified()));
646 646
647 connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); 647 connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut()));
648 connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); 648 connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy()));
649 connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear())); 649 connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear()));
650} 650}
651 651
652void MainWindow::slotEditAccept() 652void MainWindow::slotEditAccept()
653{ 653{
654 sheet->setData(editData->text()); 654 sheet->setData(editData->text());
655} 655}
656 656
657void MainWindow::slotEditCancel() 657void MainWindow::slotEditCancel()
658{ 658{
659 editData->setText(sheet->getData()); 659 editData->setText(sheet->getData());
660} 660}
661 661
662void MainWindow::slotCellSelect(bool lock) 662void MainWindow::slotCellSelect(bool lock)
663{ 663{
664 sheet->lockClicks(lock); 664 sheet->lockClicks(lock);
665} 665}
666 666
667void MainWindow::addToData(const QString &data) 667void MainWindow::addToData(const QString &data)
668{ 668{
669 editData->setText(editData->text().insert(editData->cursorPosition(), data)); 669 editData->setText(editData->text().insert(editData->cursorPosition(), data));
670} 670}
671 671
672void MainWindow::slotFuncOutput() 672void MainWindow::slotFuncOutput()
673{ 673{
674 if (sender()->isA("QAction")) 674 if (sender()->isA("QAction"))
675 addToData(((QAction *)sender())->toolTip()); 675 addToData(((QAction *)sender())->toolTip());
676} 676}
677 677
678void MainWindow::slotInsertRows() 678void MainWindow::slotInsertRows()
679{ 679{
680 NumberDialog dialogNumber(this); 680 NumberDialog dialogNumber(this);
681 if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted) 681 if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted)
682 sheet->insertRows(dialogNumber.getValue()); 682 sheet->insertRows(dialogNumber.getValue());
683} 683}
684 684
685void MainWindow::slotInsertCols() 685void MainWindow::slotInsertCols()
686{ 686{
687 NumberDialog dialogNumber(this); 687 NumberDialog dialogNumber(this);
688 if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted) 688 if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted)
689 sheet->insertColumns(dialogNumber.getValue()); 689 sheet->insertColumns(dialogNumber.getValue());
690} 690}
691 691
692void MainWindow::slotInsertSheets() 692void MainWindow::slotInsertSheets()
693{ 693{
694 NumberDialog dialogNumber(this); 694 NumberDialog dialogNumber(this);
695 if (dialogNumber.exec(tr("Add Sheets"), tr("&Number of sheets:"))==QDialog::Accepted) 695 if (dialogNumber.exec(tr("Add Sheets"), tr("&Number of sheets:"))==QDialog::Accepted)
696 for (int i=dialogNumber.getValue(); i>0; --i) createNewSheet(); 696 for (int i=dialogNumber.getValue(); i>0; --i) createNewSheet();
697} 697}
698 698
699void MainWindow::slotCellClicked(const QString &cell) 699void MainWindow::slotCellClicked(const QString &cell)
700{ 700{
701 editCellSelect->setOn(FALSE); 701 editCellSelect->setOn(FALSE);
702 addToData(cell); 702 addToData(cell);
703} 703}
704 704
705typeSheet *MainWindow::createNewSheet() 705typeSheet *MainWindow::createNewSheet()
706{ 706{
707 typeSheet *newSheet=new typeSheet; 707 typeSheet *newSheet=new typeSheet;
708 int currentNo=1, tempNo=0; 708 int currentNo=1, tempNo=0;
709 bool ok; 709 bool ok;
710 710
711 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next()) 711 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next())
712 if (tempSheet->name.startsWith(tr("Sheet")) && (tempNo=tempSheet->name.mid(tr("Sheet").length()).toInt(&ok))>=currentNo && ok) 712 if (tempSheet->name.startsWith(tr("Sheet")) && (tempNo=tempSheet->name.mid(tr("Sheet").length()).toInt(&ok))>=currentNo && ok)
713 currentNo=tempNo+1; 713 currentNo=tempNo+1;
714 714
715 newSheet->name=tr("Sheet")+QString::number(currentNo); 715 newSheet->name=tr("Sheet")+QString::number(currentNo);
716 newSheet->data.setAutoDelete(TRUE); 716 newSheet->data.setAutoDelete(TRUE);
717 717
718 comboSheets->insertItem(newSheet->name); 718 comboSheets->insertItem(newSheet->name);
719 listSheets.append(newSheet); 719 listSheets.append(newSheet);
720 return newSheet; 720 return newSheet;
721} 721}
722 722
723typeSheet *MainWindow::findSheet(const QString &name) 723typeSheet *MainWindow::findSheet(const QString &name)
724{ 724{
725 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next()) 725 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next())
726 if (tempSheet->name==name) 726 if (tempSheet->name==name)
727 return tempSheet; 727 return tempSheet;
728 return NULL; 728 return NULL;
729} 729}
730 730
731void MainWindow::slotSheetChanged(const QString &name) 731void MainWindow::slotSheetChanged(const QString &name)
732{ 732{
733 sheet->copySheetData(&findSheet(sheet->getName())->data); 733 sheet->copySheetData(&findSheet(sheet->getName())->data);
734 sheet->setName(name); 734 sheet->setName(name);
735 sheet->setSheetData(&findSheet(name)->data); 735 sheet->setSheetData(&findSheet(name)->data);
736 sheet->ReCalc(); 736 sheet->ReCalc();
737} 737}
738 738
739void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w) 739void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w)
740{ 740{
741 QAction *action=new QAction(text, menuText, 0, this); 741 QAction *action=new QAction(text, menuText, 0, this);
742 action->setToolTip(tip); 742 action->setToolTip(tip);
743 connect(action, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 743 connect(action, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
744 action->addTo(w); 744 action->addTo(w);
745} 745}
746 746
747void MainWindow::slotFormatCells() 747void MainWindow::slotFormatCells()
748{ 748{
749 CellFormat dialogCellFormat(this); 749 CellFormat dialogCellFormat(this);
750 dialogCellFormat.showMaximized(); 750 dialogCellFormat.showMaximized();
751 dialogCellFormat.exec(sheet); 751 dialogCellFormat.exec(sheet);
752} 752}
753 753
754void MainWindow::slotEditPaste() 754void MainWindow::slotEditPaste()
755{ 755{
756 sheet->editPaste(); 756 sheet->editPaste();
757} 757}
758 758
759void MainWindow::slotEditPasteContents() 759void MainWindow::slotEditPasteContents()
760{ 760{
761 sheet->editPaste(TRUE); 761 sheet->editPaste(TRUE);
762} 762}
763 763
764void MainWindow::slotRowHeight() 764void MainWindow::slotRowHeight()
765{ 765{
766 int row1, row2, col1, col2; 766 int row1, row2, col1, col2;
767 sheet->getSelection(&row1, &col1, &row2, &col2); 767 sheet->getSelection(&row1, &col1, &row2, &col2);
768 768
769 NumberDialog dialogNumber(this); 769 NumberDialog dialogNumber(this);
770 if (dialogNumber.exec(tr("Row Height"), tr("&Height of each row:"), sheet->rowHeight(row1))==QDialog::Accepted) 770 if (dialogNumber.exec(tr("Row Height"), tr("&Height of each row:"), sheet->rowHeight(row1))==QDialog::Accepted)
771 { 771 {
772 int newHeight=dialogNumber.getValue(), row; 772 int newHeight=dialogNumber.getValue(), row;
773 for (row=row1; row<=row2; ++row) 773 for (row=row1; row<=row2; ++row)
774 sheet->setRowHeight(row, newHeight); 774 sheet->setRowHeight(row, newHeight);
775 } 775 }
776} 776}
777 777
778void MainWindow::slotRowAdjust() 778void MainWindow::slotRowAdjust()
779{ 779{
780 int row1, row2, col1, col2; 780 int row1, row2, col1, col2;
781 sheet->getSelection(&row1, &col1, &row2, &col2); 781 sheet->getSelection(&row1, &col1, &row2, &col2);
782 782
783 for (int row=row1; row<=row2; ++row) 783 for (int row=row1; row<=row2; ++row)
784 sheet->adjustRow(row); 784 sheet->adjustRow(row);
785} 785}
786 786
787void MainWindow::slotRowShow() 787void MainWindow::slotRowShow()
788{ 788{
789 int row1, row2, col1, col2; 789 int row1, row2, col1, col2;
790 sheet->getSelection(&row1, &col1, &row2, &col2); 790 sheet->getSelection(&row1, &col1, &row2, &col2);
791 791
792 for (int row=row1; row<=row2; ++row) 792 for (int row=row1; row<=row2; ++row)
793 sheet->showRow(row); 793 sheet->showRow(row);
794} 794}
795 795